From fb3a25ccd5175c8562718bc90754e3e09f0eaf58 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Fri, 21 Aug 2020 07:57:14 -0400 Subject: [PATCH 01/16] Remove token restrictions (#289) * Remove token restrictions * Update version to 2.1.9 * Fix tests * force * Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ README.md | 12 +++++++----- codecov/__init__.py | 9 --------- codecov/__version__.py | 2 +- tests/test.py | 12 ------------ 5 files changed, 12 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e77e6c84..ceb3f69e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### `2.1.9` + +- [#289](https://github.com/codecov/codecov-python/pull/289)Remove token restriction as it is changed server-side + ### `2.1.8` - [#285](https://github.com/codecov/codecov-python/pull/285)Add support for CODECOV_FLAGS diff --git a/README.md b/README.md index ab54a802..600b86e3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ -Codecov Global Python Uploader ![PyPI](https://img.shields.io/pypi/v/codecov) [![codecov.io](https://codecov.io/github/codecov/codecov-python/coverage.svg?branch=master)](https://codecov.io/github/codecov/codecov-python) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) +Codecov Global Python Uploader +[![codecov.io](https://codecov.io/github/codecov/codecov-python/coverage.svg?branch=master)](https://codecov.io/github/codecov/codecov-python) +![PyPI](https://img.shields.io/pypi/v/codecov) +[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) ======= -| [https://codecov.io/][1] | [https://community.codecov.io/][2] | [@codecov][3] | [hello@codecov.io][4] | -| ------------------------ | ---------------------------------- | ------------- | --------------------- | +| [Support][1] | [Documentation][2] | [Community Boards][3] | [Twitter][4] | +| ------------ | ------------------ | --------------------- | ------------ | Find coverage reports for all the [languages below](#languages), gather them and submit them to Codecov. @@ -100,10 +103,9 @@ If you're seeing an **HTTP 400 error when uploading reports to S3**, make sure y -[1]: https://codecov.io/ +[1]: https://codecov.io/support/ [2]: https://community.codecov.io/ [3]: https://twitter.com/codecov -[4]: mailto:hello@codecov.io ## Copyright diff --git a/codecov/__init__.py b/codecov/__init__.py index be62793d..e9645540 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -953,8 +953,6 @@ def main(*argv, **kwargs): if _slug: query["slug"] = _slug.groups()[1] - assert query.get("job") or query.get("token"), "Missing repository upload token" - # Processing gcov # --------------- if "gcov" in codecov.disable: @@ -1189,13 +1187,6 @@ def main(*argv, **kwargs): "Tip: See all example repositories: https://github.com/codecov?query=example" ) - write("Support channels:", "green") - write( - " Email: hello@codecov.io\n" - " IRC: #codecov\n" - " Gitter: https://gitter.im/codecov/support\n" - " Twitter: @codecov\n" - ) sys.exit(1 if codecov.required else 0) else: diff --git a/codecov/__version__.py b/codecov/__version__.py index 8e0b8295..26010cbb 100644 --- a/codecov/__version__.py +++ b/codecov/__version__.py @@ -5,4 +5,4 @@ __license__ = "Apache 2.0" __title__ = "codecov" __url__ = "https://github.com/codecov/codecov-python" -__version__ = "2.1.8" +__version__ = "2.1.9" diff --git a/tests/test.py b/tests/test.py index de4af8e8..39ca23a9 100644 --- a/tests/test.py +++ b/tests/test.py @@ -294,18 +294,6 @@ def test_send_error(self): else: raise Exception("400 never raised") - @data((dict(commit="sha"), "Missing repository upload token"),) - def test_require_branch(self, dd): - (kwargs, reason) = dd - # this is so we dont get branch for local git - self.set_env(JENKINS_URL="hello") - try: - self.run_cli(**kwargs) - except AssertionError as e: - self.assertEqual(str(e), reason) - else: - raise Exception("Did not raise AssertionError") - @unittest.skipIf( os.getenv("CI") == "True" and os.getenv("APPVEYOR") == "True", "Skip AppVeyor CI test", From ff88f77bdccc08fd584f5423acdbb076ee8b3cf0 Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Wed, 26 Aug 2020 09:40:40 -0400 Subject: [PATCH 02/16] Update python versions (#291) * Update python versions * Add 3.8 on GHA --- .github/workflows/build-test.yml | 2 +- .travis.yml | 4 ++-- setup.py | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 05b442a9..7d826ac4 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7] + python-version: [3.5, 3.6, 3.7, 3.8] steps: - uses: actions/checkout@v2 diff --git a/.travis.yml b/.travis.yml index 2e6150f9..238470ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,10 +7,10 @@ sudo: false python: - 2.7 - pypy - - 3.4 - 3.5 - 3.6 - 3.7 + - 3.8 - pypy3 matrix: include: @@ -24,7 +24,7 @@ matrix: - python-requests - python-coverage - python-mock - - python: 3.7 + - python: 3.8 dist: xenial script: make format diff --git a/setup.py b/setup.py index 4d418234..6deb6ae6 100644 --- a/setup.py +++ b/setup.py @@ -15,6 +15,7 @@ "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", "Programming Language :: Python :: Implementation :: PyPy", "License :: OSI Approved :: Apache Software License", "Topic :: Software Development :: Testing", From 14753520f744971720da9d8d10c8bf2f631a7608 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 26 Aug 2020 09:59:24 -0400 Subject: [PATCH 03/16] Bump coverage from 4.5.4 to 5.2.1 (#290) Bumps [coverage](https://github.com/nedbat/coveragepy) from 4.5.4 to 5.2.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/coverage-4.5.4...coverage-5.2.1) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index b6f891ef..c7ff8052 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,4 +1,4 @@ -coverage==4.5.4 +coverage==5.2.1 ddt mock pytest>=4.6.0 From 6795ee05baa53172eb1c00b1e945fffa1d20e26e Mon Sep 17 00:00:00 2001 From: fossabot Date: Wed, 26 Aug 2020 17:44:13 -0500 Subject: [PATCH 04/16] Add license scan report and status (#292) Signed off by: fossabot --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 600b86e3..28d3b0f3 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ Codecov Global Python Uploader [![codecov.io](https://codecov.io/github/codecov/codecov-python/coverage.svg?branch=master)](https://codecov.io/github/codecov/codecov-python) ![PyPI](https://img.shields.io/pypi/v/codecov) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-python.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-python?ref=badge_shield) ======= | [Support][1] | [Documentation][2] | [Community Boards][3] | [Twitter][4] | | ------------ | ------------------ | --------------------- | ------------ | @@ -110,3 +111,7 @@ If you're seeing an **HTTP 400 error when uploading reports to S3**, make sure y ## Copyright > Copyright 2014-2020 codecov + + +## License +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-python.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-python?ref=badge_large) \ No newline at end of file From bf97a8bd807cd7839476f63b79b5ae22ae075d5e Mon Sep 17 00:00:00 2001 From: Thomas Hu Date: Mon, 31 Aug 2020 11:41:56 -0400 Subject: [PATCH 05/16] Update README with accurate links (#294) * Update README with accurate links * force * format * format * last format --- Makefile | 2 +- README.md | 10 ++++++---- tests/test.py | 6 ++++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 7eae04f4..fae2de1e 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ test: py.test tests/test.py --cov=codecov format: - black . --check + black . -v -t py38 --check --diff compare: hub compare $(shell git tag --sort=refname | tail -1)...master diff --git a/README.md b/README.md index 28d3b0f3..d3a4a306 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -Codecov Global Python Uploader +# Codecov Global Python Uploader + [![codecov.io](https://codecov.io/github/codecov/codecov-python/coverage.svg?branch=master)](https://codecov.io/github/codecov/codecov-python) ![PyPI](https://img.shields.io/pypi/v/codecov) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) @@ -105,8 +106,9 @@ If you're seeing an **HTTP 400 error when uploading reports to S3**, make sure y [1]: https://codecov.io/support/ -[2]: https://community.codecov.io/ -[3]: https://twitter.com/codecov +[2]: https://docs.codecov.io/ +[3]: https://community.codecov.io/ +[4]: https://twitter.com/codecov ## Copyright @@ -114,4 +116,4 @@ If you're seeing an **HTTP 400 error when uploading reports to S3**, make sure y ## License -[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-python.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-python?ref=badge_large) \ No newline at end of file +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-python.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-python?ref=badge_large) diff --git a/tests/test.py b/tests/test.py index 39ca23a9..d17a0f77 100644 --- a/tests/test.py +++ b/tests/test.py @@ -278,7 +278,7 @@ def test_send(self): gzip_worker.decompress(put.call_args[1]["data"]) + gzip_worker.flush() ) - assert u"tests/test.py".encode("utf-8") in reports + assert "tests/test.py".encode("utf-8") in reports def test_send_error(self): with patch("requests.post") as post: @@ -866,7 +866,9 @@ def test_ci_gitlab(self): ) def test_ci_github(self): self.set_env( - HOME="/", CODECOV_TOKEN="token", CODECOV_NAME="name", + HOME="/", + CODECOV_TOKEN="token", + CODECOV_NAME="name", ) self.fake_report() res = self.run_cli() From 663888151217ff585b206ff721a61c429070a4ad Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Wed, 9 Sep 2020 22:58:13 +0200 Subject: [PATCH 06/16] Improve error reporting in the "try_run" function and correctly include original command output in the error message (#153) * Log more info when a command fails. * Also log return code. * Correctly include process output with the thrown exception. * Include returncode before the output. * Update codecov/__init__.py * black Co-authored-by: Thomas Hu Co-authored-by: Thomas Hu --- codecov/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/codecov/__init__.py b/codecov/__init__.py index e9645540..d3cc9d4f 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -213,7 +213,7 @@ def check_output(cmd, **popen_args): process = Popen(cmd, stdout=PIPE, **popen_args) output, _ = process.communicate() if process.returncode: - raise CalledProcessError(process.returncode, cmd) + raise CalledProcessError(process.returncode, cmd, output) else: assert process.returncode == 0 return output.decode("utf-8") @@ -223,7 +223,10 @@ def try_to_run(cmd, shell=False, cwd=None): try: return check_output(cmd, shell=shell, cwd=cwd) except Exception as e: - write(" Error running `%s`: %s" % (cmd, e or str(e))) + write( + " Error running `%s`: returncode=%s, output=%s" + % (cmd, e.returncode, str(getattr(e, "output", str(e)))) + ) return None From 0c56f298e88e609370b05ae2aa8d77e150518745 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 14 Sep 2020 09:13:24 -0400 Subject: [PATCH 07/16] Bump coverage from 5.2.1 to 5.3 (#296) Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.2.1 to 5.3. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.2.1...coverage-5.3) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index c7ff8052..0d22b4bd 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,4 +1,4 @@ -coverage==5.2.1 +coverage==5.3 ddt mock pytest>=4.6.0 From 2574d1b7c327d71df447551395e374441c38775f Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Mon, 14 Sep 2020 14:45:46 -0700 Subject: [PATCH 08/16] Added sleep between upload retries. (#295) * Added sleep 2s between upload retries. * Set default retries to 5 same as bash uploader. * Log retry attempts. --- codecov/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/codecov/__init__.py b/codecov/__init__.py index d3cc9d4f..3d6f4fc5 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -290,11 +290,14 @@ def generate_toc(root): return str(res).strip() or "" -def retry_upload(url, request_method, retries=3, break_codes=(200,), **kwargs): - for _ in range(retries): +def retry_upload(url, request_method, retries=5, break_codes=(200,), **kwargs): + wait_seconds = 2 + for i in range(retries): res = request_method(url, **kwargs) if res.status_code in break_codes: return res + write(" Retrying {0}/{1} in {2}s..".format(i + 1, retries, wait_seconds)) + sleep(wait_seconds) return res @@ -412,7 +415,7 @@ def main(*argv, **kwargs): advanced.add_argument("--tag", default=None, help="Git tag") advanced.add_argument( "--tries", - default=3, + default=5, type=int, help="Specify the total number of attempts to make when uploading coverage report", ) From 9137404b785122973abce66515c58d8999d0dbce Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 15 Sep 2020 17:06:07 +0200 Subject: [PATCH 09/16] Output elapsed time with S3 upload (#148) * Output elapsed time with S3 upload It seems that it fails with "Forbidden" when it takes longer than 15s, so this at least helps with debugging that. The Bash uploader gzips the data file, so it is faster to upload and does not trigger it with the given data file / internet connection. (Pdb++) s3.text '\nAccessDeniedRequest has expired2018-05-19T11:58:04Z2018-05-19T11:58:10ZEFE63A2DA8CE9726LXoeTEXV7h3wN5DICvZg/U6uWIeyOgkJ1JnyEOQCpKNkQtpst4qKhkxuTgPnJeV3uB1jOexYP+s=' * black Co-authored-by: Thomas Hu --- codecov/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/codecov/__init__.py b/codecov/__init__.py index 3d6f4fc5..fd6ac89b 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -1149,6 +1149,7 @@ def main(*argv, **kwargs): ) s3.raise_for_status() assert s3.status_code == 200 + write(" Uploading to S3 took %s" % s3.elapsed) write(" " + result) success = True From dd8fe1a4b69ec71feb28553e74f93abe152703a8 Mon Sep 17 00:00:00 2001 From: Sajith Sasidharan Date: Tue, 15 Sep 2020 18:54:18 -0400 Subject: [PATCH 10/16] Ignore emacs lisp files (#297) Tahoe-LAFS project has a file named `/misc/coding_tools/coverage.el`, which is often uploaded to codecov along with the regular coverage report. I'm not sure it is doing any harm, but can't be doing anything useful either! It would be nice if codecov could ignore `.el` files. --- codecov/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/codecov/__init__.py b/codecov/__init__.py index fd6ac89b..370c03ff 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -88,6 +88,7 @@ def sanitize_arg(replacement, arg): r"(/\.coverage.*)|" r"(\.coveragerc)|" r"(\.egg)|" + r"(\.el)|" r"(\.gif)|" r"(\.ini)|" r"(\.less)|" From 713d94113e9b1189f227adc6131f04c65e4f967b Mon Sep 17 00:00:00 2001 From: Pierre Augier Date: Mon, 21 Sep 2020 21:20:12 +0200 Subject: [PATCH 11/16] Fix error try_to_run using | without shell=True (#298) --- codecov/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov/__init__.py b/codecov/__init__.py index 370c03ff..e337717e 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -869,7 +869,7 @@ def main(*argv, **kwargs): try: query["commit"] = try_to_run( ["git", "rev-parse", "HEAD"] - ) or try_to_run(["hg", "id", "-i", "--debug", "|", "tr", "-d", "'+'"]) + ) or try_to_run(["hg", "log", "-r", ".", "-T", "{node}"]) write(" -> Got sha from git/hg") except: # pragma: no cover From 76b4f7cbb5602332eac3bcae027b9fa24efbf4ac Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Fri, 9 Oct 2020 08:32:28 -0400 Subject: [PATCH 12/16] Bump to 2.1.10 (#300) --- CHANGELOG.md | 16 ++++++++++++++++ codecov/__version__.py | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ceb3f69e..c70fc15a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +### `2.1.10` + +#### Fixes +- [#148](https://github.com/codecov/codecov-python/pull/148) Output elapsed time with S3 upload +- [#153](https://github.com/codecov/codecov-python/pull/153) Improve error reporting in the "try_run" function and correctly include original command output in the error message +- [#295](https://github.com/codecov/codecov-python/pull/295) Added sleep between upload retries. +- [#297](https://github.com/codecov/codecov-python/pull/297) Ignore emacs lisp files +- [#298](https://github.com/codecov/codecov-python/pull/298) Fix error try_to_run using | without shell=True (fix #284) + +#### Dependencies and Misc +- [#290](https://github.com/codecov/codecov-python/pull/290) Bump coverage from 4.5.4 to 5.2.1 +- [#291](https://github.com/codecov/codecov-python/pull/291) Update python versions +- [#292](https://github.com/codecov/codecov-python/pull/292) Add license scan report and status +- [#294](https://github.com/codecov/codecov-python/pull/294) Update README with accurate links +- [#296](https://github.com/codecov/codecov-python/pull/296) Bump coverage from 5.2.1 to 5.3 + ### `2.1.9` - [#289](https://github.com/codecov/codecov-python/pull/289)Remove token restriction as it is changed server-side diff --git a/codecov/__version__.py b/codecov/__version__.py index 26010cbb..0e467e9f 100644 --- a/codecov/__version__.py +++ b/codecov/__version__.py @@ -5,4 +5,4 @@ __license__ = "Apache 2.0" __title__ = "codecov" __url__ = "https://github.com/codecov/codecov-python" -__version__ = "2.1.9" +__version__ = "2.1.10" From 5862842228187f4ed919bf8f9c1ac3692d1ccbbc Mon Sep 17 00:00:00 2001 From: Gaurav Sheni Date: Fri, 16 Oct 2020 10:07:28 -0400 Subject: [PATCH 13/16] Update to Python 3.9 (#301) * Update .travis.yml * Update setup.py * Update build-test.yml * Update .travis.yml Co-authored-by: Tom Hu --- .github/workflows/build-test.yml | 2 +- .travis.yml | 1 + setup.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 7d826ac4..b07bc8fb 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 diff --git a/.travis.yml b/.travis.yml index 238470ee..f69f56d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ python: - 3.6 - 3.7 - 3.8 + - 3.9-dev - pypy3 matrix: include: diff --git a/setup.py b/setup.py index 6deb6ae6..b5639c73 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,7 @@ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: Implementation :: PyPy", "License :: OSI Approved :: Apache Software License", "Topic :: Software Development :: Testing", From 58032a4960cf1fb62ebaa88297440e92726ea2ac Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Wed, 9 Dec 2020 18:35:44 -0800 Subject: [PATCH 14/16] Added option to disable printing of gcov-out (#305) --- codecov/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/codecov/__init__.py b/codecov/__init__.py index e337717e..2b338d8b 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -376,6 +376,9 @@ def main(*argv, **kwargs): gcov.add_argument( "--gcov-exec", default="gcov", help="gcov executable to run. Defaults to 'gcov'" ) + gcov.add_argument( + "--no-gcov-out", action="store_true", default=False, help="Disable gcov output" + ) gcov.add_argument("--gcov-args", default="", help="extra arguments to pass to gcov") advanced = parser.add_argument_group( @@ -982,8 +985,11 @@ def main(*argv, **kwargs): if codecov.gcov_args: cmd.append(sanitize_arg("", codecov.gcov_args or "")) cmd.append(path) - write(" Executing gcov (%s)" % cmd) - write(try_to_run(cmd)) + if not codecov.no_gcov_out: + write(" Executing gcov (%s)" % cmd) + gcov_out = try_to_run(cmd) + if not codecov.no_gcov_out: + write(gcov_out) # Collect Reports # --------------- From f4b116df8fac14dd98c52acf2a1ca0ac8d54db68 Mon Sep 17 00:00:00 2001 From: Udi Meiri Date: Sat, 12 Dec 2020 14:29:56 -0800 Subject: [PATCH 15/16] Handle exceptions that don't have a returncode (#308) Fixes #307 --- codecov/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codecov/__init__.py b/codecov/__init__.py index 2b338d8b..9490dd40 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -226,7 +226,11 @@ def try_to_run(cmd, shell=False, cwd=None): except Exception as e: write( " Error running `%s`: returncode=%s, output=%s" - % (cmd, e.returncode, str(getattr(e, "output", str(e)))) + % ( + cmd, + str(getattr(e, "returncode", None)), + str(getattr(e, "output", str(e))), + ) ) return None From a8f6ff27feb6600731a3efef6cff9d54469efa30 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Thu, 17 Dec 2020 10:48:10 -0500 Subject: [PATCH 16/16] Bump to 2.1.11 (#310) --- CHANGELOG.md | 11 ++++++++++- codecov/__version__.py | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c70fc15a..21256923 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +### `2.1.11` + +#### Fixes +- #305 Added option to disable printing of gcov-out +- #308 Handle exceptions that don't have a returncode + +#### Dependencies and Misc +- #301 Update to Python 3.9 + ### `2.1.10` #### Fixes @@ -10,7 +19,7 @@ #### Dependencies and Misc - [#290](https://github.com/codecov/codecov-python/pull/290) Bump coverage from 4.5.4 to 5.2.1 - [#291](https://github.com/codecov/codecov-python/pull/291) Update python versions -- [#292](https://github.com/codecov/codecov-python/pull/292) Add license scan report and status +- [#292](https://github.com/codecov/codecov-python/pull/292) Add license scan report and status - [#294](https://github.com/codecov/codecov-python/pull/294) Update README with accurate links - [#296](https://github.com/codecov/codecov-python/pull/296) Bump coverage from 5.2.1 to 5.3 diff --git a/codecov/__version__.py b/codecov/__version__.py index 0e467e9f..bc5c0a72 100644 --- a/codecov/__version__.py +++ b/codecov/__version__.py @@ -5,4 +5,4 @@ __license__ = "Apache 2.0" __title__ = "codecov" __url__ = "https://github.com/codecov/codecov-python" -__version__ = "2.1.10" +__version__ = "2.1.11"