diff --git a/.taskcluster.yml b/.taskcluster.yml index c8034ae7c..99588ad7f 100644 --- a/.taskcluster.yml +++ b/.taskcluster.yml @@ -489,3 +489,33 @@ tasks: description: Code Coverage Github automated release owner: bastien@mozilla.com source: https://github.com/mozilla/code-coverage + + - $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"' + then: + taskId: {$eval: as_slugid("report_deploy_pypi")} + dependencies: + - {$eval: as_slugid("report_check_tests")} + provisionerId: proj-relman + workerType: ci + created: {$fromNow: ''} + deadline: {$fromNow: '1 hour'} + payload: + features: + # Needed for access to secret + taskclusterProxy: true + maxRunTime: 3600 + image: "${taskboot_image}" + env: + TASKCLUSTER_SECRET: "project/relman/code-coverage/release" + command: + - sh + - -lxce + - "git clone ${repository} /project && cd /project && git checkout ${head_rev} -b release && + taskboot --target=/project/report deploy-pypi" + scopes: + - "secrets:get:project/relman/code-coverage/release" + metadata: + name: "Code Coverage Report: publish on pypi" + description: Code Coverage Github Pypi publication for report + owner: bastien@mozilla.com + source: https://github.com/mozilla/code-coverage diff --git a/report/MANIFEST.in b/report/MANIFEST.in index e0e8ed891..8d28c45e5 100644 --- a/report/MANIFEST.in +++ b/report/MANIFEST.in @@ -1,3 +1,6 @@ recursive-exclude * __pycache__ recursive-exclude * *.py[co] recursive-exclude tests * + +include VERSION +include *.txt diff --git a/report/VERSION b/report/VERSION new file mode 100644 index 000000000..0664a8fd2 --- /dev/null +++ b/report/VERSION @@ -0,0 +1 @@ +1.1.6 diff --git a/report/ci-test.sh b/report/ci-test.sh index ab05ba22d..750c87d58 100755 --- a/report/ci-test.sh +++ b/report/ci-test.sh @@ -4,4 +4,5 @@ pip install --disable-pip-version-check --no-cache-dir --quiet -r test-requireme python -m unittest discover tests python setup.py sdist bdist_wheel -pip install dist/firefox_code_coverage-1.0.0.tar.gz +VERSION=$(cat VERSION) +pip install dist/firefox-code-coverage-$VERSION.tar.gz diff --git a/report/setup.py b/report/setup.py index 1f1ca0d82..1630e85b0 100644 --- a/report/setup.py +++ b/report/setup.py @@ -1,12 +1,45 @@ # -*- coding: utf-8 -*- +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. -from setuptools import find_packages -from setuptools import setup +import setuptools -setup( - name="firefox_code_coverage", - version="1.0.0", + +def read_requirements(file_): + lines = [] + with open(file_) as f: + for line in f.readlines(): + line = line.strip() + if line.startswith("https://"): + line = line.split("#")[1].split("egg=")[1] + elif line == "" or line.startswith("#") or line.startswith("-"): + continue + line = line.split("#")[0].strip() + lines.append(line) + return sorted(list(set(lines))) + + +with open("VERSION") as f: + VERSION = f.read().strip() + + +setuptools.setup( + name="firefox-code-coverage", + version=VERSION, description="Code Coverage Report generator for Firefox", - packages=find_packages(exclude=["contrib", "docs", "tests"]), + author="Mozilla Release Management Analysis (sallt)", + author_email="release-mgmt-analysis@mozilla.com", + url="https://github.com/mozilla/code-coverage", + tests_require=read_requirements("test-requirements.txt"), + install_requires=read_requirements("requirements.txt"), + packages=setuptools.find_packages(), + include_package_data=True, + zip_safe=False, license="MPL2", + entry_points={ + "console_scripts": [ + "firefox-code-coverage = firefox_code_coverage.codecoverage:main" + ] + }, )