Skip to content

Commit 765a0c4

Browse files
authored
report: Deploy on PyPi, fixes #238 (#389)
1 parent 777bff6 commit 765a0c4

File tree

5 files changed

+75
-7
lines changed

5 files changed

+75
-7
lines changed

.taskcluster.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,3 +489,33 @@ tasks:
489489
description: Code Coverage Github automated release
490490
491491
source: https://github.com/mozilla/code-coverage
492+
493+
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
494+
then:
495+
taskId: {$eval: as_slugid("report_deploy_pypi")}
496+
dependencies:
497+
- {$eval: as_slugid("report_check_tests")}
498+
provisionerId: proj-relman
499+
workerType: ci
500+
created: {$fromNow: ''}
501+
deadline: {$fromNow: '1 hour'}
502+
payload:
503+
features:
504+
# Needed for access to secret
505+
taskclusterProxy: true
506+
maxRunTime: 3600
507+
image: "${taskboot_image}"
508+
env:
509+
TASKCLUSTER_SECRET: "project/relman/code-coverage/release"
510+
command:
511+
- sh
512+
- -lxce
513+
- "git clone ${repository} /project && cd /project && git checkout ${head_rev} -b release &&
514+
taskboot --target=/project/report deploy-pypi"
515+
scopes:
516+
- "secrets:get:project/relman/code-coverage/release"
517+
metadata:
518+
name: "Code Coverage Report: publish on pypi"
519+
description: Code Coverage Github Pypi publication for report
520+
521+
source: https://github.com/mozilla/code-coverage

report/MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
recursive-exclude * __pycache__
22
recursive-exclude * *.py[co]
33
recursive-exclude tests *
4+
5+
include VERSION
6+
include *.txt

report/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.1.6

report/ci-test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ pip install --disable-pip-version-check --no-cache-dir --quiet -r test-requireme
44

55
python -m unittest discover tests
66
python setup.py sdist bdist_wheel
7-
pip install dist/firefox_code_coverage-1.0.0.tar.gz
7+
VERSION=$(cat VERSION)
8+
pip install dist/firefox-code-coverage-$VERSION.tar.gz

report/setup.py

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,45 @@
11
# -*- coding: utf-8 -*-
2+
# This Source Code Form is subject to the terms of the Mozilla Public
3+
# License, v. 2.0. If a copy of the MPL was not distributed with this
4+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
25

3-
from setuptools import find_packages
4-
from setuptools import setup
6+
import setuptools
57

6-
setup(
7-
name="firefox_code_coverage",
8-
version="1.0.0",
8+
9+
def read_requirements(file_):
10+
lines = []
11+
with open(file_) as f:
12+
for line in f.readlines():
13+
line = line.strip()
14+
if line.startswith("https://"):
15+
line = line.split("#")[1].split("egg=")[1]
16+
elif line == "" or line.startswith("#") or line.startswith("-"):
17+
continue
18+
line = line.split("#")[0].strip()
19+
lines.append(line)
20+
return sorted(list(set(lines)))
21+
22+
23+
with open("VERSION") as f:
24+
VERSION = f.read().strip()
25+
26+
27+
setuptools.setup(
28+
name="firefox-code-coverage",
29+
version=VERSION,
930
description="Code Coverage Report generator for Firefox",
10-
packages=find_packages(exclude=["contrib", "docs", "tests"]),
31+
author="Mozilla Release Management Analysis (sallt)",
32+
author_email="[email protected]",
33+
url="https://github.com/mozilla/code-coverage",
34+
tests_require=read_requirements("test-requirements.txt"),
35+
install_requires=read_requirements("requirements.txt"),
36+
packages=setuptools.find_packages(),
37+
include_package_data=True,
38+
zip_safe=False,
1139
license="MPL2",
40+
entry_points={
41+
"console_scripts": [
42+
"firefox-code-coverage = firefox_code_coverage.codecoverage:main"
43+
]
44+
},
1245
)

0 commit comments

Comments
 (0)