From 7f8adf703663551118b5912f55f0666ac970f17a Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 6 Jul 2020 07:50:08 -0400 Subject: [PATCH 01/77] Bump version --- CHANGES.rst | 6 ++++++ coverage/version.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index fecc1760b..3ef9f6d5c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -22,6 +22,12 @@ want to know what's different in 5.0 since 4.5.x, see :ref:`whatsnew5x`. .. ---------------------------- +Unreleased +---------- + +Nothing yet. + + .. _changes_52: Version 5.2 --- 2020-07-05 diff --git a/coverage/version.py b/coverage/version.py index f6440e53e..36a68b560 100644 --- a/coverage/version.py +++ b/coverage/version.py @@ -5,7 +5,7 @@ # This file is exec'ed in setup.py, don't import anything! # Same semantics as sys.version_info. -version_info = (5, 2, 0, "final", 0) +version_info = (5, 2, 1, "alpha", 0) def _make_version(major, minor, micro, releaselevel, serial): From 5c4d4cd2f1a640100ad6ed1cb193cd9f6eb600f2 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 6 Jul 2020 08:34:51 -0400 Subject: [PATCH 02/77] More howto.txt --- howto.txt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/howto.txt b/howto.txt index fa2a35f1f..22785be12 100644 --- a/howto.txt +++ b/howto.txt @@ -79,19 +79,20 @@ - Update GitHub releases: $ make github_releases - Update readthedocs - - IF NOT PRE-RELEASE: - - update git "stable" branch to point to latest release - - git branch -f stable - - git push --all - - visit https://readthedocs.org/projects/coverage/builds/ - - wait for the new tag build to finish successfully. - - visit https://readthedocs.org/dashboard/coverage/advanced/ - - change the default version to the new version - - visit https://readthedocs.org/projects/coverage/versions/ + - @ https://readthedocs.org/projects/coverage/versions/ - find the latest tag in the inactive list, edit it, make it active. - readthedocs won't find the tag until a commit is made on master. - keep just the latest version of each x.y release, make the rest inactive. + - IF NOT PRE-RELEASE: + - update git "stable" branch to point to latest release + $ git branch -f stable + $ git push --all + - @ https://readthedocs.org/projects/coverage/builds/ + - wait for the new tag build to finish successfully. + - @ https://readthedocs.org/dashboard/coverage/advanced/ + - change the default version to the new version - Visit the fixed issues on GitHub and mention the version it was fixed in. + - "This is now released as part of [coverage 5.2](https://pypi.org/project/coverage/5.2)." - make a milestone for the next release and move open issues into it. - Announce: - twitter @coveragepy From d1bb8e947c343e6f5c5772573d8adbb3267706e6 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 6 Jul 2020 14:53:45 -0400 Subject: [PATCH 03/77] Fix dark mode for context listing. #1009 --- CHANGES.rst | 5 ++++- coverage/htmlfiles/style.css | 14 ++++++++++++-- coverage/htmlfiles/style.scss | 19 ++++++++++++------- tests/gold/html/styled/style.css | 14 ++++++++++++-- 4 files changed, 40 insertions(+), 12 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 3ef9f6d5c..7f0c99737 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -25,7 +25,10 @@ want to know what's different in 5.0 since 4.5.x, see :ref:`whatsnew5x`. Unreleased ---------- -Nothing yet. +- The dark mode HTML report still used light colors for the context listing, + making them unreadable (`issue 1009`_). This is now fixed. + +.. _issue 1009: https://github.com/nedbat/coveragepy/issues/1009 .. _changes_52: diff --git a/coverage/htmlfiles/style.css b/coverage/htmlfiles/style.css index e501ea6bb..3e7f9b66b 100644 --- a/coverage/htmlfiles/style.css +++ b/coverage/htmlfiles/style.css @@ -220,7 +220,15 @@ h2.stats { margin-top: .5em; font-size: 1em; } #source p input ~ .r label.ctx:hover { background: #d5f7ff; color: #666; } -#source p input:checked ~ .r label.ctx { background: #aaeeff; color: #666; border-radius: .75em .75em 0 0; padding: 0 .5em; margin: -.25em 0; } +@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { background: #0f3a42; } } + +@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { color: #aaa; } } + +#source p input:checked ~ .r label.ctx { background: #aef; color: #666; border-radius: .75em .75em 0 0; padding: 0 .5em; margin: -.25em 0; } + +@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { background: #056; } } + +@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { color: #aaa; } } #source p input:checked ~ .r label.ctx::before { content: "▼ "; } @@ -230,7 +238,9 @@ h2.stats { margin-top: .5em; font-size: 1em; } @media (prefers-color-scheme: dark) { #source p label.ctx { color: #777; } } -#source p .ctxs { display: block; max-height: 0; overflow-y: hidden; transition: all .2s; padding: 0 .5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; white-space: nowrap; background: #aaeeff; border-radius: .25em; margin-right: 1.75em; } +#source p .ctxs { display: block; max-height: 0; overflow-y: hidden; transition: all .2s; padding: 0 .5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; white-space: nowrap; background: #aef; border-radius: .25em; margin-right: 1.75em; } + +@media (prefers-color-scheme: dark) { #source p .ctxs { background: #056; } } #source p .ctxs span { display: block; text-align: right; } diff --git a/coverage/htmlfiles/style.scss b/coverage/htmlfiles/style.scss index 98f9e55d6..8169269e3 100644 --- a/coverage/htmlfiles/style.scss +++ b/coverage/htmlfiles/style.scss @@ -51,6 +51,7 @@ $light-exc-bg: $light-gray2; $light-par-bg: #ffa; $light-token-com: #008000; $light-token-str: #0451A5; +$light-context-bg-color: #aef; $dark-bg: #1e1e1e; $dark-fg: #eee; @@ -67,6 +68,7 @@ $dark-exc-bg: $dark-gray2; $dark-par-bg: #650; $dark-token-com: #6A9955; $dark-token-str: #9CDCFE; +$dark-context-bg-color: #056; // // Mixins and utilities @@ -345,8 +347,6 @@ h2.stats { // The slim bar at the left edge of the source lines, colored by coverage. $border-indicator-width: .2em; -$context-panel-color: #aaeeff; - #source { padding: 1em 0 1em $left-gutter; font-family: $font-code; @@ -520,14 +520,18 @@ $context-panel-color: #aaeeff; content: "▶ "; } &:hover { - background: mix($context-panel-color, #fff, 50%); - color: #666; + background: mix($light-context-bg-color, $light-bg, $off-button-lighten); + @include background-dark(mix($dark-context-bg-color, $dark-bg, $off-button-lighten)); + color: $light-gray5; + @include color-dark($dark-gray5); } } &:checked ~ .r label.ctx { - background: $context-panel-color; - color: #666; + background: $light-context-bg-color; + @include background-dark($dark-context-bg-color); + color: $light-gray5; + @include color-dark($dark-gray5); border-radius: .75em .75em 0 0; padding: 0 .5em; margin: -.25em 0; @@ -559,7 +563,8 @@ $context-panel-color: #aaeeff; padding: 0 .5em; font-family: $font-normal; white-space: nowrap; - background: $context-panel-color; + background: $light-context-bg-color; + @include background-dark($dark-context-bg-color); border-radius: .25em; margin-right: 1.75em; span { diff --git a/tests/gold/html/styled/style.css b/tests/gold/html/styled/style.css index e501ea6bb..3e7f9b66b 100644 --- a/tests/gold/html/styled/style.css +++ b/tests/gold/html/styled/style.css @@ -220,7 +220,15 @@ h2.stats { margin-top: .5em; font-size: 1em; } #source p input ~ .r label.ctx:hover { background: #d5f7ff; color: #666; } -#source p input:checked ~ .r label.ctx { background: #aaeeff; color: #666; border-radius: .75em .75em 0 0; padding: 0 .5em; margin: -.25em 0; } +@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { background: #0f3a42; } } + +@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { color: #aaa; } } + +#source p input:checked ~ .r label.ctx { background: #aef; color: #666; border-radius: .75em .75em 0 0; padding: 0 .5em; margin: -.25em 0; } + +@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { background: #056; } } + +@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { color: #aaa; } } #source p input:checked ~ .r label.ctx::before { content: "▼ "; } @@ -230,7 +238,9 @@ h2.stats { margin-top: .5em; font-size: 1em; } @media (prefers-color-scheme: dark) { #source p label.ctx { color: #777; } } -#source p .ctxs { display: block; max-height: 0; overflow-y: hidden; transition: all .2s; padding: 0 .5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; white-space: nowrap; background: #aaeeff; border-radius: .25em; margin-right: 1.75em; } +#source p .ctxs { display: block; max-height: 0; overflow-y: hidden; transition: all .2s; padding: 0 .5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; white-space: nowrap; background: #aef; border-radius: .25em; margin-right: 1.75em; } + +@media (prefers-color-scheme: dark) { #source p .ctxs { background: #056; } } #source p .ctxs span { display: block; text-align: right; } From 40df2bf9d0996844185d96500739cd7ecebd2505 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 13 Jul 2020 19:27:12 -0400 Subject: [PATCH 04/77] Oops, Vince, not Victor --- CHANGES.rst | 2 +- CONTRIBUTORS.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 7f0c99737..43beb35e1 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -36,7 +36,7 @@ Unreleased Version 5.2 --- 2020-07-05 -------------------------- -- The HTML report has been redesigned by Victor Salvino. There is now a dark +- The HTML report has been redesigned by Vince Salvino. There is now a dark mode, the code text is larger, and system sans serif fonts are used, in addition to other small changes (`issue 858`_ and `pull request 931`_). diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index ce6e7cf7c..2219ae35c 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -133,7 +133,7 @@ Teake Nutma Ted Wexler Thijs Triemstra Titus Brown -Victor Salvino +Vince Salvino Ville Skyttä Yury Selivanov Zac Hatfield-Dodds From db4213b6ac6c85a916f0d58792057ad79456e043 Mon Sep 17 00:00:00 2001 From: latricewilgus <43064940+latricewilgus@users.noreply.github.com> Date: Sun, 19 Jul 2020 13:25:00 +0200 Subject: [PATCH 05/77] CmdLineStdoutTest::test_cmd_help: test for at least 20 lines (#1013) The number of lines in the help output of a command depends on the terminal size. The smaller the more line breaks. The minimum number of lines for the current help message is 23. Currently we are checking for at least 30 lines, yielding to failures on large terminals. Reduce the number (currently 30) to 20 to have some leeway for the future. --- tests/test_cmdline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py index 560a3d175..cdf8e56f1 100644 --- a/tests/test_cmdline.py +++ b/tests/test_cmdline.py @@ -861,7 +861,7 @@ def test_cmd_help(self): lines = out.splitlines() self.assertIn("", lines[0]) self.assertIn("--timid", out) - self.assertGreater(len(lines), 30) + self.assertGreater(len(lines), 20) self.assertEqual(lines[-1], "Full documentation is at {}".format(__url__)) def test_unknown_topic(self): From 224c73e34d80caebb34af1e06724fb7858ad732b Mon Sep 17 00:00:00 2001 From: Xie Yanbo Date: Fri, 24 Jul 2020 07:10:50 +0800 Subject: [PATCH 06/77] Displaying timezone information in HTML report (#960) * Displaying timezone information in HTML report * A helpber to format datetime with local timezone * No backward compatibility with older python versions --- CHANGES.rst | 4 ++++ CONTRIBUTORS.txt | 1 + coverage/backward.py | 13 +++++++++++++ coverage/html.py | 4 ++-- tests/gold/html/a/a_py.html | 2 +- tests/gold/html/a/index.html | 2 +- tests/gold/html/b_branch/b_py.html | 2 +- tests/gold/html/b_branch/index.html | 2 +- tests/gold/html/bom/2/bom_py.html | 2 +- tests/gold/html/bom/2/index.html | 2 +- tests/gold/html/bom/bom_py.html | 2 +- tests/gold/html/bom/index.html | 2 +- tests/gold/html/isolatin1/index.html | 2 +- tests/gold/html/isolatin1/isolatin1_py.html | 2 +- tests/gold/html/omit_1/index.html | 2 +- tests/gold/html/omit_1/m1_py.html | 2 +- tests/gold/html/omit_1/m2_py.html | 2 +- tests/gold/html/omit_1/m3_py.html | 2 +- tests/gold/html/omit_1/main_py.html | 2 +- tests/gold/html/omit_2/index.html | 2 +- tests/gold/html/omit_2/m2_py.html | 2 +- tests/gold/html/omit_2/m3_py.html | 2 +- tests/gold/html/omit_2/main_py.html | 2 +- tests/gold/html/omit_3/index.html | 2 +- tests/gold/html/omit_3/m3_py.html | 2 +- tests/gold/html/omit_3/main_py.html | 2 +- tests/gold/html/omit_4/index.html | 2 +- tests/gold/html/omit_4/m1_py.html | 2 +- tests/gold/html/omit_4/m3_py.html | 2 +- tests/gold/html/omit_4/main_py.html | 2 +- tests/gold/html/omit_5/index.html | 2 +- tests/gold/html/omit_5/m1_py.html | 2 +- tests/gold/html/omit_5/main_py.html | 2 +- tests/gold/html/other/blah_blah_other_py.html | 2 +- tests/gold/html/other/here_py.html | 2 +- tests/gold/html/other/index.html | 2 +- tests/gold/html/partial/index.html | 2 +- tests/gold/html/partial/partial_py.html | 2 +- tests/gold/html/styled/a_py.html | 2 +- tests/gold/html/styled/index.html | 2 +- tests/gold/html/unicode/index.html | 2 +- tests/gold/html/unicode/unicode_py.html | 2 +- tests/test_html.py | 6 ++++++ 43 files changed, 64 insertions(+), 40 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 43beb35e1..1ecbec243 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -28,6 +28,10 @@ Unreleased - The dark mode HTML report still used light colors for the context listing, making them unreadable (`issue 1009`_). This is now fixed. +- The time stamp on the HTML report now includes the time zone. Thanks, Xie + Yanbo (`pull request 960`_). + +.. _pull request 960: https://github.com/nedbat/coveragepy/pull/960 .. _issue 1009: https://github.com/nedbat/coveragepy/issues/1009 diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 2219ae35c..99b8493f4 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -135,6 +135,7 @@ Thijs Triemstra Titus Brown Vince Salvino Ville Skyttä +Xie Yanbo Yury Selivanov Zac Hatfield-Dodds Zooko Wilcox-O'Hearn diff --git a/coverage/backward.py b/coverage/backward.py index 37b491676..9d1d78e5b 100644 --- a/coverage/backward.py +++ b/coverage/backward.py @@ -9,6 +9,8 @@ import os import sys +from datetime import datetime + from coverage import env @@ -217,6 +219,17 @@ def __eq__(self, other): return self.__dict__ == other.__dict__ +def format_local_datetime(dt): + """Return a string with local timezone representing the date. + If python version is lower than 3.6, the time zone is not included. + """ + try: + return dt.astimezone().strftime('%Y-%m-%d %H:%M %z') + except (TypeError, ValueError): + # Datetime.astimezone in Python 3.5 can not handle naive datetime + return dt.strftime('%Y-%m-%d %H:%M') + + def invalidate_import_caches(): """Invalidate any import caches that may or may not exist.""" if importlib and hasattr(importlib, "invalidate_caches"): diff --git a/coverage/html.py b/coverage/html.py index 596e11435..3596bbe1d 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -11,7 +11,7 @@ import coverage from coverage import env -from coverage.backward import iitems, SimpleNamespace +from coverage.backward import iitems, SimpleNamespace, format_local_datetime from coverage.data import add_data_to_hash from coverage.files import flat_rootname from coverage.misc import CoverageException, ensure_dir, file_be_gone, Hasher, isolate_module @@ -200,7 +200,7 @@ def __init__(self, cov): '__url__': coverage.__url__, '__version__': coverage.__version__, 'title': title, - 'time_stamp': datetime.datetime.now().strftime('%Y-%m-%d %H:%M'), + 'time_stamp': format_local_datetime(datetime.datetime.now()), 'extra_css': self.extra_css, 'has_arcs': self.has_arcs, 'show_contexts': self.config.show_contexts, diff --git a/tests/gold/html/a/a_py.html b/tests/gold/html/a/a_py.html index d534c6a34..af5d72a19 100644 --- a/tests/gold/html/a/a_py.html +++ b/tests/gold/html/a/a_py.html @@ -61,7 +61,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/a/index.html b/tests/gold/html/a/index.html index e1c585fc9..3276f1d65 100644 --- a/tests/gold/html/a/index.html +++ b/tests/gold/html/a/index.html @@ -76,7 +76,7 @@

Coverage report:

coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/b_branch/b_py.html b/tests/gold/html/b_branch/b_py.html index 67a1b83b3..ee28735e5 100644 --- a/tests/gold/html/b_branch/b_py.html +++ b/tests/gold/html/b_branch/b_py.html @@ -84,7 +84,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/b_branch/index.html b/tests/gold/html/b_branch/index.html index 8b68b26e2..0dfc20cad 100644 --- a/tests/gold/html/b_branch/index.html +++ b/tests/gold/html/b_branch/index.html @@ -84,7 +84,7 @@

Coverage report:

coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/bom/2/bom_py.html b/tests/gold/html/bom/2/bom_py.html index 74f4f2fee..a66988452 100644 --- a/tests/gold/html/bom/2/bom_py.html +++ b/tests/gold/html/bom/2/bom_py.html @@ -67,7 +67,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:32 + created at 2019-10-14 09:32 +0000

diff --git a/tests/gold/html/bom/2/index.html b/tests/gold/html/bom/2/index.html index 3fa67f0fa..28abec0a6 100644 --- a/tests/gold/html/bom/2/index.html +++ b/tests/gold/html/bom/2/index.html @@ -76,7 +76,7 @@

Coverage report:

coverage.py v5.0a9, - created at 2019-10-13 11:41 + created at 2019-10-13 11:41 +0000

diff --git a/tests/gold/html/bom/bom_py.html b/tests/gold/html/bom/bom_py.html index 10b84edec..3b181c633 100644 --- a/tests/gold/html/bom/bom_py.html +++ b/tests/gold/html/bom/bom_py.html @@ -67,7 +67,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/bom/index.html b/tests/gold/html/bom/index.html index b08e9c1c9..0e56a99a6 100644 --- a/tests/gold/html/bom/index.html +++ b/tests/gold/html/bom/index.html @@ -76,7 +76,7 @@

Coverage report:

coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/isolatin1/index.html b/tests/gold/html/isolatin1/index.html index 7e33e754d..ec9c50b52 100644 --- a/tests/gold/html/isolatin1/index.html +++ b/tests/gold/html/isolatin1/index.html @@ -76,7 +76,7 @@

Coverage report:

coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/isolatin1/isolatin1_py.html b/tests/gold/html/isolatin1/isolatin1_py.html index b344bad6b..3dd8c8fd0 100644 --- a/tests/gold/html/isolatin1/isolatin1_py.html +++ b/tests/gold/html/isolatin1/isolatin1_py.html @@ -61,7 +61,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_1/index.html b/tests/gold/html/omit_1/index.html index d8d02f6ab..a97add0f6 100644 --- a/tests/gold/html/omit_1/index.html +++ b/tests/gold/html/omit_1/index.html @@ -97,7 +97,7 @@

Coverage report:

coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_1/m1_py.html b/tests/gold/html/omit_1/m1_py.html index 57584495c..94fba21eb 100644 --- a/tests/gold/html/omit_1/m1_py.html +++ b/tests/gold/html/omit_1/m1_py.html @@ -58,7 +58,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_1/m2_py.html b/tests/gold/html/omit_1/m2_py.html index e8c1791d5..ade526d30 100644 --- a/tests/gold/html/omit_1/m2_py.html +++ b/tests/gold/html/omit_1/m2_py.html @@ -58,7 +58,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_1/m3_py.html b/tests/gold/html/omit_1/m3_py.html index e714d47f3..d6b4756d1 100644 --- a/tests/gold/html/omit_1/m3_py.html +++ b/tests/gold/html/omit_1/m3_py.html @@ -58,7 +58,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_1/main_py.html b/tests/gold/html/omit_1/main_py.html index 28173d12b..5d4781245 100644 --- a/tests/gold/html/omit_1/main_py.html +++ b/tests/gold/html/omit_1/main_py.html @@ -66,7 +66,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_2/index.html b/tests/gold/html/omit_2/index.html index d51ebd2a9..5b5e3c6ea 100644 --- a/tests/gold/html/omit_2/index.html +++ b/tests/gold/html/omit_2/index.html @@ -90,7 +90,7 @@

Coverage report:

coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_2/m2_py.html b/tests/gold/html/omit_2/m2_py.html index e8c1791d5..ade526d30 100644 --- a/tests/gold/html/omit_2/m2_py.html +++ b/tests/gold/html/omit_2/m2_py.html @@ -58,7 +58,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_2/m3_py.html b/tests/gold/html/omit_2/m3_py.html index e714d47f3..d6b4756d1 100644 --- a/tests/gold/html/omit_2/m3_py.html +++ b/tests/gold/html/omit_2/m3_py.html @@ -58,7 +58,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_2/main_py.html b/tests/gold/html/omit_2/main_py.html index 28173d12b..5d4781245 100644 --- a/tests/gold/html/omit_2/main_py.html +++ b/tests/gold/html/omit_2/main_py.html @@ -66,7 +66,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_3/index.html b/tests/gold/html/omit_3/index.html index 0d8ff217d..f5bc1aaeb 100644 --- a/tests/gold/html/omit_3/index.html +++ b/tests/gold/html/omit_3/index.html @@ -83,7 +83,7 @@

Coverage report:

coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_3/m3_py.html b/tests/gold/html/omit_3/m3_py.html index e714d47f3..d6b4756d1 100644 --- a/tests/gold/html/omit_3/m3_py.html +++ b/tests/gold/html/omit_3/m3_py.html @@ -58,7 +58,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_3/main_py.html b/tests/gold/html/omit_3/main_py.html index 28173d12b..5d4781245 100644 --- a/tests/gold/html/omit_3/main_py.html +++ b/tests/gold/html/omit_3/main_py.html @@ -66,7 +66,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_4/index.html b/tests/gold/html/omit_4/index.html index d91291fc4..861ba02e3 100644 --- a/tests/gold/html/omit_4/index.html +++ b/tests/gold/html/omit_4/index.html @@ -90,7 +90,7 @@

Coverage report:

coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_4/m1_py.html b/tests/gold/html/omit_4/m1_py.html index 57584495c..94fba21eb 100644 --- a/tests/gold/html/omit_4/m1_py.html +++ b/tests/gold/html/omit_4/m1_py.html @@ -58,7 +58,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_4/m3_py.html b/tests/gold/html/omit_4/m3_py.html index e714d47f3..d6b4756d1 100644 --- a/tests/gold/html/omit_4/m3_py.html +++ b/tests/gold/html/omit_4/m3_py.html @@ -58,7 +58,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_4/main_py.html b/tests/gold/html/omit_4/main_py.html index 28173d12b..5d4781245 100644 --- a/tests/gold/html/omit_4/main_py.html +++ b/tests/gold/html/omit_4/main_py.html @@ -66,7 +66,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_5/index.html b/tests/gold/html/omit_5/index.html index f1e0fe605..8afbebad5 100644 --- a/tests/gold/html/omit_5/index.html +++ b/tests/gold/html/omit_5/index.html @@ -83,7 +83,7 @@

Coverage report:

coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_5/m1_py.html b/tests/gold/html/omit_5/m1_py.html index 57584495c..94fba21eb 100644 --- a/tests/gold/html/omit_5/m1_py.html +++ b/tests/gold/html/omit_5/m1_py.html @@ -58,7 +58,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/omit_5/main_py.html b/tests/gold/html/omit_5/main_py.html index 28173d12b..5d4781245 100644 --- a/tests/gold/html/omit_5/main_py.html +++ b/tests/gold/html/omit_5/main_py.html @@ -66,7 +66,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/other/blah_blah_other_py.html b/tests/gold/html/other/blah_blah_other_py.html index 8f0309d49..d88e21e56 100644 --- a/tests/gold/html/other/blah_blah_other_py.html +++ b/tests/gold/html/other/blah_blah_other_py.html @@ -60,7 +60,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/other/here_py.html b/tests/gold/html/other/here_py.html index c2f6b5f1f..94491fb0a 100644 --- a/tests/gold/html/other/here_py.html +++ b/tests/gold/html/other/here_py.html @@ -62,7 +62,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/other/index.html b/tests/gold/html/other/index.html index fa1a770f4..644d14909 100644 --- a/tests/gold/html/other/index.html +++ b/tests/gold/html/other/index.html @@ -83,7 +83,7 @@

Coverage report:

coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/partial/index.html b/tests/gold/html/partial/index.html index fa1ec4ad9..f766c0b4c 100644 --- a/tests/gold/html/partial/index.html +++ b/tests/gold/html/partial/index.html @@ -84,7 +84,7 @@

Coverage report:

coverage.py v5.0a9, - created at 2019-10-14 12:01 + created at 2019-10-14 12:01 +0000

diff --git a/tests/gold/html/partial/partial_py.html b/tests/gold/html/partial/partial_py.html index abd755d00..c301a58a4 100644 --- a/tests/gold/html/partial/partial_py.html +++ b/tests/gold/html/partial/partial_py.html @@ -74,7 +74,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 12:01 + created at 2019-10-14 12:01 +0000

diff --git a/tests/gold/html/styled/a_py.html b/tests/gold/html/styled/a_py.html index 7b6f9dcdd..b81641cca 100644 --- a/tests/gold/html/styled/a_py.html +++ b/tests/gold/html/styled/a_py.html @@ -62,7 +62,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/styled/index.html b/tests/gold/html/styled/index.html index 6e182fa63..d1a9259b6 100644 --- a/tests/gold/html/styled/index.html +++ b/tests/gold/html/styled/index.html @@ -77,7 +77,7 @@

Coverage report:

coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/unicode/index.html b/tests/gold/html/unicode/index.html index bfa09a38d..b2de7b3d1 100644 --- a/tests/gold/html/unicode/index.html +++ b/tests/gold/html/unicode/index.html @@ -76,7 +76,7 @@

Coverage report:

coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/gold/html/unicode/unicode_py.html b/tests/gold/html/unicode/unicode_py.html index a4218bcc9..311427d36 100644 --- a/tests/gold/html/unicode/unicode_py.html +++ b/tests/gold/html/unicode/unicode_py.html @@ -61,7 +61,7 @@

« index     coverage.py v5.0a9, - created at 2019-10-14 09:27 + created at 2019-10-14 09:27 +0000

diff --git a/tests/test_html.py b/tests/test_html.py index b543fa08e..6f22acc01 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -70,6 +70,11 @@ def get_html_index_content(self): """ with open("htmlcov/index.html") as f: index = f.read() + index = re.sub( + r"created at \d{4}-\d{2}-\d{2} \d{2}:\d{2} \+\d{4}", + r"created at YYYY-MM-DD HH:MM +ZZZZ", + index, + ) index = re.sub( r"created at \d{4}-\d{2}-\d{2} \d{2}:\d{2}", r"created at YYYY-MM-DD HH:MM", @@ -620,6 +625,7 @@ def compare_html(expected, actual): scrubs = [ (r'/coverage.readthedocs.io/?[-.\w/]*', '/coverage.readthedocs.io/VER'), (r'coverage.py v[\d.abc]+', 'coverage.py vVER'), + (r'created at \d\d\d\d-\d\d-\d\d \d\d:\d\d [-+]\d\d\d\d', 'created at DATE'), (r'created at \d\d\d\d-\d\d-\d\d \d\d:\d\d', 'created at DATE'), # Some words are identifiers in one version, keywords in another. (r'(print|True|False)', r'\2'), From bbfd131a162be927c0ea84a9a14c5cc2d5a6765d Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Thu, 23 Jul 2020 19:33:11 -0400 Subject: [PATCH 07/77] Prep for 5.2.1 --- CHANGES.rst | 6 ++++-- appveyor.yml | 8 ++++---- coverage/version.py | 2 +- doc/conf.py | 6 +++--- doc/index.rst | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 1ecbec243..28c1f4cd7 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -22,8 +22,10 @@ want to know what's different in 5.0 since 4.5.x, see :ref:`whatsnew5x`. .. ---------------------------- -Unreleased ----------- +.. _changes_521: + +Version 5.2.1 --- 2020-07-23 +---------------------------- - The dark mode HTML report still used light colors for the context listing, making them unreadable (`issue 1009`_). This is now fixed. diff --git a/appveyor.yml b/appveyor.yml index 616635a88..6baccd81f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -47,13 +47,13 @@ environment: - JOB: "3.8 64-bit" TOXENV: "py38" PYTHON: "C:\\Python38-x64" - PYTHON_VERSION: "3.8.3" + PYTHON_VERSION: "3.8.5" PYTHON_ARCH: "64" - JOB: "3.9 64-bit" TOXENV: "py39" PYTHON: "C:\\Python39-x64" - PYTHON_VERSION: "3.9.0b4" + PYTHON_VERSION: "3.9.0b5" PYTHON_ARCH: "64" # 32-bit jobs don't run the tests under the Python tracer, since that should @@ -89,14 +89,14 @@ environment: - JOB: "3.8 32-bit" TOXENV: "py38" PYTHON: "C:\\Python38" - PYTHON_VERSION: "3.8.3" + PYTHON_VERSION: "3.8.5" PYTHON_ARCH: "32" COVERAGE_NO_PYTRACER: "1" - JOB: "3.9 32-bit" TOXENV: "py39" PYTHON: "C:\\Python39" - PYTHON_VERSION: "3.9.0b4" + PYTHON_VERSION: "3.9.0b5" PYTHON_ARCH: "32" COVERAGE_NO_PYTRACER: "1" diff --git a/coverage/version.py b/coverage/version.py index 36a68b560..93f843ec5 100644 --- a/coverage/version.py +++ b/coverage/version.py @@ -5,7 +5,7 @@ # This file is exec'ed in setup.py, don't import anything! # Same semantics as sys.version_info. -version_info = (5, 2, 1, "alpha", 0) +version_info = (5, 2, 1, "final", 0) def _make_version(major, minor, micro, releaselevel, serial): diff --git a/doc/conf.py b/doc/conf.py index c0184cf86..5bd101c37 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -66,11 +66,11 @@ # built documents. # # The short X.Y version. -version = '5.2' # CHANGEME +version = "5.2.1" # CHANGEME # The full version, including alpha/beta/rc tags. -release = '5.2' # CHANGEME +release = "5.2.1" # CHANGEME # The date of release, in "monthname day, year" format. -release_date = 'July 5, 2020' # CHANGEME +release_date = "July 23, 2020" # CHANGEME rst_epilog = """ .. |release_date| replace:: {release_date} diff --git a/doc/index.rst b/doc/index.rst index e70b1eeb5..e5df9263b 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -23,7 +23,7 @@ supported on: .. ifconfig:: prerelease **This is a pre-release build. The usual warnings about possible bugs - apply.** The latest stable version is coverage.py 5.2, `described here`_. + apply.** The latest stable version is coverage.py 5.2.1, `described here`_. .. _described here: http://coverage.readthedocs.io/ From a970e6ebe2afe2ceb2204ac17624814447047662 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Thu, 23 Jul 2020 19:38:25 -0400 Subject: [PATCH 08/77] Latest sample HTML --- doc/sample_html/cogapp___init___py.html | 4 ++-- doc/sample_html/cogapp___main___py.html | 4 ++-- doc/sample_html/cogapp_backward_py.html | 4 ++-- doc/sample_html/cogapp_cogapp_py.html | 4 ++-- doc/sample_html/cogapp_makefiles_py.html | 4 ++-- doc/sample_html/cogapp_test_cogapp_py.html | 4 ++-- doc/sample_html/cogapp_test_makefiles_py.html | 4 ++-- doc/sample_html/cogapp_test_whiteutils_py.html | 4 ++-- doc/sample_html/cogapp_whiteutils_py.html | 4 ++-- doc/sample_html/index.html | 4 ++-- doc/sample_html/status.json | 2 +- doc/sample_html/style.css | 14 ++++++++++++-- 12 files changed, 33 insertions(+), 23 deletions(-) diff --git a/doc/sample_html/cogapp___init___py.html b/doc/sample_html/cogapp___init___py.html index ec832f77d..be753a87c 100644 --- a/doc/sample_html/cogapp___init___py.html +++ b/doc/sample_html/cogapp___init___py.html @@ -65,8 +65,8 @@

diff --git a/doc/sample_html/cogapp___main___py.html b/doc/sample_html/cogapp___main___py.html index 56a406e2f..6110e8887 100644 --- a/doc/sample_html/cogapp___main___py.html +++ b/doc/sample_html/cogapp___main___py.html @@ -61,8 +61,8 @@

diff --git a/doc/sample_html/cogapp_backward_py.html b/doc/sample_html/cogapp_backward_py.html index 47f278aa2..3cc5ceb52 100644 --- a/doc/sample_html/cogapp_backward_py.html +++ b/doc/sample_html/cogapp_backward_py.html @@ -98,8 +98,8 @@

diff --git a/doc/sample_html/cogapp_cogapp_py.html b/doc/sample_html/cogapp_cogapp_py.html index af33ea7f0..a9c893070 100644 --- a/doc/sample_html/cogapp_cogapp_py.html +++ b/doc/sample_html/cogapp_cogapp_py.html @@ -864,8 +864,8 @@

diff --git a/doc/sample_html/cogapp_makefiles_py.html b/doc/sample_html/cogapp_makefiles_py.html index 7a4eab958..4ac84bf19 100644 --- a/doc/sample_html/cogapp_makefiles_py.html +++ b/doc/sample_html/cogapp_makefiles_py.html @@ -102,8 +102,8 @@

diff --git a/doc/sample_html/cogapp_test_cogapp_py.html b/doc/sample_html/cogapp_test_cogapp_py.html index 27e1711d0..59c6f98c3 100644 --- a/doc/sample_html/cogapp_test_cogapp_py.html +++ b/doc/sample_html/cogapp_test_cogapp_py.html @@ -2534,8 +2534,8 @@

diff --git a/doc/sample_html/cogapp_test_makefiles_py.html b/doc/sample_html/cogapp_test_makefiles_py.html index 70d49cd81..4a9f43549 100644 --- a/doc/sample_html/cogapp_test_makefiles_py.html +++ b/doc/sample_html/cogapp_test_makefiles_py.html @@ -178,8 +178,8 @@

diff --git a/doc/sample_html/cogapp_test_whiteutils_py.html b/doc/sample_html/cogapp_test_whiteutils_py.html index b7e500237..ae853ac14 100644 --- a/doc/sample_html/cogapp_test_whiteutils_py.html +++ b/doc/sample_html/cogapp_test_whiteutils_py.html @@ -157,8 +157,8 @@

diff --git a/doc/sample_html/cogapp_whiteutils_py.html b/doc/sample_html/cogapp_whiteutils_py.html index 040e7908b..d91bff54c 100644 --- a/doc/sample_html/cogapp_whiteutils_py.html +++ b/doc/sample_html/cogapp_whiteutils_py.html @@ -129,8 +129,8 @@

diff --git a/doc/sample_html/index.html b/doc/sample_html/index.html index 5851e5d36..c5323f34f 100644 --- a/doc/sample_html/index.html +++ b/doc/sample_html/index.html @@ -155,8 +155,8 @@

Coverage report: diff --git a/doc/sample_html/status.json b/doc/sample_html/status.json index 36f47ddec..636975972 100644 --- a/doc/sample_html/status.json +++ b/doc/sample_html/status.json @@ -1 +1 @@ -{"format":2,"version":"5.2","globals":"e6e162746063b971c76587652ff86e5f","files":{"cogapp___init___py":{"hash":"6010eef3af87123028eb691d70094593","index":{"nums":[1,2,0,0,0,0,0],"html_filename":"cogapp___init___py.html","relative_filename":"cogapp/__init__.py"}},"cogapp___main___py":{"hash":"2cec3551dfd9a5818a6550318658ccd4","index":{"nums":[1,3,0,3,0,0,0],"html_filename":"cogapp___main___py.html","relative_filename":"cogapp/__main__.py"}},"cogapp_backward_py":{"hash":"f95e44a818c73b2187e6fadc6257f8ce","index":{"nums":[1,22,0,6,4,2,2],"html_filename":"cogapp_backward_py.html","relative_filename":"cogapp/backward.py"}},"cogapp_cogapp_py":{"hash":"f85acbdbacefaccb9c499ef6cbe2ffc4","index":{"nums":[1,485,1,215,200,28,132],"html_filename":"cogapp_cogapp_py.html","relative_filename":"cogapp/cogapp.py"}},"cogapp_makefiles_py":{"hash":"4fd2add44238312a5567022fe28737de","index":{"nums":[1,27,0,20,14,0,14],"html_filename":"cogapp_makefiles_py.html","relative_filename":"cogapp/makefiles.py"}},"cogapp_test_cogapp_py":{"hash":"ee9b3c832eaa47b9e3940133c58827af","index":{"nums":[1,790,6,549,20,0,18],"html_filename":"cogapp_test_cogapp_py.html","relative_filename":"cogapp/test_cogapp.py"}},"cogapp_test_makefiles_py":{"hash":"66093f767a400ce1720b94a7371de48b","index":{"nums":[1,71,0,53,6,0,6],"html_filename":"cogapp_test_makefiles_py.html","relative_filename":"cogapp/test_makefiles.py"}},"cogapp_test_whiteutils_py":{"hash":"068beefb2872fe6739fad2471c36a4f1","index":{"nums":[1,69,0,50,0,0,0],"html_filename":"cogapp_test_whiteutils_py.html","relative_filename":"cogapp/test_whiteutils.py"}},"cogapp_whiteutils_py":{"hash":"b16b0e7f940175106b11230fea9e8c8c","index":{"nums":[1,45,0,5,34,4,4],"html_filename":"cogapp_whiteutils_py.html","relative_filename":"cogapp/whiteutils.py"}}}} \ No newline at end of file +{"format":2,"version":"5.2.1","globals":"e6e162746063b971c76587652ff86e5f","files":{"cogapp___init___py":{"hash":"6010eef3af87123028eb691d70094593","index":{"nums":[1,2,0,0,0,0,0],"html_filename":"cogapp___init___py.html","relative_filename":"cogapp/__init__.py"}},"cogapp___main___py":{"hash":"2cec3551dfd9a5818a6550318658ccd4","index":{"nums":[1,3,0,3,0,0,0],"html_filename":"cogapp___main___py.html","relative_filename":"cogapp/__main__.py"}},"cogapp_backward_py":{"hash":"f95e44a818c73b2187e6fadc6257f8ce","index":{"nums":[1,22,0,6,4,2,2],"html_filename":"cogapp_backward_py.html","relative_filename":"cogapp/backward.py"}},"cogapp_cogapp_py":{"hash":"f85acbdbacefaccb9c499ef6cbe2ffc4","index":{"nums":[1,485,1,215,200,28,132],"html_filename":"cogapp_cogapp_py.html","relative_filename":"cogapp/cogapp.py"}},"cogapp_makefiles_py":{"hash":"4fd2add44238312a5567022fe28737de","index":{"nums":[1,27,0,20,14,0,14],"html_filename":"cogapp_makefiles_py.html","relative_filename":"cogapp/makefiles.py"}},"cogapp_test_cogapp_py":{"hash":"ee9b3c832eaa47b9e3940133c58827af","index":{"nums":[1,790,6,549,20,0,18],"html_filename":"cogapp_test_cogapp_py.html","relative_filename":"cogapp/test_cogapp.py"}},"cogapp_test_makefiles_py":{"hash":"66093f767a400ce1720b94a7371de48b","index":{"nums":[1,71,0,53,6,0,6],"html_filename":"cogapp_test_makefiles_py.html","relative_filename":"cogapp/test_makefiles.py"}},"cogapp_test_whiteutils_py":{"hash":"068beefb2872fe6739fad2471c36a4f1","index":{"nums":[1,69,0,50,0,0,0],"html_filename":"cogapp_test_whiteutils_py.html","relative_filename":"cogapp/test_whiteutils.py"}},"cogapp_whiteutils_py":{"hash":"b16b0e7f940175106b11230fea9e8c8c","index":{"nums":[1,45,0,5,34,4,4],"html_filename":"cogapp_whiteutils_py.html","relative_filename":"cogapp/whiteutils.py"}}}} \ No newline at end of file diff --git a/doc/sample_html/style.css b/doc/sample_html/style.css index e501ea6bb..3e7f9b66b 100644 --- a/doc/sample_html/style.css +++ b/doc/sample_html/style.css @@ -220,7 +220,15 @@ h2.stats { margin-top: .5em; font-size: 1em; } #source p input ~ .r label.ctx:hover { background: #d5f7ff; color: #666; } -#source p input:checked ~ .r label.ctx { background: #aaeeff; color: #666; border-radius: .75em .75em 0 0; padding: 0 .5em; margin: -.25em 0; } +@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { background: #0f3a42; } } + +@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { color: #aaa; } } + +#source p input:checked ~ .r label.ctx { background: #aef; color: #666; border-radius: .75em .75em 0 0; padding: 0 .5em; margin: -.25em 0; } + +@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { background: #056; } } + +@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { color: #aaa; } } #source p input:checked ~ .r label.ctx::before { content: "▼ "; } @@ -230,7 +238,9 @@ h2.stats { margin-top: .5em; font-size: 1em; } @media (prefers-color-scheme: dark) { #source p label.ctx { color: #777; } } -#source p .ctxs { display: block; max-height: 0; overflow-y: hidden; transition: all .2s; padding: 0 .5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; white-space: nowrap; background: #aaeeff; border-radius: .25em; margin-right: 1.75em; } +#source p .ctxs { display: block; max-height: 0; overflow-y: hidden; transition: all .2s; padding: 0 .5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; white-space: nowrap; background: #aef; border-radius: .25em; margin-right: 1.75em; } + +@media (prefers-color-scheme: dark) { #source p .ctxs { background: #056; } } #source p .ctxs span { display: block; text-align: right; } From 7adc519d681f01448bfeec99b9a23a3b8da86eb6 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 24 Jul 2020 07:06:19 -0400 Subject: [PATCH 09/77] Should wait to push until sample html is done --- howto.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/howto.txt b/howto.txt index 22785be12..10a90232b 100644 --- a/howto.txt +++ b/howto.txt @@ -22,8 +22,6 @@ - Don't forget the man page: doc/python-coverage.1.txt - Check that the docs build correctly: $ tox -e doc -- Done with changes to source files, check them in. - $ git push - Generate new sample_html to get the latest, incl footer version number: $ make clean $ pip install -e . @@ -39,6 +37,8 @@ cd ~/coverage/trunk - IF NOT PRE-RELEASE: check in the new sample html +- Done with changes to source files, check them in. + $ git push - Build and publish docs: - IF PRE-RELEASE: $ make publishbeta From 033cc0b4803697ecd6fba7c6c890a2d9df419822 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 24 Jul 2020 07:25:13 -0400 Subject: [PATCH 10/77] Scooch --- CHANGES.rst | 4 ++++ coverage/version.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 28c1f4cd7..49d1cbb3d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -22,6 +22,10 @@ want to know what's different in 5.0 since 4.5.x, see :ref:`whatsnew5x`. .. ---------------------------- +Unreleased +---------- + + .. _changes_521: Version 5.2.1 --- 2020-07-23 diff --git a/coverage/version.py b/coverage/version.py index 93f843ec5..b4a503376 100644 --- a/coverage/version.py +++ b/coverage/version.py @@ -5,7 +5,7 @@ # This file is exec'ed in setup.py, don't import anything! # Same semantics as sys.version_info. -version_info = (5, 2, 1, "final", 0) +version_info = (5, 2, 2, "alpha", 0) def _make_version(major, minor, micro, releaselevel, serial): From 5a30c8d82aa942ce882fda8dbf16f5ec6f9608c4 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 24 Jul 2020 07:36:28 -0400 Subject: [PATCH 11/77] Doc process tweaks --- howto.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/howto.txt b/howto.txt index 10a90232b..1ad455d35 100644 --- a/howto.txt +++ b/howto.txt @@ -82,7 +82,7 @@ - @ https://readthedocs.org/projects/coverage/versions/ - find the latest tag in the inactive list, edit it, make it active. - readthedocs won't find the tag until a commit is made on master. - - keep just the latest version of each x.y release, make the rest inactive. + - keep just the latest version of each x.y release, make the rest active but hidden. - IF NOT PRE-RELEASE: - update git "stable" branch to point to latest release $ git branch -f stable From 348aa47798d5d315c11d568eb87165b857d547e6 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 24 Jul 2020 22:08:29 -0400 Subject: [PATCH 12/77] Help in docs didn't work with tmp --- Makefile | 11 +++++------ doc/cmd.rst | 18 +++++++++--------- doc/help/annotate.rst | 26 ++++++++++++++++++++++++++ doc/help/combine.rst | 21 +++++++++++++++++++++ doc/help/debug.rst | 18 ++++++++++++++++++ doc/help/erase.rst | 15 +++++++++++++++ doc/help/html.rst | 39 +++++++++++++++++++++++++++++++++++++++ doc/help/json.rst | 33 +++++++++++++++++++++++++++++++++ doc/help/report.rst | 38 ++++++++++++++++++++++++++++++++++++++ doc/help/run.rst | 42 ++++++++++++++++++++++++++++++++++++++++++ doc/help/xml.rst | 28 ++++++++++++++++++++++++++++ 11 files changed, 274 insertions(+), 15 deletions(-) create mode 100644 doc/help/annotate.rst create mode 100644 doc/help/combine.rst create mode 100644 doc/help/debug.rst create mode 100644 doc/help/erase.rst create mode 100644 doc/help/html.rst create mode 100644 doc/help/json.rst create mode 100644 doc/help/report.rst create mode 100644 doc/help/run.rst create mode 100644 doc/help/xml.rst diff --git a/Makefile b/Makefile index 0c65bb526..780424afd 100644 --- a/Makefile +++ b/Makefile @@ -138,18 +138,17 @@ $(DOCBIN): tox -q -e doc --notest cmd_help: $(DOCBIN) - mkdir -p tmp for cmd in annotate combine debug erase html json report run xml; do \ - echo > tmp/$$cmd.rst; \ - echo ".. code::" >> tmp/$$cmd.rst; \ - echo >> tmp/$$cmd.rst; \ - echo " $$ coverage $$cmd --help" >> tmp/$$cmd.rst; \ + echo > doc/help/$$cmd.rst; \ + echo ".. code::" >> doc/help/$$cmd.rst; \ + echo >> doc/help/$$cmd.rst; \ + echo " $$ coverage $$cmd --help" >> doc/help/$$cmd.rst; \ $(DOCBIN)/python -m coverage $$cmd --help | \ sed \ -e 's/__main__.py/coverage/' \ -e '/^Full doc/d' \ -e 's/^/ /' \ - >> tmp/$$cmd.rst; \ + >> doc/help/$$cmd.rst; \ done dochtml: $(DOCBIN) cmd_help ## Build the docs HTML output. diff --git a/doc/cmd.rst b/doc/cmd.rst index 1edc19c69..b294ee8db 100644 --- a/doc/cmd.rst +++ b/doc/cmd.rst @@ -90,7 +90,7 @@ Python ``-m`` switch:: There are many options: -.. include:: ../tmp/run.rst +.. include:: help/run.rst If you want :ref:`branch coverage ` measurement, use the ``--branch`` flag. Otherwise only statement coverage is measured. @@ -287,7 +287,7 @@ setting to store relative file paths (see :ref:`relative_files If any of the data files can't be read, coverage.py will print a warning indicating the file and the problem. -.. include:: ../tmp/combine.rst +.. include:: help/combine.rst .. _cmd_erase: @@ -297,7 +297,7 @@ Erase data: ``coverage erase`` To erase the collected data, use the **erase** command: -.. include:: ../tmp/erase.rst +.. include:: help/erase.rst If your configuration file indicates parallel data collection, **erase** will remove all of the data files. @@ -351,7 +351,7 @@ For each module executed, the report shows the count of executable statements, the number of those statements missed, and the resulting coverage, expressed as a percentage. -.. include:: ../tmp/report.rst +.. include:: help/report.rst The ``-m`` flag also shows the line numbers of missing statements:: @@ -426,7 +426,7 @@ the highlighting. A number of keyboard shortcuts are available for navigating the report. Click the keyboard icon in the upper right to see the complete list. -.. include:: ../tmp/html.rst +.. include:: help/html.rst The title of the report can be set with the ``title`` setting in the ``[html]`` section of the configuration file, or the ``--title`` switch on @@ -470,7 +470,7 @@ compatible with `Cobertura`_. .. _Cobertura: http://cobertura.github.io/cobertura/ -.. include:: ../tmp/xml.rst +.. include:: help/xml.rst You can specify the name of the output file with the ``-o`` switch. @@ -484,7 +484,7 @@ JSON reporting: ``coverage json`` The **json** command writes coverage data to a "coverage.json" file. -.. include:: ../tmp/json.rst +.. include:: help/json.rst You can specify the name of the output file with the ``-o`` switch. The JSON can be nicely formatted by specifying the ``--pretty-print`` switch. @@ -521,7 +521,7 @@ For example:: > else: > a = 2 -.. include:: ../tmp/annotate.rst +.. include:: help/annotate.rst Other common reporting options are described above in :ref:`cmd_reporting`. @@ -544,7 +544,7 @@ Three types of information are available: * ``data``: show a summary of the collected coverage data * ``premain``: show the call stack invoking coverage -.. include:: ../tmp/debug.rst +.. include:: help/debug.rst .. _cmd_run_debug: diff --git a/doc/help/annotate.rst b/doc/help/annotate.rst new file mode 100644 index 000000000..fb80e12ee --- /dev/null +++ b/doc/help/annotate.rst @@ -0,0 +1,26 @@ + +.. code:: + + $ coverage annotate --help + Usage: coverage annotate [options] [modules] + + Make annotated copies of the given files, marking statements that are executed + with > and statements that are missed with !. + + Options: + -d DIR, --directory=DIR + Write the output files to DIR. + -i, --ignore-errors Ignore errors while reading source files. + --include=PAT1,PAT2,... + Include only files whose paths match one of these + patterns. Accepts shell-style wildcards, which must be + quoted. + --omit=PAT1,PAT2,... Omit files whose paths match one of these patterns. + Accepts shell-style wildcards, which must be quoted. + --debug=OPTS Debug options, separated by commas. [env: + COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are + tried. [env: COVERAGE_RCFILE] + diff --git a/doc/help/combine.rst b/doc/help/combine.rst new file mode 100644 index 000000000..bf15c23f6 --- /dev/null +++ b/doc/help/combine.rst @@ -0,0 +1,21 @@ + +.. code:: + + $ coverage combine --help + Usage: coverage combine [options] ... + + Combine data from multiple coverage files collected with 'run -p'. The + combined results are written to a single file representing the union of the + data. The positional arguments are data files or directories containing data + files. If no paths are provided, data files in the default data file's + directory are combined. + + Options: + -a, --append Append coverage data to .coverage, otherwise it starts + clean each time. + --debug=OPTS Debug options, separated by commas. [env: COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. + [env: COVERAGE_RCFILE] + diff --git a/doc/help/debug.rst b/doc/help/debug.rst new file mode 100644 index 000000000..7c71e90e8 --- /dev/null +++ b/doc/help/debug.rst @@ -0,0 +1,18 @@ + +.. code:: + + $ coverage debug --help + Usage: coverage debug + + Display information about the internals of coverage.py, for diagnosing + problems. Topics are: 'data' to show a summary of the collected data; 'sys' to + show installation information; 'config' to show the configuration; 'premain' + to show what is calling coverage. + + Options: + --debug=OPTS Debug options, separated by commas. [env: COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. + [env: COVERAGE_RCFILE] + diff --git a/doc/help/erase.rst b/doc/help/erase.rst new file mode 100644 index 000000000..2bb64800f --- /dev/null +++ b/doc/help/erase.rst @@ -0,0 +1,15 @@ + +.. code:: + + $ coverage erase --help + Usage: coverage erase [options] + + Erase previously collected coverage data. + + Options: + --debug=OPTS Debug options, separated by commas. [env: COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. + [env: COVERAGE_RCFILE] + diff --git a/doc/help/html.rst b/doc/help/html.rst new file mode 100644 index 000000000..5be947112 --- /dev/null +++ b/doc/help/html.rst @@ -0,0 +1,39 @@ + +.. code:: + + $ coverage html --help + Usage: coverage html [options] [modules] + + Create an HTML report of the coverage of the files. Each file gets its own + page, with the source decorated to show executed, excluded, and missed lines. + + Options: + --contexts=REGEX1,REGEX2,... + Only display data from lines covered in the given + contexts. Accepts Python regexes, which must be + quoted. + -d DIR, --directory=DIR + Write the output files to DIR. + --fail-under=MIN Exit with a status of 2 if the total coverage is less + than MIN. + -i, --ignore-errors Ignore errors while reading source files. + --include=PAT1,PAT2,... + Include only files whose paths match one of these + patterns. Accepts shell-style wildcards, which must be + quoted. + --omit=PAT1,PAT2,... Omit files whose paths match one of these patterns. + Accepts shell-style wildcards, which must be quoted. + --precision=N Number of digits after the decimal point to display + for reported coverage percentages. + --show-contexts Show contexts for covered lines. + --skip-covered Skip files with 100% coverage. + --no-skip-covered Disable --skip-covered. + --skip-empty Skip files with no code. + --title=TITLE A text string to use as the title on the HTML. + --debug=OPTS Debug options, separated by commas. [env: + COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are + tried. [env: COVERAGE_RCFILE] + diff --git a/doc/help/json.rst b/doc/help/json.rst new file mode 100644 index 000000000..4028788fc --- /dev/null +++ b/doc/help/json.rst @@ -0,0 +1,33 @@ + +.. code:: + + $ coverage json --help + Usage: coverage json [options] [modules] + + Generate a JSON report of coverage results. + + Options: + --contexts=REGEX1,REGEX2,... + Only display data from lines covered in the given + contexts. Accepts Python regexes, which must be + quoted. + --fail-under=MIN Exit with a status of 2 if the total coverage is less + than MIN. + -i, --ignore-errors Ignore errors while reading source files. + --include=PAT1,PAT2,... + Include only files whose paths match one of these + patterns. Accepts shell-style wildcards, which must be + quoted. + --omit=PAT1,PAT2,... Omit files whose paths match one of these patterns. + Accepts shell-style wildcards, which must be quoted. + -o OUTFILE Write the JSON report to this file. Defaults to + 'coverage.json' + --pretty-print Format the JSON for human readers. + --show-contexts Show contexts for covered lines. + --debug=OPTS Debug options, separated by commas. [env: + COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are + tried. [env: COVERAGE_RCFILE] + diff --git a/doc/help/report.rst b/doc/help/report.rst new file mode 100644 index 000000000..97f31777d --- /dev/null +++ b/doc/help/report.rst @@ -0,0 +1,38 @@ + +.. code:: + + $ coverage report --help + Usage: coverage report [options] [modules] + + Report coverage statistics on modules. + + Options: + --contexts=REGEX1,REGEX2,... + Only display data from lines covered in the given + contexts. Accepts Python regexes, which must be + quoted. + --fail-under=MIN Exit with a status of 2 if the total coverage is less + than MIN. + -i, --ignore-errors Ignore errors while reading source files. + --include=PAT1,PAT2,... + Include only files whose paths match one of these + patterns. Accepts shell-style wildcards, which must be + quoted. + --omit=PAT1,PAT2,... Omit files whose paths match one of these patterns. + Accepts shell-style wildcards, which must be quoted. + --precision=N Number of digits after the decimal point to display + for reported coverage percentages. + --sort=COLUMN Sort the report by the named column: name, stmts, + miss, branch, brpart, or cover. Default is name. + -m, --show-missing Show line numbers of statements in each module that + weren't executed. + --skip-covered Skip files with 100% coverage. + --no-skip-covered Disable --skip-covered. + --skip-empty Skip files with no code. + --debug=OPTS Debug options, separated by commas. [env: + COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are + tried. [env: COVERAGE_RCFILE] + diff --git a/doc/help/run.rst b/doc/help/run.rst new file mode 100644 index 000000000..07f94aa5d --- /dev/null +++ b/doc/help/run.rst @@ -0,0 +1,42 @@ + +.. code:: + + $ coverage run --help + Usage: coverage run [options] [program options] + + Run a Python program, measuring code execution. + + Options: + -a, --append Append coverage data to .coverage, otherwise it starts + clean each time. + --branch Measure branch coverage in addition to statement + coverage. + --concurrency=LIB Properly measure code using a concurrency library. + Valid values are: thread, gevent, greenlet, eventlet, + multiprocessing. + --context=LABEL The context label to record for this coverage run. + --include=PAT1,PAT2,... + Include only files whose paths match one of these + patterns. Accepts shell-style wildcards, which must be + quoted. + -m, --module is an importable Python module, not a script + path, to be run as 'python -m' would run it. + --omit=PAT1,PAT2,... Omit files whose paths match one of these patterns. + Accepts shell-style wildcards, which must be quoted. + -L, --pylib Measure coverage even inside the Python installed + library, which isn't done by default. + -p, --parallel-mode Append the machine name, process id and random number + to the .coverage data file name to simplify collecting + data from many processes. + --source=SRC1,SRC2,... + A list of packages or directories of code to be + measured. + --timid Use a simpler but slower trace method. Try this if you + get seemingly impossible results! + --debug=OPTS Debug options, separated by commas. [env: + COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are + tried. [env: COVERAGE_RCFILE] + diff --git a/doc/help/xml.rst b/doc/help/xml.rst new file mode 100644 index 000000000..f83f297b5 --- /dev/null +++ b/doc/help/xml.rst @@ -0,0 +1,28 @@ + +.. code:: + + $ coverage xml --help + Usage: coverage xml [options] [modules] + + Generate an XML report of coverage results. + + Options: + --fail-under=MIN Exit with a status of 2 if the total coverage is less + than MIN. + -i, --ignore-errors Ignore errors while reading source files. + --include=PAT1,PAT2,... + Include only files whose paths match one of these + patterns. Accepts shell-style wildcards, which must be + quoted. + --omit=PAT1,PAT2,... Omit files whose paths match one of these patterns. + Accepts shell-style wildcards, which must be quoted. + -o OUTFILE Write the XML report to this file. Defaults to + 'coverage.xml' + --skip-empty Skip files with no code. + --debug=OPTS Debug options, separated by commas. [env: + COVERAGE_DEBUG] + -h, --help Get help on this command. + --rcfile=RCFILE Specify configuration file. By default '.coveragerc', + 'setup.cfg', 'tox.ini', and 'pyproject.toml' are + tried. [env: COVERAGE_RCFILE] + From b8ff7bf98b7c84932f2131e0d2b8aca1e2ab141c Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 9 Aug 2020 07:47:53 -0400 Subject: [PATCH 13/77] Correct the indentation --- tox.ini | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index 67a533bbb..88fbbd688 100644 --- a/tox.ini +++ b/tox.ini @@ -90,9 +90,9 @@ commands = [travis] #2.7: py27, lint python = - 2.7: py27 - 3.5: py35 - 3.6: py36 - 3.7: py37 - pypy: pypy - pypy3.5: pypy3 + 2.7: py27 + 3.5: py35 + 3.6: py36 + 3.7: py37 + pypy: pypy + pypy3.5: pypy3 From aa6cb95e366f479cddd8cd30aee940393ead6296 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 16 Aug 2020 12:58:05 -0400 Subject: [PATCH 14/77] Don't build the help includes into HTML --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 5bd101c37..d2a787dc5 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -97,7 +97,7 @@ # List of directories, relative to source directory, that shouldn't be searched # for source files. -exclude_trees = ['_build'] +exclude_patterns = ["_build", "help/*"] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None From 450ac0bf86afb89f800e638ed6b4aed20c678c21 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2020 19:33:26 -0400 Subject: [PATCH 15/77] Prevent trailing whitespace in doc/help/* files --- Makefile | 2 +- doc/help/annotate.rst | 6 +++--- doc/help/combine.rst | 6 +++--- doc/help/debug.rst | 6 +++--- doc/help/erase.rst | 6 +++--- doc/help/html.rst | 6 +++--- doc/help/json.rst | 6 +++--- doc/help/report.rst | 6 +++--- doc/help/run.rst | 6 +++--- doc/help/xml.rst | 6 +++--- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index 780424afd..7b383bbca 100644 --- a/Makefile +++ b/Makefile @@ -147,7 +147,7 @@ cmd_help: $(DOCBIN) sed \ -e 's/__main__.py/coverage/' \ -e '/^Full doc/d' \ - -e 's/^/ /' \ + -e 's/^./ &/' \ >> doc/help/$$cmd.rst; \ done diff --git a/doc/help/annotate.rst b/doc/help/annotate.rst index fb80e12ee..8f0883a04 100644 --- a/doc/help/annotate.rst +++ b/doc/help/annotate.rst @@ -3,10 +3,10 @@ $ coverage annotate --help Usage: coverage annotate [options] [modules] - + Make annotated copies of the given files, marking statements that are executed with > and statements that are missed with !. - + Options: -d DIR, --directory=DIR Write the output files to DIR. @@ -23,4 +23,4 @@ --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + diff --git a/doc/help/combine.rst b/doc/help/combine.rst index bf15c23f6..35180cdde 100644 --- a/doc/help/combine.rst +++ b/doc/help/combine.rst @@ -3,13 +3,13 @@ $ coverage combine --help Usage: coverage combine [options] ... - + Combine data from multiple coverage files collected with 'run -p'. The combined results are written to a single file representing the union of the data. The positional arguments are data files or directories containing data files. If no paths are provided, data files in the default data file's directory are combined. - + Options: -a, --append Append coverage data to .coverage, otherwise it starts clean each time. @@ -18,4 +18,4 @@ --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + diff --git a/doc/help/debug.rst b/doc/help/debug.rst index 7c71e90e8..db1e64b26 100644 --- a/doc/help/debug.rst +++ b/doc/help/debug.rst @@ -3,16 +3,16 @@ $ coverage debug --help Usage: coverage debug - + Display information about the internals of coverage.py, for diagnosing problems. Topics are: 'data' to show a summary of the collected data; 'sys' to show installation information; 'config' to show the configuration; 'premain' to show what is calling coverage. - + Options: --debug=OPTS Debug options, separated by commas. [env: COVERAGE_DEBUG] -h, --help Get help on this command. --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + diff --git a/doc/help/erase.rst b/doc/help/erase.rst index 2bb64800f..c8f45155a 100644 --- a/doc/help/erase.rst +++ b/doc/help/erase.rst @@ -3,13 +3,13 @@ $ coverage erase --help Usage: coverage erase [options] - + Erase previously collected coverage data. - + Options: --debug=OPTS Debug options, separated by commas. [env: COVERAGE_DEBUG] -h, --help Get help on this command. --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + diff --git a/doc/help/html.rst b/doc/help/html.rst index 5be947112..8dfa285aa 100644 --- a/doc/help/html.rst +++ b/doc/help/html.rst @@ -3,10 +3,10 @@ $ coverage html --help Usage: coverage html [options] [modules] - + Create an HTML report of the coverage of the files. Each file gets its own page, with the source decorated to show executed, excluded, and missed lines. - + Options: --contexts=REGEX1,REGEX2,... Only display data from lines covered in the given @@ -36,4 +36,4 @@ --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + diff --git a/doc/help/json.rst b/doc/help/json.rst index 4028788fc..cec488e55 100644 --- a/doc/help/json.rst +++ b/doc/help/json.rst @@ -3,9 +3,9 @@ $ coverage json --help Usage: coverage json [options] [modules] - + Generate a JSON report of coverage results. - + Options: --contexts=REGEX1,REGEX2,... Only display data from lines covered in the given @@ -30,4 +30,4 @@ --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + diff --git a/doc/help/report.rst b/doc/help/report.rst index 97f31777d..3408f2bb4 100644 --- a/doc/help/report.rst +++ b/doc/help/report.rst @@ -3,9 +3,9 @@ $ coverage report --help Usage: coverage report [options] [modules] - + Report coverage statistics on modules. - + Options: --contexts=REGEX1,REGEX2,... Only display data from lines covered in the given @@ -35,4 +35,4 @@ --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + diff --git a/doc/help/run.rst b/doc/help/run.rst index 07f94aa5d..a336929a5 100644 --- a/doc/help/run.rst +++ b/doc/help/run.rst @@ -3,9 +3,9 @@ $ coverage run --help Usage: coverage run [options] [program options] - + Run a Python program, measuring code execution. - + Options: -a, --append Append coverage data to .coverage, otherwise it starts clean each time. @@ -39,4 +39,4 @@ --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + diff --git a/doc/help/xml.rst b/doc/help/xml.rst index f83f297b5..eb52750d4 100644 --- a/doc/help/xml.rst +++ b/doc/help/xml.rst @@ -3,9 +3,9 @@ $ coverage xml --help Usage: coverage xml [options] [modules] - + Generate an XML report of coverage results. - + Options: --fail-under=MIN Exit with a status of 2 if the total coverage is less than MIN. @@ -25,4 +25,4 @@ --rcfile=RCFILE Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] - + From 1bf2a0609e7673b6b0dffe3123a760ab4a3c0be6 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2020 20:00:03 -0400 Subject: [PATCH 16/77] Bitbucket hg repos are gone --- CHANGES.rst | 516 ++++++++++++++++++++++----------------------- doc/plugins.rst | 2 +- doc/trouble.rst | 2 +- doc/whatsnew5x.rst | 2 +- 4 files changed, 261 insertions(+), 261 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 49d1cbb3d..0bbf4d34b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -576,7 +576,7 @@ Version 5.0a2 --- 2018-09-03 - pickle2json, for converting v3 data files to v4 data files, has been removed. -.. _Bitbucket: https://bitbucket.org/ned/coveragepy +.. _Bitbucket: https://bitbucket.org .. _GitHub: https://github.com/nedbat/coveragepy .. _issue 611: https://github.com/nedbat/coveragepy/issues/611 @@ -604,8 +604,8 @@ Version 5.0a1 --- 2018-06-05 - Large HTML report pages load faster. Thanks, Pankaj Pandey. -.. _issue 625: https://bitbucket.org/ned/coveragepy/issues/625/lstat-dominates-in-the-case-of-small -.. _issue 650: https://bitbucket.org/ned/coveragepy/issues/650/allow-setting-configuration-file-location +.. _issue 625: https://github.com/nedbat/coveragepy/issues/625 +.. _issue 650: https://github.com/nedbat/coveragepy/issues/650 .. _issue 700: https://github.com/nedbat/coveragepy/issues/700 @@ -645,7 +645,7 @@ Version 4.5.2 --- 2018-11-12 .. _issue 707: https://github.com/nedbat/coveragepy/issues/707 .. _issue 714: https://github.com/nedbat/coveragepy/issues/714 -.. _Bitbucket: https://bitbucket.org/ned/coveragepy +.. _Bitbucket: https://bitbucket.org .. _GitHub: https://github.com/nedbat/coveragepy @@ -665,8 +665,8 @@ Version 4.5.1 --- 2018-02-10 - Configurer plugins are now reported in the output of ``--debug=sys``. -.. _issue 638: https://bitbucket.org/ned/coveragepy/issues/638/run-omit-is-ignored-since-45 -.. _issue 640: https://bitbucket.org/ned/coveragepy/issues/640/indexerror-reporting-on-an-empty-decorated +.. _issue 638: https://github.com/nedbat/coveragepy/issues/638 +.. _issue 640: https://github.com/nedbat/coveragepy/issues/640 .. _changes_45: @@ -705,13 +705,13 @@ Version 4.5 --- 2018-02-03 maximum. Now filenames will never get much larger than 200 characters, fixing `issue 627`_. Thanks to Alex Sandro for helping with the fix. -.. _issue 563: https://bitbucket.org/ned/coveragepy/issues/563/platform-specific-configuration -.. _issue 618: https://bitbucket.org/ned/coveragepy/issues/618/problem-when-combining-windows-generated -.. _issue 621: https://bitbucket.org/ned/coveragepy/issues/621/include-ignored-warning-when-using -.. _issue 622: https://bitbucket.org/ned/coveragepy/issues/622/report-omit-overwrites-run-omit -.. _issue 627: https://bitbucket.org/ned/coveragepy/issues/627/failure-generating-html-reports-when-the -.. _issue 629: https://bitbucket.org/ned/coveragepy/issues/629/multiple-use-of-combine-leads-to-empty -.. _issue 631: https://bitbucket.org/ned/coveragepy/issues/631/precise-coverage-percentage-value +.. _issue 563: https://github.com/nedbat/coveragepy/issues/563 +.. _issue 618: https://github.com/nedbat/coveragepy/issues/618 +.. _issue 621: https://github.com/nedbat/coveragepy/issues/621 +.. _issue 622: https://github.com/nedbat/coveragepy/issues/622 +.. _issue 627: https://github.com/nedbat/coveragepy/issues/627 +.. _issue 629: https://github.com/nedbat/coveragepy/issues/629 +.. _issue 631: https://github.com/nedbat/coveragepy/issues/631 .. _changes_442: @@ -743,11 +743,11 @@ Version 4.4.2 --- 2017-11-05 - Be more flexible about the command name displayed by help, fixing `issue 600`_. Thanks, Ben Finney. -.. _issue 101: https://bitbucket.org/ned/coveragepy/issues/101/settings-under-report-affect-running -.. _issue 581: https://bitbucket.org/ned/coveragepy/issues/581/race-condition-when-saving-data-under -.. _issue 588: https://bitbucket.org/ned/coveragepy/issues/588/using-rcfile-path-to-toxini-uses-run -.. _issue 589: https://bitbucket.org/ned/coveragepy/issues/589/allow-expansion-in-coveragerc -.. _issue 600: https://bitbucket.org/ned/coveragepy/issues/600/get-program-name-from-command-line-when +.. _issue 101: https://github.com/nedbat/coveragepy/issues/101 +.. _issue 581: https://github.com/nedbat/coveragepy/issues/581 +.. _issue 588: https://github.com/nedbat/coveragepy/issues/588 +.. _issue 589: https://github.com/nedbat/coveragepy/issues/589 +.. _issue 600: https://github.com/nedbat/coveragepy/issues/600 .. _changes_441: @@ -783,10 +783,10 @@ Version 4.4 --- 2017-05-07 - Running ``coverage xml`` in a directory named with non-ASCII characters would fail under Python 2. This is now fixed. (`issue 573`_) -.. _issue 526: https://bitbucket.org/ned/coveragepy/issues/526/generated-xml-invalid-paths-for-cobertura -.. _issue 572: https://bitbucket.org/ned/coveragepy/issues/572/no-python-source-warning-for-namespace -.. _issue 573: https://bitbucket.org/ned/coveragepy/issues/573/cant-generate-xml-report-if-some-source -.. _issue 575: https://bitbucket.org/ned/coveragepy/issues/575/running-doctest-prevents-complete-coverage +.. _issue 526: https://github.com/nedbat/coveragepy/issues/526 +.. _issue 572: https://github.com/nedbat/coveragepy/issues/572 +.. _issue 573: https://github.com/nedbat/coveragepy/issues/573 +.. _issue 575: https://github.com/nedbat/coveragepy/issues/575 Version 4.4b1 --- 2017-04-04 @@ -818,11 +818,11 @@ Version 4.4b1 --- 2017-04-04 the coverage of the standard library tests. This code was not installed by kitted versions of coverage.py. Now it is. -.. _issue 79: https://bitbucket.org/ned/coveragepy/issues/79/save-prevents-harvesting-on-stop -.. _issue 96: https://bitbucket.org/ned/coveragepy/issues/96/unhelpful-warnings-produced-when-using -.. _issue 355: https://bitbucket.org/ned/coveragepy/issues/355/warnings-should-be-suppressable -.. _issue 448: https://bitbucket.org/ned/coveragepy/issues/448/save-and-html_report-prevent-further -.. _issue 570: https://bitbucket.org/ned/coveragepy/issues/570/cobertura-coverage-04dtd-support +.. _issue 79: https://github.com/nedbat/coveragepy/issues/79 +.. _issue 96: https://github.com/nedbat/coveragepy/issues/96 +.. _issue 355: https://github.com/nedbat/coveragepy/issues/355 +.. _issue 448: https://github.com/nedbat/coveragepy/issues/448 +.. _issue 570: https://github.com/nedbat/coveragepy/issues/570 .. _changes_434: @@ -834,7 +834,7 @@ Version 4.3.4 --- 2017-01-17 exception wasn't properly derived from Exception, described in `issue 556`_. A newb mistake; it hasn't been a good few days. -.. _issue 556: https://bitbucket.org/ned/coveragepy/issues/556/43-fails-if-there-are-html-files-in-the +.. _issue 556: https://github.com/nedbat/coveragepy/issues/556 .. _changes_433: @@ -846,7 +846,7 @@ Version 4.3.3 --- 2017-01-17 benefit of the coverage.py test suite. Properly conditionalizing it fixed `issue 554`_ so that Python 2.6 works again. -.. _issue 554: https://bitbucket.org/ned/coveragepy/issues/554/traceback-on-python-26-starting-with-432 +.. _issue 554: https://github.com/nedbat/coveragepy/issues/554 .. _changes_432: @@ -889,11 +889,11 @@ Version 4.3.2 --- 2017-01-16 coverage.py 4.3, the old HTML file with the less-than-100% coverage would be left behind. This file is now properly deleted. -.. _issue 322: https://bitbucket.org/ned/coveragepy/issues/322/cannot-use-coverage-with-jython -.. _issue 426: https://bitbucket.org/ned/coveragepy/issues/426/difference-between-coverage-results-with -.. _issue 522: https://bitbucket.org/ned/coveragepy/issues/522/incorrect-branch-reporting -.. _issue 549: https://bitbucket.org/ned/coveragepy/issues/549/skip-covered-with-100-coverage-throws-a-no -.. _issue 551: https://bitbucket.org/ned/coveragepy/issues/551/coveragepy-cannot-be-imported-in-jython27 +.. _issue 322: https://github.com/nedbat/coveragepy/issues/322 +.. _issue 426: https://github.com/nedbat/coveragepy/issues/426 +.. _issue 522: https://github.com/nedbat/coveragepy/issues/522 +.. _issue 549: https://github.com/nedbat/coveragepy/issues/549 +.. _issue 551: https://github.com/nedbat/coveragepy/issues/551 .. _changes_431: @@ -909,8 +909,8 @@ Version 4.3.1 --- 2016-12-28 in `issue 541`_. The check has been reverted while we re-think the fix for `issue 265`_. -.. _issue 540: https://bitbucket.org/ned/coveragepy/issues/540/cant-install-coverage-v43-into-under -.. _issue 541: https://bitbucket.org/ned/coveragepy/issues/541/coverage-43-breaks-nosetest-with-coverage +.. _issue 540: https://github.com/nedbat/coveragepy/issues/540 +.. _issue 541: https://github.com/nedbat/coveragepy/issues/541 .. _changes_43: @@ -1022,24 +1022,24 @@ coverage.py and contributed a number of improvements in this release. author string in setup.py, though this might be too cute. .. _sys.excepthook: https://docs.python.org/3/library/sys.html#sys.excepthook -.. _issue 265: https://bitbucket.org/ned/coveragepy/issues/265/when-using-source-include-is-silently -.. _issue 412: https://bitbucket.org/ned/coveragepy/issues/412/coverage-combine-should-error-if-no -.. _issue 433: https://bitbucket.org/ned/coveragepy/issues/433/coverage-html-does-not-suport-skip-covered -.. _issue 493: https://bitbucket.org/ned/coveragepy/issues/493/confusing-branching-failure -.. _issue 496: https://bitbucket.org/ned/coveragepy/issues/496/incorrect-coverage-with-branching-and -.. _issue 502: https://bitbucket.org/ned/coveragepy/issues/502/incorrect-coverage-report-with-cover -.. _issue 505: https://bitbucket.org/ned/coveragepy/issues/505/use-canonical-filename-for-debounce -.. _issue 514: https://bitbucket.org/ned/coveragepy/issues/514/path-to-problem-file-not-reported-when -.. _issue 510: https://bitbucket.org/ned/coveragepy/issues/510/erase-still-needed-in-42 -.. _issue 511: https://bitbucket.org/ned/coveragepy/issues/511/version-42-coverage-combine-empties -.. _issue 516: https://bitbucket.org/ned/coveragepy/issues/516/running-coverage-combine-twice-deletes-all -.. _issue 519: https://bitbucket.org/ned/coveragepy/issues/519/coverage-run-sections-in-toxini-or-as -.. _issue 524: https://bitbucket.org/ned/coveragepy/issues/524/coverage-report-with-skip-covered-column -.. _issue 525: https://bitbucket.org/ned/coveragepy/issues/525/coverage-combine-when-not-in-parallel-mode -.. _issue 529: https://bitbucket.org/ned/coveragepy/issues/529/encoding-marker-may-only-appear-on-the -.. _issue 530: https://bitbucket.org/ned/coveragepy/issues/530/deprecationwarning-you-passed-a-bytestring -.. _issue 533: https://bitbucket.org/ned/coveragepy/issues/533/exception-on-unencodable-file-name -.. _issue 535: https://bitbucket.org/ned/coveragepy/issues/535/sysexcepthook-is-not-called +.. _issue 265: https://github.com/nedbat/coveragepy/issues/265 +.. _issue 412: https://github.com/nedbat/coveragepy/issues/412 +.. _issue 433: https://github.com/nedbat/coveragepy/issues/433 +.. _issue 493: https://github.com/nedbat/coveragepy/issues/493 +.. _issue 496: https://github.com/nedbat/coveragepy/issues/496 +.. _issue 502: https://github.com/nedbat/coveragepy/issues/502 +.. _issue 505: https://github.com/nedbat/coveragepy/issues/505 +.. _issue 514: https://github.com/nedbat/coveragepy/issues/514 +.. _issue 510: https://github.com/nedbat/coveragepy/issues/510 +.. _issue 511: https://github.com/nedbat/coveragepy/issues/511 +.. _issue 516: https://github.com/nedbat/coveragepy/issues/516 +.. _issue 519: https://github.com/nedbat/coveragepy/issues/519 +.. _issue 524: https://github.com/nedbat/coveragepy/issues/524 +.. _issue 525: https://github.com/nedbat/coveragepy/issues/525 +.. _issue 529: https://github.com/nedbat/coveragepy/issues/529 +.. _issue 530: https://github.com/nedbat/coveragepy/issues/530 +.. _issue 533: https://github.com/nedbat/coveragepy/issues/533 +.. _issue 535: https://github.com/nedbat/coveragepy/issues/535 .. _changes_42: @@ -1057,7 +1057,7 @@ Version 4.2 --- 2016-07-26 - Filtering the HTML report is now faster, thanks to Ville Skyttä. -.. _issue 495: https://bitbucket.org/ned/coveragepy/issues/495/branch-and-concurrency-are-conflicting +.. _issue 495: https://github.com/nedbat/coveragepy/issues/495 Version 4.2b1 --- 2016-07-04 @@ -1110,14 +1110,14 @@ Work from the PyCon 2016 Sprints! package: `unittest-mixins`_. .. _automatic subprocess measurement: https://coverage.readthedocs.io/en/latest/subprocess.html -.. _issue 199: https://bitbucket.org/ned/coveragepy/issues/199/add-a-way-to-sort-the-text-report -.. _issue 231: https://bitbucket.org/ned/coveragepy/issues/231/various-default-behavior-in-report-phase -.. _issue 298: https://bitbucket.org/ned/coveragepy/issues/298/show-in-html-report-that-the-columns-are -.. _issue 396: https://bitbucket.org/ned/coveragepy/issues/396/coverage-xml-shouldnt-bail-out-on-parse -.. _issue 454: https://bitbucket.org/ned/coveragepy/issues/454/coverage-debug-config-should-be -.. _issue 478: https://bitbucket.org/ned/coveragepy/issues/478/help-shows-silly-program-name-when-running -.. _issue 484: https://bitbucket.org/ned/coveragepy/issues/484/multiprocessing-greenlet-concurrency -.. _issue 492: https://bitbucket.org/ned/coveragepy/issues/492/subprocess-coverage-strange-detection-of +.. _issue 199: https://github.com/nedbat/coveragepy/issues/199 +.. _issue 231: https://github.com/nedbat/coveragepy/issues/231 +.. _issue 298: https://github.com/nedbat/coveragepy/issues/298 +.. _issue 396: https://github.com/nedbat/coveragepy/issues/396 +.. _issue 454: https://github.com/nedbat/coveragepy/issues/454 +.. _issue 478: https://github.com/nedbat/coveragepy/issues/478 +.. _issue 484: https://github.com/nedbat/coveragepy/issues/484 +.. _issue 492: https://github.com/nedbat/coveragepy/issues/492 .. _unittest-mixins: https://pypi.org/project/unittest-mixins/ @@ -1184,17 +1184,17 @@ Version 4.1b3 --- 2016-05-10 - Make a small tweak to how we compare threads, to avoid buggy custom comparison code in thread classes. (`issue 245`_) -.. _issue 90: https://bitbucket.org/ned/coveragepy/issues/90/lambda-expression-confuses-branch -.. _issue 245: https://bitbucket.org/ned/coveragepy/issues/245/change-solution-for-issue-164 -.. _issue 440: https://bitbucket.org/ned/coveragepy/issues/440/yielded-twisted-failure-marked-as-missed -.. _issue 456: https://bitbucket.org/ned/coveragepy/issues/456/coverage-breaks-with-implicit-namespaces -.. _issue 460: https://bitbucket.org/ned/coveragepy/issues/460/confusing-html-report-for-certain-partial -.. _issue 469: https://bitbucket.org/ned/coveragepy/issues/469/strange-1-line-number-in-branch-coverage -.. _issue 472: https://bitbucket.org/ned/coveragepy/issues/472/html-report-indents-incorrectly-for-one -.. _issue 475: https://bitbucket.org/ned/coveragepy/issues/475/generator-expression-is-marked-as-not -.. _issue 479: https://bitbucket.org/ned/coveragepy/issues/479/clarify-the-need-for-the-c-extension -.. _issue 481: https://bitbucket.org/ned/coveragepy/issues/481/asyncioprocesspoolexecutor-tracing-not -.. _issue 485: https://bitbucket.org/ned/coveragepy/issues/485/coveragereport-ignores-show_missing-and +.. _issue 90: https://github.com/nedbat/coveragepy/issues/90 +.. _issue 245: https://github.com/nedbat/coveragepy/issues/245 +.. _issue 440: https://github.com/nedbat/coveragepy/issues/440 +.. _issue 456: https://github.com/nedbat/coveragepy/issues/456 +.. _issue 460: https://github.com/nedbat/coveragepy/issues/460 +.. _issue 469: https://github.com/nedbat/coveragepy/issues/469 +.. _issue 472: https://github.com/nedbat/coveragepy/issues/472 +.. _issue 475: https://github.com/nedbat/coveragepy/issues/475 +.. _issue 479: https://github.com/nedbat/coveragepy/issues/479 +.. _issue 481: https://github.com/nedbat/coveragepy/issues/481 +.. _issue 485: https://github.com/nedbat/coveragepy/issues/485 Version 4.1b2 --- 2016-01-23 @@ -1217,8 +1217,8 @@ Version 4.1b2 --- 2016-01-23 - ``coverage report`` won't produce trailing whitespace. -.. _issue 465: https://bitbucket.org/ned/coveragepy/issues/465/coveragexml-produces-package-names-with-an -.. _issue 466: https://bitbucket.org/ned/coveragepy/issues/466/impossible-missed-branch-to-a-negative +.. _issue 465: https://github.com/nedbat/coveragepy/issues/465 +.. _issue 466: https://github.com/nedbat/coveragepy/issues/466 Version 4.1b1 --- 2016-01-10 @@ -1266,15 +1266,15 @@ Version 4.1b1 --- 2016-01-10 - Form-feed characters would prevent accurate determination of the beginning of statements in the rest of the file. This is now fixed, closing `issue 461`_. -.. _issue 129: https://bitbucket.org/ned/coveragepy/issues/129/misleading-branch-coverage-of-empty -.. _issue 131: https://bitbucket.org/ned/coveragepy/issues/131/pragma-on-a-decorator-line-should-affect -.. _issue 146: https://bitbucket.org/ned/coveragepy/issues/146/context-managers-confuse-branch-coverage -.. _issue 212: https://bitbucket.org/ned/coveragepy/issues/212/coverage-erroneously-reports-partial -.. _issue 422: https://bitbucket.org/ned/coveragepy/issues/422/python35-partial-branch-marked-as-fully -.. _issue 434: https://bitbucket.org/ned/coveragepy/issues/434/indexerror-in-python-35 -.. _issue 453: https://bitbucket.org/ned/coveragepy/issues/453/source-code-encoding-can-only-be-specified -.. _issue 455: https://bitbucket.org/ned/coveragepy/issues/455/unusual-exclusions-stopped-working-in -.. _issue 461: https://bitbucket.org/ned/coveragepy/issues/461/multiline-asserts-need-too-many-pragma +.. _issue 129: https://github.com/nedbat/coveragepy/issues/129 +.. _issue 131: https://github.com/nedbat/coveragepy/issues/131 +.. _issue 146: https://github.com/nedbat/coveragepy/issues/146 +.. _issue 212: https://github.com/nedbat/coveragepy/issues/212 +.. _issue 422: https://github.com/nedbat/coveragepy/issues/422 +.. _issue 434: https://github.com/nedbat/coveragepy/issues/434 +.. _issue 453: https://github.com/nedbat/coveragepy/issues/453 +.. _issue 455: https://github.com/nedbat/coveragepy/issues/455 +.. _issue 461: https://github.com/nedbat/coveragepy/issues/461 .. _changes_403: @@ -1297,11 +1297,11 @@ Version 4.0.3 --- 2015-11-24 command name, which might be different than "coverage". Thanks to Ben Finney, this closes `issue 438`_. -.. _issue 420: https://bitbucket.org/ned/coveragepy/issues/420/coverage-40-hangs-indefinitely-on-python27 -.. _issue 438: https://bitbucket.org/ned/coveragepy/issues/438/parameterise-coverage-command-name -.. _issue 439: https://bitbucket.org/ned/coveragepy/issues/439/incorrect-cobertura-file-sources-generated -.. _issue 443: https://bitbucket.org/ned/coveragepy/issues/443/coverage-gets-confused-when-encoding -.. _issue 445: https://bitbucket.org/ned/coveragepy/issues/445/django-app-cannot-connect-to-cassandra +.. _issue 420: https://github.com/nedbat/coveragepy/issues/420 +.. _issue 438: https://github.com/nedbat/coveragepy/issues/438 +.. _issue 439: https://github.com/nedbat/coveragepy/issues/439 +.. _issue 443: https://github.com/nedbat/coveragepy/issues/443 +.. _issue 445: https://github.com/nedbat/coveragepy/issues/445 .. _changes_402: @@ -1320,9 +1320,9 @@ Version 4.0.2 --- 2015-11-04 - Officially support PyPy 4.0, which required no changes, just updates to the docs. -.. _issue 431: https://bitbucket.org/ned/coveragepy/issues/431/couldnt-parse-python-file-with-cp1252 -.. _issue 432: https://bitbucket.org/ned/coveragepy/issues/432/path-with-unicode-characters-various -.. _issue 436: https://bitbucket.org/ned/coveragepy/issues/436/disabled-coverage-ctracer-may-rise-from +.. _issue 431: https://github.com/nedbat/coveragepy/issues/431 +.. _issue 432: https://github.com/nedbat/coveragepy/issues/432 +.. _issue 436: https://github.com/nedbat/coveragepy/issues/436 .. _changes_401: @@ -1363,14 +1363,14 @@ Version 4.0.1 --- 2015-10-13 - The source kit now contains all of the files needed to have a complete source tree, re-fixing `issue 137`_ and closing `issue 281`_. -.. _issue 281: https://bitbucket.org/ned/coveragepy/issues/281/supply-scripts-for-testing-in-the -.. _issue 397: https://bitbucket.org/ned/coveragepy/issues/397/stopping-and-resuming-coverage-with -.. _issue 410: https://bitbucket.org/ned/coveragepy/issues/410/attributeerror-module-object-has-no -.. _issue 415: https://bitbucket.org/ned/coveragepy/issues/415/repeated-coveragedataupdates-cause -.. _issue 416: https://bitbucket.org/ned/coveragepy/issues/416/mocking-ospathexists-causes-failures -.. _issue 418: https://bitbucket.org/ned/coveragepy/issues/418/json-parse-error -.. _issue 419: https://bitbucket.org/ned/coveragepy/issues/419/nosource-no-source-for-code-path-to-c -.. _issue 423: https://bitbucket.org/ned/coveragepy/issues/423/skip_covered-changes-reported-total +.. _issue 281: https://github.com/nedbat/coveragepy/issues/281 +.. _issue 397: https://github.com/nedbat/coveragepy/issues/397 +.. _issue 410: https://github.com/nedbat/coveragepy/issues/410 +.. _issue 415: https://github.com/nedbat/coveragepy/issues/415 +.. _issue 416: https://github.com/nedbat/coveragepy/issues/416 +.. _issue 418: https://github.com/nedbat/coveragepy/issues/418 +.. _issue 419: https://github.com/nedbat/coveragepy/issues/419 +.. _issue 423: https://github.com/nedbat/coveragepy/issues/423 .. _changes_40: @@ -1397,8 +1397,8 @@ Version 4.0b3 --- 2015-09-07 include tests and docs. If you were using them from the older packages, get in touch and help me understand how. -.. _issue 403: https://bitbucket.org/ned/coveragepy/issues/403/hasherupdate-fails-with-typeerror-nonetype -.. _issue 404: https://bitbucket.org/ned/coveragepy/issues/404/shiningpanda-jenkins-plugin-cant-find-html +.. _issue 403: https://github.com/nedbat/coveragepy/issues/403 +.. _issue 404: https://github.com/nedbat/coveragepy/issues/404 Version 4.0b2 --- 2015-08-22 @@ -1428,9 +1428,9 @@ Version 4.0b2 --- 2015-08-22 - A new version identifier is available, `coverage.version_info`, a plain tuple of values similar to `sys.version_info`_. -.. _issue 392: https://bitbucket.org/ned/coveragepy/issues/392/run-append-doesnt-create-coverage-file -.. _issue 395: https://bitbucket.org/ned/coveragepy/issues/395/rfe-read-pickled-files-as-well-for -.. _issue 399: https://bitbucket.org/ned/coveragepy/issues/399/coverageexception-cant-combine-line-data +.. _issue 392: https://github.com/nedbat/coveragepy/issues/392 +.. _issue 395: https://github.com/nedbat/coveragepy/issues/395 +.. _issue 399: https://github.com/nedbat/coveragepy/issues/399 .. _sys.version_info: https://docs.python.org/3/library/sys.html#sys.version_info @@ -1500,15 +1500,15 @@ Version 4.0b1 --- 2015-08-02 - The speed is back to 3.7.1 levels, after having slowed down due to plugin support, finishing up `issue 387`_. -.. _issue 236: https://bitbucket.org/ned/coveragepy/issues/236/pickles-are-bad-and-you-should-feel-bad -.. _issue 252: https://bitbucket.org/ned/coveragepy/issues/252/coverage-wont-run-a-program-with -.. _issue 262: https://bitbucket.org/ned/coveragepy/issues/262/when-parallel-true-erase-should-erase-all -.. _issue 275: https://bitbucket.org/ned/coveragepy/issues/275/refer-consistently-to-project-as-coverage -.. _issue 313: https://bitbucket.org/ned/coveragepy/issues/313/add-license-file-containing-2-3-or-4 -.. _issue 380: https://bitbucket.org/ned/coveragepy/issues/380/code-executed-by-exec-excluded-from -.. _issue 385: https://bitbucket.org/ned/coveragepy/issues/385/coverage-combine-doesnt-work-with-rcfile -.. _issue 386: https://bitbucket.org/ned/coveragepy/issues/386/error-on-unrecognised-configuration -.. _issue 387: https://bitbucket.org/ned/coveragepy/issues/387/performance-degradation-from-371-to-40 +.. _issue 236: https://github.com/nedbat/coveragepy/issues/236 +.. _issue 252: https://github.com/nedbat/coveragepy/issues/252 +.. _issue 262: https://github.com/nedbat/coveragepy/issues/262 +.. _issue 275: https://github.com/nedbat/coveragepy/issues/275 +.. _issue 313: https://github.com/nedbat/coveragepy/issues/313 +.. _issue 380: https://github.com/nedbat/coveragepy/issues/380 +.. _issue 385: https://github.com/nedbat/coveragepy/issues/385 +.. _issue 386: https://github.com/nedbat/coveragepy/issues/386 +.. _issue 387: https://github.com/nedbat/coveragepy/issues/387 .. 40 issues closed in 4.0 below here @@ -1562,17 +1562,17 @@ Version 4.0a6 --- 2015-06-21 - Plugin support had some bugs fixed, closing `issue 374`_ and `issue 375`_. Thanks, Stefan Behnel. -.. _issue 299: https://bitbucket.org/ned/coveragepy/issues/299/inserted-created-on-yyyy-mm-dd-hh-mm-in -.. _issue 308: https://bitbucket.org/ned/coveragepy/issues/308/yield-lambda-branch-coverage -.. _issue 324: https://bitbucket.org/ned/coveragepy/issues/324/yield-in-loop-confuses-branch-coverage -.. _issue 351: https://bitbucket.org/ned/coveragepy/issues/351/files-with-incorrect-encoding-are-ignored -.. _issue 354: https://bitbucket.org/ned/coveragepy/issues/354/coverage-combine-should-take-a-list-of -.. _issue 359: https://bitbucket.org/ned/coveragepy/issues/359/xml-report-chunk-error -.. _issue 360: https://bitbucket.org/ned/coveragepy/issues/360/html-reports-get-confused-by-l-in-the-code -.. _issue 361: https://bitbucket.org/ned/coveragepy/issues/361/use-double-quotes-in-html-output-to -.. _issue 363: https://bitbucket.org/ned/coveragepy/issues/363/annotate-command-hits-unicode-happy-fun -.. _issue 374: https://bitbucket.org/ned/coveragepy/issues/374/c-tracer-lookups-fail-in -.. _issue 375: https://bitbucket.org/ned/coveragepy/issues/375/ctracer_handle_return-reads-byte-code +.. _issue 299: https://github.com/nedbat/coveragepy/issues/299 +.. _issue 308: https://github.com/nedbat/coveragepy/issues/308 +.. _issue 324: https://github.com/nedbat/coveragepy/issues/324 +.. _issue 351: https://github.com/nedbat/coveragepy/issues/351 +.. _issue 354: https://github.com/nedbat/coveragepy/issues/354 +.. _issue 359: https://github.com/nedbat/coveragepy/issues/359 +.. _issue 360: https://github.com/nedbat/coveragepy/issues/360 +.. _issue 361: https://github.com/nedbat/coveragepy/issues/361 +.. _issue 363: https://github.com/nedbat/coveragepy/issues/363 +.. _issue 374: https://github.com/nedbat/coveragepy/issues/374 +.. _issue 375: https://github.com/nedbat/coveragepy/issues/375 Version 4.0a5 --- 2015-02-16 @@ -1602,11 +1602,11 @@ Version 4.0a5 --- 2015-02-16 - Added 3.5.0a1 to the list of supported CPython versions. -.. _issue 117: https://bitbucket.org/ned/coveragepy/issues/117/enable-coverage-measurement-of-code-run-by -.. _issue 340: https://bitbucket.org/ned/coveragepy/issues/340/keyerror-subpy -.. _issue 353: https://bitbucket.org/ned/coveragepy/issues/353/40a3-introduces-an-unexpected-third-case -.. _issue 357: https://bitbucket.org/ned/coveragepy/issues/357/behavior-changed-when-coveragerc-is -.. _issue 358: https://bitbucket.org/ned/coveragepy/issues/358/all-coverage-commands-should-adjust +.. _issue 117: https://github.com/nedbat/coveragepy/issues/117 +.. _issue 340: https://github.com/nedbat/coveragepy/issues/340 +.. _issue 353: https://github.com/nedbat/coveragepy/issues/353 +.. _issue 357: https://github.com/nedbat/coveragepy/issues/357 +.. _issue 358: https://github.com/nedbat/coveragepy/issues/358 Version 4.0a4 --- 2015-01-25 @@ -1646,11 +1646,11 @@ Version 4.0a3 --- 2015-01-20 - Regexes in the configuration file are now compiled as soon as they are read, to provide error messages earlier (`issue 349`_). -.. _issue 69: https://bitbucket.org/ned/coveragepy/issues/69/coverage-html-overwrite-files-that-doesnt -.. _issue 235: https://bitbucket.org/ned/coveragepy/issues/235/package-name-is-missing-in-xml-report -.. _issue 290: https://bitbucket.org/ned/coveragepy/issues/290/running-programmatically-with-pyw-files -.. _issue 345: https://bitbucket.org/ned/coveragepy/issues/345/xml-reports-line-rate-0-for-empty-files -.. _issue 349: https://bitbucket.org/ned/coveragepy/issues/349/bad-regex-in-config-should-get-an-earlier +.. _issue 69: https://github.com/nedbat/coveragepy/issues/69 +.. _issue 235: https://github.com/nedbat/coveragepy/issues/235 +.. _issue 290: https://github.com/nedbat/coveragepy/issues/290 +.. _issue 345: https://github.com/nedbat/coveragepy/issues/345 +.. _issue 349: https://github.com/nedbat/coveragepy/issues/349 Version 4.0a2 --- 2015-01-14 @@ -1710,15 +1710,15 @@ Version 4.0a2 --- 2015-01-14 haven't changed is now a JSON file instead of a pickle file. This obviates `issue 287`_ and `issue 237`_. -.. _issue 237: https://bitbucket.org/ned/coveragepy/issues/237/htmlcov-with-corrupt-statusdat -.. _issue 287: https://bitbucket.org/ned/coveragepy/issues/287/htmlpy-doesnt-specify-pickle-protocol -.. _issue 293: https://bitbucket.org/ned/coveragepy/issues/293/number-of-statement-detection-wrong-if-no -.. _issue 314: https://bitbucket.org/ned/coveragepy/issues/314/fail_under-param-not-working-in-coveragerc -.. _issue 315: https://bitbucket.org/ned/coveragepy/issues/315/option-to-omit-empty-files-eg-__init__py -.. _issue 328: https://bitbucket.org/ned/coveragepy/issues/328/misbehavior-in-run-source -.. _issue 334: https://bitbucket.org/ned/coveragepy/issues/334/pragma-not-recognized-if-tab-character -.. _issue 342: https://bitbucket.org/ned/coveragepy/issues/342/console-and-html-coverage-reports-differ -.. _issue 343: https://bitbucket.org/ned/coveragepy/issues/343/an-explicitly-named-non-existent-config +.. _issue 237: https://github.com/nedbat/coveragepy/issues/237 +.. _issue 287: https://github.com/nedbat/coveragepy/issues/287 +.. _issue 293: https://github.com/nedbat/coveragepy/issues/293 +.. _issue 314: https://github.com/nedbat/coveragepy/issues/314 +.. _issue 315: https://github.com/nedbat/coveragepy/issues/315 +.. _issue 328: https://github.com/nedbat/coveragepy/issues/328 +.. _issue 334: https://github.com/nedbat/coveragepy/issues/334 +.. _issue 342: https://github.com/nedbat/coveragepy/issues/342 +.. _issue 343: https://github.com/nedbat/coveragepy/issues/343 Version 4.0a1 --- 2014-09-27 @@ -1763,16 +1763,16 @@ Version 4.0a1 --- 2014-09-27 - Encoding declarations in source files are only considered if they are truly comments. Thanks, Anthony Sottile. -.. _issue 57: https://bitbucket.org/ned/coveragepy/issues/57/annotate-command-fails-to-annotate-many -.. _issue 94: https://bitbucket.org/ned/coveragepy/issues/94/coverage-xml-doesnt-produce-sources -.. _issue 149: https://bitbucket.org/ned/coveragepy/issues/149/coverage-gevent-looks-broken -.. _issue 230: https://bitbucket.org/ned/coveragepy/issues/230/show-line-no-for-missing-branches-in -.. _issue 284: https://bitbucket.org/ned/coveragepy/issues/284/fail-under-should-show-more-precision -.. _issue 285: https://bitbucket.org/ned/coveragepy/issues/285/xml-report-fails-if-output-file-directory -.. _issue 303: https://bitbucket.org/ned/coveragepy/issues/303/unicodedecodeerror -.. _issue 304: https://bitbucket.org/ned/coveragepy/issues/304/attempt-to-get-configuration-from-setupcfg -.. _issue 305: https://bitbucket.org/ned/coveragepy/issues/305/pendingdeprecationwarning-the-imp-module -.. _issue 331: https://bitbucket.org/ned/coveragepy/issues/331/failure-of-encoding-detection-on-python2 +.. _issue 57: https://github.com/nedbat/coveragepy/issues/57 +.. _issue 94: https://github.com/nedbat/coveragepy/issues/94 +.. _issue 149: https://github.com/nedbat/coveragepy/issues/149 +.. _issue 230: https://github.com/nedbat/coveragepy/issues/230 +.. _issue 284: https://github.com/nedbat/coveragepy/issues/284 +.. _issue 285: https://github.com/nedbat/coveragepy/issues/285 +.. _issue 303: https://github.com/nedbat/coveragepy/issues/303 +.. _issue 304: https://github.com/nedbat/coveragepy/issues/304 +.. _issue 305: https://github.com/nedbat/coveragepy/issues/305 +.. _issue 331: https://github.com/nedbat/coveragepy/issues/331 .. _changes_371: @@ -1831,18 +1831,18 @@ Version 3.7 --- 2013-10-06 - The source kit now includes the ``__main__.py`` file in the root coverage directory, fixing `issue 255`_. -.. _issue 92: https://bitbucket.org/ned/coveragepy/issues/92/finally-clauses-arent-treated-properly-in -.. _issue 164: https://bitbucket.org/ned/coveragepy/issues/164/trace-function-changed-warning-when-using -.. _issue 175: https://bitbucket.org/ned/coveragepy/issues/175/branch-coverage-gets-confused-in-certain -.. _issue 207: https://bitbucket.org/ned/coveragepy/issues/207/run-m-cannot-find-module-or-package-in -.. _issue 242: https://bitbucket.org/ned/coveragepy/issues/242/running-a-two-level-package-doesnt-work -.. _issue 218: https://bitbucket.org/ned/coveragepy/issues/218/run-command-does-not-respect-the-omit-flag -.. _issue 250: https://bitbucket.org/ned/coveragepy/issues/250/uncaught-zerodivisionerror-when-generating -.. _issue 255: https://bitbucket.org/ned/coveragepy/issues/255/directory-level-__main__py-not-included-in -.. _issue 259: https://bitbucket.org/ned/coveragepy/issues/259/allow-use-of-system-installed-third-party -.. _issue 261: https://bitbucket.org/ned/coveragepy/issues/261/pyw-files-arent-reported-properly -.. _issue 264: https://bitbucket.org/ned/coveragepy/issues/264/coverage-wont-run-pyc-files -.. _issue 267: https://bitbucket.org/ned/coveragepy/issues/267/relative-path-aliases-dont-work +.. _issue 92: https://github.com/nedbat/coveragepy/issues/92 +.. _issue 164: https://github.com/nedbat/coveragepy/issues/164 +.. _issue 175: https://github.com/nedbat/coveragepy/issues/175 +.. _issue 207: https://github.com/nedbat/coveragepy/issues/207 +.. _issue 242: https://github.com/nedbat/coveragepy/issues/242 +.. _issue 218: https://github.com/nedbat/coveragepy/issues/218 +.. _issue 250: https://github.com/nedbat/coveragepy/issues/250 +.. _issue 255: https://github.com/nedbat/coveragepy/issues/255 +.. _issue 259: https://github.com/nedbat/coveragepy/issues/259 +.. _issue 261: https://github.com/nedbat/coveragepy/issues/261 +.. _issue 264: https://github.com/nedbat/coveragepy/issues/264 +.. _issue 267: https://github.com/nedbat/coveragepy/issues/267 .. _changes_36: @@ -1853,8 +1853,8 @@ Version 3.6 --- 2013-01-05 - Added a page to the docs about troublesome situations, closing `issue 226`_, and added some info to the TODO file, closing `issue 227`_. -.. _issue 226: https://bitbucket.org/ned/coveragepy/issues/226/make-readme-section-to-describe-when -.. _issue 227: https://bitbucket.org/ned/coveragepy/issues/227/update-todo +.. _issue 226: https://github.com/nedbat/coveragepy/issues/226 +.. _issue 227: https://github.com/nedbat/coveragepy/issues/227 Version 3.6b3 --- 2012-12-29 @@ -1862,7 +1862,7 @@ Version 3.6b3 --- 2012-12-29 - Beta 2 broke the nose plugin. It's fixed again, closing `issue 224`_. -.. _issue 224: https://bitbucket.org/ned/coveragepy/issues/224/36b2-breaks-nosexcover +.. _issue 224: https://github.com/nedbat/coveragepy/issues/224 Version 3.6b2 --- 2012-12-23 @@ -1882,7 +1882,7 @@ Version 3.6b2 --- 2012-12-23 file name, coverage.py no longer associates it with the directory name, fixing `issue 221`_. -.. _issue 221: https://bitbucket.org/ned/coveragepy/issues/221/coveragepy-incompatible-with-pyratemp +.. _issue 221: https://github.com/nedbat/coveragepy/issues/221 Version 3.6b1 --- 2012-11-28 @@ -1976,27 +1976,27 @@ Version 3.6b1 --- 2012-11-28 ``'NoneType' object has no attribute 'isabs'``. It no longer does, so kiss `issue 153`_ goodbye. -.. _issue 60: https://bitbucket.org/ned/coveragepy/issues/60/incorrect-path-to-orphaned-pyc-files -.. _issue 67: https://bitbucket.org/ned/coveragepy/issues/67/xml-report-filenames-may-be-generated -.. _issue 89: https://bitbucket.org/ned/coveragepy/issues/89/on-windows-all-packages-are-reported-in -.. _issue 97: https://bitbucket.org/ned/coveragepy/issues/97/allow-environment-variables-to-be -.. _issue 100: https://bitbucket.org/ned/coveragepy/issues/100/source-directive-doesnt-work-for-packages -.. _issue 111: https://bitbucket.org/ned/coveragepy/issues/111/when-installing-coverage-with-pip-not -.. _issue 137: https://bitbucket.org/ned/coveragepy/issues/137/provide-docs-with-source-distribution -.. _issue 139: https://bitbucket.org/ned/coveragepy/issues/139/easy-check-for-a-certain-coverage-in-tests -.. _issue 143: https://bitbucket.org/ned/coveragepy/issues/143/omit-doesnt-seem-to-work-in-coverage -.. _issue 153: https://bitbucket.org/ned/coveragepy/issues/153/non-existent-filename-triggers -.. _issue 156: https://bitbucket.org/ned/coveragepy/issues/156/a-completely-unexecuted-file-shows-14 -.. _issue 163: https://bitbucket.org/ned/coveragepy/issues/163/problem-with-include-and-omit-filename -.. _issue 171: https://bitbucket.org/ned/coveragepy/issues/171/how-to-contribute-and-run-tests -.. _issue 193: https://bitbucket.org/ned/coveragepy/issues/193/unicodedecodeerror-on-htmlpy -.. _issue 201: https://bitbucket.org/ned/coveragepy/issues/201/coverage-using-django-14-with-pydb-on -.. _issue 202: https://bitbucket.org/ned/coveragepy/issues/202/get-rid-of-ez_setuppy-and -.. _issue 203: https://bitbucket.org/ned/coveragepy/issues/203/duplicate-filenames-reported-when-filename -.. _issue 205: https://bitbucket.org/ned/coveragepy/issues/205/make-pydoc-coverage-more-friendly -.. _issue 206: https://bitbucket.org/ned/coveragepy/issues/206/pydoc-coveragecoverage-fails-with-an-error -.. _issue 210: https://bitbucket.org/ned/coveragepy/issues/210/if-theres-no-coverage-data-coverage-xml -.. _issue 214: https://bitbucket.org/ned/coveragepy/issues/214/coveragepy-measures-itself-on-precise +.. _issue 60: https://github.com/nedbat/coveragepy/issues/60 +.. _issue 67: https://github.com/nedbat/coveragepy/issues/67 +.. _issue 89: https://github.com/nedbat/coveragepy/issues/89 +.. _issue 97: https://github.com/nedbat/coveragepy/issues/97 +.. _issue 100: https://github.com/nedbat/coveragepy/issues/100 +.. _issue 111: https://github.com/nedbat/coveragepy/issues/111 +.. _issue 137: https://github.com/nedbat/coveragepy/issues/137 +.. _issue 139: https://github.com/nedbat/coveragepy/issues/139 +.. _issue 143: https://github.com/nedbat/coveragepy/issues/143 +.. _issue 153: https://github.com/nedbat/coveragepy/issues/153 +.. _issue 156: https://github.com/nedbat/coveragepy/issues/156 +.. _issue 163: https://github.com/nedbat/coveragepy/issues/163 +.. _issue 171: https://github.com/nedbat/coveragepy/issues/171 +.. _issue 193: https://github.com/nedbat/coveragepy/issues/193 +.. _issue 201: https://github.com/nedbat/coveragepy/issues/201 +.. _issue 202: https://github.com/nedbat/coveragepy/issues/202 +.. _issue 203: https://github.com/nedbat/coveragepy/issues/203 +.. _issue 205: https://github.com/nedbat/coveragepy/issues/205 +.. _issue 206: https://github.com/nedbat/coveragepy/issues/206 +.. _issue 210: https://github.com/nedbat/coveragepy/issues/210 +.. _issue 214: https://github.com/nedbat/coveragepy/issues/214 .. _changes_353: @@ -2031,12 +2031,12 @@ Version 3.5.3 --- 2012-09-29 - Testing is now done with `tox`_, thanks, Marc Abramowitz. -.. _issue 147: https://bitbucket.org/ned/coveragepy/issues/147/massive-memory-usage-by-ctracer -.. _issue 179: https://bitbucket.org/ned/coveragepy/issues/179/htmlreporter-fails-when-source-file-is -.. _issue 183: https://bitbucket.org/ned/coveragepy/issues/183/install-fails-for-python-23 -.. _issue 194: https://bitbucket.org/ned/coveragepy/issues/194/filelocatorrelative_filename-could-mangle -.. _issue 195: https://bitbucket.org/ned/coveragepy/issues/195/pyo-file-handling-in-codeunit -.. _issue 197: https://bitbucket.org/ned/coveragepy/issues/197/line-numbers-in-html-report-do-not-align +.. _issue 147: https://github.com/nedbat/coveragepy/issues/147 +.. _issue 179: https://github.com/nedbat/coveragepy/issues/179 +.. _issue 183: https://github.com/nedbat/coveragepy/issues/183 +.. _issue 194: https://github.com/nedbat/coveragepy/issues/194 +.. _issue 195: https://github.com/nedbat/coveragepy/issues/195 +.. _issue 197: https://github.com/nedbat/coveragepy/issues/197 .. _tox: https://tox.readthedocs.io/ @@ -2084,12 +2084,12 @@ Version 3.5.2b1 --- 2012-04-29 - When installing into pypy, we no longer attempt (and fail) to compile the C tracer function, closing `issue 166`_. -.. _issue 142: https://bitbucket.org/ned/coveragepy/issues/142/executing-python-file-syspath-is-replaced -.. _issue 155: https://bitbucket.org/ned/coveragepy/issues/155/cant-use-coverage-run-m-unittest-discover -.. _issue 157: https://bitbucket.org/ned/coveragepy/issues/157/chokes-on-source-files-with-non-utf-8 -.. _issue 166: https://bitbucket.org/ned/coveragepy/issues/166/dont-try-to-compile-c-extension-on-pypy -.. _issue 168: https://bitbucket.org/ned/coveragepy/issues/168/dont-be-alarmed-by-emacs-droppings -.. _issue 173: https://bitbucket.org/ned/coveragepy/issues/173/theres-no-way-to-specify-show-missing-in +.. _issue 142: https://github.com/nedbat/coveragepy/issues/142 +.. _issue 155: https://github.com/nedbat/coveragepy/issues/155 +.. _issue 157: https://github.com/nedbat/coveragepy/issues/157 +.. _issue 166: https://github.com/nedbat/coveragepy/issues/166 +.. _issue 168: https://github.com/nedbat/coveragepy/issues/168 +.. _issue 173: https://github.com/nedbat/coveragepy/issues/173 .. _changes_351: @@ -2133,12 +2133,12 @@ Version 3.5.1b1 --- 2011-08-28 into running some coverage.py code before anything else in the process. See the coverage/fullcoverage directory if you are interested. -.. _issue 17: https://bitbucket.org/ned/coveragepy/issues/17/support-combining-coverage-data-from -.. _issue 122: https://bitbucket.org/ned/coveragepy/issues/122/for-else-always-reports-missing-branch -.. _issue 124: https://bitbucket.org/ned/coveragepy/issues/124/no-arbitrary-unicode-in-html-reports-in -.. _issue 128: https://bitbucket.org/ned/coveragepy/issues/128/branch-coverage-of-with-statement-in-27 -.. _issue 138: https://bitbucket.org/ned/coveragepy/issues/138/include-should-take-precedence-over-is -.. _issue 144: https://bitbucket.org/ned/coveragepy/issues/144/failure-generating-html-output-for +.. _issue 17: https://github.com/nedbat/coveragepy/issues/17 +.. _issue 122: https://github.com/nedbat/coveragepy/issues/122 +.. _issue 124: https://github.com/nedbat/coveragepy/issues/124 +.. _issue 128: https://github.com/nedbat/coveragepy/issues/128 +.. _issue 138: https://github.com/nedbat/coveragepy/issues/138 +.. _issue 144: https://github.com/nedbat/coveragepy/issues/144 .. _changes_35: @@ -2220,15 +2220,15 @@ Version 3.5b1 --- 2011-06-05 - Internally, files are now closed explicitly, fixing `issue 104`_. Thanks, Brett Cannon. -.. _issue 80: https://bitbucket.org/ned/coveragepy/issues/80/is-there-a-duck-typing-way-to-know-we-cant -.. _issue 93: https://bitbucket.org/ned/coveragepy/issues/93/copying-a-mock-object-breaks-coverage -.. _issue 95: https://bitbucket.org/ned/coveragepy/issues/95/run-subcommand-should-take-a-module-name -.. _issue 104: https://bitbucket.org/ned/coveragepy/issues/104/explicitly-close-files -.. _issue 107: https://bitbucket.org/ned/coveragepy/issues/107/codeparser-not-opening-source-files-with -.. _issue 115: https://bitbucket.org/ned/coveragepy/issues/115/fail-gracefully-when-reporting-on-file -.. _issue 121: https://bitbucket.org/ned/coveragepy/issues/121/filename-patterns-are-applied-stupidly -.. _issue 123: https://bitbucket.org/ned/coveragepy/issues/123/pyeval_settrace-used-in-way-that-breaks -.. _issue 125: https://bitbucket.org/ned/coveragepy/issues/125/coverage-removes-decoratortoolss-tracing +.. _issue 80: https://github.com/nedbat/coveragepy/issues/80 +.. _issue 93: https://github.com/nedbat/coveragepy/issues/93 +.. _issue 95: https://github.com/nedbat/coveragepy/issues/95 +.. _issue 104: https://github.com/nedbat/coveragepy/issues/104 +.. _issue 107: https://github.com/nedbat/coveragepy/issues/107 +.. _issue 115: https://github.com/nedbat/coveragepy/issues/115 +.. _issue 121: https://github.com/nedbat/coveragepy/issues/121 +.. _issue 123: https://github.com/nedbat/coveragepy/issues/123 +.. _issue 125: https://github.com/nedbat/coveragepy/issues/125 .. _changes_34: @@ -2241,7 +2241,7 @@ Version 3.4 --- 2010-09-19 - Programs that exited with ``sys.exit()`` with no argument weren't handled properly, producing a coverage.py stack trace. That is now fixed. -.. _issue 88: https://bitbucket.org/ned/coveragepy/issues/88/xml-report-lists-packages-in-random-order +.. _issue 88: https://github.com/nedbat/coveragepy/issues/88 Version 3.4b2 --- 2010-09-06 @@ -2266,12 +2266,12 @@ Version 3.4b2 --- 2010-09-06 would report no coverage for the `run` method. This is now fixed, closing `issue 85`_. -.. _issue 16: https://bitbucket.org/ned/coveragepy/issues/16/allow-configuration-of-accuracy-of-percentage-totals -.. _issue 41: https://bitbucket.org/ned/coveragepy/issues/41/report-says-100-when-it-isnt-quite-there -.. _issue 65: https://bitbucket.org/ned/coveragepy/issues/65/branch-option-not-reported-in-cobertura -.. _issue 70: https://bitbucket.org/ned/coveragepy/issues/70/text-report-and-html-report-disagree-on-coverage -.. _issue 81: https://bitbucket.org/ned/coveragepy/issues/81/xml-report-does-not-have-condition-coverage-attribute-for-lines-with-a -.. _issue 85: https://bitbucket.org/ned/coveragepy/issues/85/threadrun-isnt-measured +.. _issue 16: https://github.com/nedbat/coveragepy/issues/16 +.. _issue 41: https://github.com/nedbat/coveragepy/issues/41 +.. _issue 65: https://github.com/nedbat/coveragepy/issues/65 +.. _issue 70: https://github.com/nedbat/coveragepy/issues/70 +.. _issue 81: https://github.com/nedbat/coveragepy/issues/81 +.. _issue 85: https://github.com/nedbat/coveragepy/issues/85 Version 3.4b1 --- 2010-08-21 @@ -2347,17 +2347,17 @@ Version 3.4b1 --- 2010-08-21 - Asking for an HTML report with no files now shows a nice error message rather than a cryptic failure ('int' object is unsubscriptable). Fixes `issue 59`_. -.. _issue 1: https://bitbucket.org/ned/coveragepy/issues/1/empty-__init__py-files-are-reported-as-1-executable -.. _issue 34: https://bitbucket.org/ned/coveragepy/issues/34/enhanced-omit-globbing-handling -.. _issue 36: https://bitbucket.org/ned/coveragepy/issues/36/provide-regex-style-omit -.. _issue 46: https://bitbucket.org/ned/coveragepy/issues/46 -.. _issue 53: https://bitbucket.org/ned/coveragepy/issues/53 -.. _issue 52: https://bitbucket.org/ned/coveragepy/issues/52/doctesttestfile-confuses-source-detection -.. _issue 56: https://bitbucket.org/ned/coveragepy/issues/56 -.. _issue 61: https://bitbucket.org/ned/coveragepy/issues/61/annotate-i-doesnt-work -.. _issue 62: https://bitbucket.org/ned/coveragepy/issues/62 -.. _issue 59: https://bitbucket.org/ned/coveragepy/issues/59/html-report-fails-with-int-object-is -.. _issue 82: https://bitbucket.org/ned/coveragepy/issues/82/tokenerror-when-generating-html-report +.. _issue 1: https://github.com/nedbat/coveragepy/issues/1 +.. _issue 34: https://github.com/nedbat/coveragepy/issues/34 +.. _issue 36: https://github.com/nedbat/coveragepy/issues/36 +.. _issue 46: https://github.com/nedbat/coveragepy/issues/46 +.. _issue 53: https://github.com/nedbat/coveragepy/issues/53 +.. _issue 52: https://github.com/nedbat/coveragepy/issues/52 +.. _issue 56: https://github.com/nedbat/coveragepy/issues/56 +.. _issue 61: https://github.com/nedbat/coveragepy/issues/61 +.. _issue 62: https://github.com/nedbat/coveragepy/issues/62 +.. _issue 59: https://github.com/nedbat/coveragepy/issues/59 +.. _issue 82: https://github.com/nedbat/coveragepy/issues/82 .. _changes_331: @@ -2371,8 +2371,8 @@ Version 3.3.1 --- 2010-03-06 - When running your code with "coverage run", if you call `sys.exit()`, coverage.py will exit with that status code, fixing `issue 50`_. -.. _issue 49: https://bitbucket.org/ned/coveragepy/issues/49 -.. _issue 50: https://bitbucket.org/ned/coveragepy/issues/50 +.. _issue 49: https://github.com/nedbat/coveragepy/issues/49 +.. _issue 50: https://github.com/nedbat/coveragepy/issues/50 .. _changes_33: @@ -2411,9 +2411,9 @@ Version 3.3 --- 2010-02-24 - Added an AUTHORS.txt file. -.. _issue 39: https://bitbucket.org/ned/coveragepy/issues/39 -.. _issue 40: https://bitbucket.org/ned/coveragepy/issues/40 -.. _issue 47: https://bitbucket.org/ned/coveragepy/issues/47 +.. _issue 39: https://github.com/nedbat/coveragepy/issues/39 +.. _issue 40: https://github.com/nedbat/coveragepy/issues/40 +.. _issue 47: https://github.com/nedbat/coveragepy/issues/47 .. _changes_32: @@ -2471,12 +2471,12 @@ Version 3.2b2 --- 2009-11-19 - The --omit option now works much better than before, fixing `issue 14`_ and `issue 33`_. Thanks, Danek Duvall. -.. _issue 14: https://bitbucket.org/ned/coveragepy/issues/14 -.. _issue 30: https://bitbucket.org/ned/coveragepy/issues/30 -.. _issue 31: https://bitbucket.org/ned/coveragepy/issues/31 -.. _issue 32: https://bitbucket.org/ned/coveragepy/issues/32 -.. _issue 33: https://bitbucket.org/ned/coveragepy/issues/33 -.. _issue 35: https://bitbucket.org/ned/coveragepy/issues/35 +.. _issue 14: https://github.com/nedbat/coveragepy/issues/14 +.. _issue 30: https://github.com/nedbat/coveragepy/issues/30 +.. _issue 31: https://github.com/nedbat/coveragepy/issues/31 +.. _issue 32: https://github.com/nedbat/coveragepy/issues/32 +.. _issue 33: https://github.com/nedbat/coveragepy/issues/33 +.. _issue 35: https://github.com/nedbat/coveragepy/issues/35 Version 3.2b1 --- 2009-11-10 @@ -2491,7 +2491,7 @@ Version 3.2b1 --- 2009-11-10 - Some exceptions reported by the command line interface have been cleaned up so that tracebacks inside coverage.py aren't shown. Fixes `issue 23`_. -.. _issue 23: https://bitbucket.org/ned/coveragepy/issues/23 +.. _issue 23: https://github.com/nedbat/coveragepy/issues/23 .. _changes_31: @@ -2502,7 +2502,7 @@ Version 3.1 --- 2009-10-04 - Source code can now be read from eggs. Thanks, Ross Lawley. Fixes `issue 25`_. -.. _issue 25: https://bitbucket.org/ned/coveragepy/issues/25 +.. _issue 25: https://github.com/nedbat/coveragepy/issues/25 Version 3.1b1 --- 2009-09-27 @@ -2532,10 +2532,10 @@ Version 3.1b1 --- 2009-09-27 - Added a "coverage debug" command for getting diagnostic information about the coverage.py installation. -.. _issue 11: https://bitbucket.org/ned/coveragepy/issues/11 -.. _issue 12: https://bitbucket.org/ned/coveragepy/issues/12 -.. _issue 13: https://bitbucket.org/ned/coveragepy/issues/13 -.. _issue 24: https://bitbucket.org/ned/coveragepy/issues/24 +.. _issue 11: https://github.com/nedbat/coveragepy/issues/11 +.. _issue 12: https://github.com/nedbat/coveragepy/issues/12 +.. _issue 13: https://github.com/nedbat/coveragepy/issues/13 +.. _issue 24: https://github.com/nedbat/coveragepy/issues/24 .. _changes_301: @@ -2560,9 +2560,9 @@ Version 3.0.1 --- 2009-07-07 mode just like Python does. This lets it run Windows files on Mac, for example. -.. _issue 9: https://bitbucket.org/ned/coveragepy/issues/9 -.. _issue 10: https://bitbucket.org/ned/coveragepy/issues/10 -.. _issue 8: https://bitbucket.org/ned/coveragepy/issues/8 +.. _issue 9: https://github.com/nedbat/coveragepy/issues/9 +.. _issue 10: https://github.com/nedbat/coveragepy/issues/10 +.. _issue 8: https://github.com/nedbat/coveragepy/issues/8 .. _changes_30: @@ -2578,7 +2578,7 @@ Version 3.0 --- 2009-06-13 - Nested modules now get a proper flat_rootname. Thanks, Christian Heimes. -.. _issue 6: https://bitbucket.org/ned/coveragepy/issues/6 +.. _issue 6: https://github.com/nedbat/coveragepy/issues/6 Version 3.0b3 --- 2009-05-16 diff --git a/doc/plugins.rst b/doc/plugins.rst index 38990d946..fae4f73be 100644 --- a/doc/plugins.rst +++ b/doc/plugins.rst @@ -74,4 +74,4 @@ Some coverage.py plug-ins you might find useful: * `Mako template coverage plug-in`__: for measuring coverage in Mako templates. Doesn't work yet, probably needs some changes in Mako itself. - .. __: https://bitbucket.org/ned/coverage-mako-plugin + .. __: https://bitbucket-archive.softwareheritage.org/projects/ne/ned/coverage-mako-plugin.html diff --git a/doc/trouble.rst b/doc/trouble.rst index 08f8a4d3c..d508fd607 100644 --- a/doc/trouble.rst +++ b/doc/trouble.rst @@ -46,7 +46,7 @@ coverage.py from working properly: .. _sys.settrace: https://docs.python.org/3/library/sys.html#sys.settrace .. _thread: https://docs.python.org/3/library/_thread.html .. _threading: https://docs.python.org/3/library/threading.html -.. _issue 43: https://bitbucket.org/ned/coveragepy/issues/43/coverage-measurement-fails-on-code +.. _issue 43: https://github.com/nedbat/coveragepy/issues/43 Still having trouble? diff --git a/doc/whatsnew5x.rst b/doc/whatsnew5x.rst index 5f21a5d47..674ddcb14 100644 --- a/doc/whatsnew5x.rst +++ b/doc/whatsnew5x.rst @@ -111,7 +111,7 @@ New Features .. _TOML: https://github.com/toml-lang/toml#readme -.. _issue 650: https://bitbucket.org/ned/coveragepy/issues/650/allow-setting-configuration-file-location +.. _issue 650: https://github.com/nedbat/coveragepy/issues/650 Bugs Fixed From 804d88e30073e4b04ed61ffcd6daa8614f534d69 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2020 20:02:54 -0400 Subject: [PATCH 17/77] A better way to fix sphinx-tabs --- doc/conf.py | 3 +++ doc/requirements.pip | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index d2a787dc5..a5365bf03 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -232,6 +232,9 @@ r"https://coverage.readthedocs.io/en/coverage-{}$".format(release), ] +# https://github.com/executablebooks/sphinx-tabs/pull/54 +sphinx_tabs_valid_builders = ['linkcheck'] + # When auto-doc'ing a class, only write the class' docstring into the class docs, # don't automatically include the __init__ docstring. autoclass_content = "class" diff --git a/doc/requirements.pip b/doc/requirements.pip index b8a55afdb..a984af305 100644 --- a/doc/requirements.pip +++ b/doc/requirements.pip @@ -9,5 +9,4 @@ sphinx-rst-builder==0.0.3 sphinxcontrib-spelling==5.1.2 sphinx_rtd_theme==0.5.0 sphinx-autobuild==0.7.1 -# Our own fork that allows linkcheck to work: -git+https://github.com/nedbat/sphinx-tabs.git@master#egg=sphinx-tabs +sphinx-tabs==1.2.0 From 7cf317f4c0e25acf671e4d633a93d7648d5d219e Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2020 20:18:38 -0400 Subject: [PATCH 18/77] More bitbucket->github urls --- coverage/control.py | 3 +-- perf/bug397.py | 3 +-- tests/test_api.py | 6 +++--- tests/test_arcs.py | 12 ++++++------ tests/test_cmdline.py | 2 +- tests/test_concurrency.py | 3 +-- tests/test_coverage.py | 2 +- tests/test_data.py | 4 ++-- tests/test_files.py | 6 +++--- tests/test_html.py | 10 +++++----- tests/test_oddball.py | 14 +++++++------- tests/test_parser.py | 4 ++-- tests/test_process.py | 20 ++++++++++---------- tests/test_summary.py | 8 ++++---- tests/test_xml.py | 16 ++++++++-------- 15 files changed, 55 insertions(+), 58 deletions(-) diff --git a/coverage/control.py b/coverage/control.py index cc0c271ac..d60db2126 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -1095,8 +1095,7 @@ def process_startup(): # flag (an attribute on this function) to indicate that coverage.py has # already been started, so we can avoid doing it twice. # - # https://bitbucket.org/ned/coveragepy/issue/340/keyerror-subpy has more - # details. + # https://github.com/nedbat/coveragepy/issues/340 has more details. if hasattr(process_startup, "coverage"): # We've annotated this function before, so we must have already diff --git a/perf/bug397.py b/perf/bug397.py index 4d72e908c..390741e56 100644 --- a/perf/bug397.py +++ b/perf/bug397.py @@ -7,8 +7,7 @@ $ coverage run lab/bug397.py fast Runtime per example: 131.34 +/- 4.48 us -Written by David MacIver as part of -https://bitbucket.org/ned/coveragepy/issues/397/stopping-and-resuming-coverage-with +Written by David MacIver as part of https://github.com/nedbat/coveragepy/issues/397 """ from __future__ import print_function diff --git a/tests/test_api.py b/tests/test_api.py index 8ab57955e..5ede9158b 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -564,7 +564,7 @@ def test_warn_once(self): self.assertNotIn("Warning, warning 2!", err) def test_source_and_include_dont_conflict(self): - # A bad fix made this case fail: https://bitbucket.org/ned/coveragepy/issues/541 + # A bad fix made this case fail: https://github.com/nedbat/coveragepy/issues/541 self.make_file("a.py", "import b\na = 1") self.make_file("b.py", "b = 1") self.make_file(".coveragerc", """\ @@ -907,7 +907,7 @@ def test_source_package_dotted(self): self.filenames_not_in(lines, "p1a p1c p2a p2b othera otherb osa osb") def test_source_package_part_omitted(self): - # https://bitbucket.org/ned/coveragepy/issue/218 + # https://github.com/nedbat/coveragepy/issues/218 # Used to be if you omitted something executed and inside the source, # then after it was executed but not recorded, it would be found in # the search for unexecuted files, and given a score of 0%. @@ -920,7 +920,7 @@ def test_source_package_part_omitted(self): self.assertEqual(lines['p1c'], 0) def test_source_package_as_package_part_omitted(self): - # https://bitbucket.org/ned/coveragepy/issues/638/run-omit-is-ignored-since-45 + # https://github.com/nedbat/coveragepy/issues/638 lines = self.coverage_usepkgs(source=["pkg1"], omit=["*/p1b.py"]) self.filenames_in(lines, "p1a") self.filenames_not_in(lines, "p1b") diff --git a/tests/test_arcs.py b/tests/test_arcs.py index a02e9f7d1..c16f3fa7e 100644 --- a/tests/test_arcs.py +++ b/tests/test_arcs.py @@ -173,7 +173,7 @@ def example(): ) def test_bug_146(self): - # https://bitbucket.org/ned/coveragepy/issue/146 + # https://github.com/nedbat/coveragepy/issues/146 self.check_coverage("""\ for i in range(2): with open("test", "w") as f: @@ -284,7 +284,7 @@ def test_while_true(self): ) def test_zero_coverage_while_loop(self): - # https://bitbucket.org/ned/coveragepy/issue/502 + # https://github.com/nedbat/coveragepy/issues/502 self.make_file("main.py", "print('done')") self.make_file("zero.py", """\ def method(self): @@ -303,7 +303,7 @@ def method(self): self.assertIn(expected, squeezed[3]) def test_bug_496_continue_in_constant_while(self): - # https://bitbucket.org/ned/coveragepy/issue/496 + # https://github.com/nedbat/coveragepy/issues/496 # A continue in a while-true needs to jump to the right place. if env.PYBEHAVIOR.nix_while_true: arcz = ".1 13 34 45 53 46 67 7." @@ -1066,7 +1066,7 @@ def gen(inp): ) def test_abandoned_yield(self): - # https://bitbucket.org/ned/coveragepy/issue/440 + # https://github.com/nedbat/coveragepy/issues/440 self.check_coverage("""\ def gen(): print("yup") @@ -1256,7 +1256,7 @@ def test_unpacked_literals(self): ) def test_pathologically_long_code_object(self): - # https://bitbucket.org/ned/coveragepy/issue/359 + # https://github.com/nedbat/coveragepy/issues/359 # The structure of this file is such that an EXTENDED_ARG bytecode is # needed to encode the jump at the end. We weren't interpreting those # opcodes. @@ -1278,7 +1278,7 @@ def test_pathologically_long_code_object(self): self.assertEqual(self.stdout().split()[-1], str(n)) def test_partial_generators(self): - # https://bitbucket.org/ned/coveragepy/issues/475/generator-expression-is-marked-as-not + # https://github.com/nedbat/coveragepy/issues/475 # Line 2 is executed completely. # Line 3 is started but not finished, because zip ends before it finishes. # Line 4 is never started. diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py index cdf8e56f1..374adb0de 100644 --- a/tests/test_cmdline.py +++ b/tests/test_cmdline.py @@ -236,7 +236,7 @@ def test_combine(self): """) def test_combine_doesnt_confuse_options_with_args(self): - # https://bitbucket.org/ned/coveragepy/issues/385/coverage-combine-doesnt-work-with-rcfile + # https://github.com/nedbat/coveragepy/issues/385 self.cmd_executes("combine --rcfile cov.ini", """\ cov = Coverage(config_file='cov.ini') cov.combine(None, strict=True) diff --git a/tests/test_concurrency.py b/tests/test_concurrency.py index 9bfd88caf..7109f1707 100644 --- a/tests/test_concurrency.py +++ b/tests/test_concurrency.py @@ -545,8 +545,7 @@ def run_thread(): # pragma: nested def test_thread_safe_save_data(tmpdir): - # Non-regression test for: - # https://bitbucket.org/ned/coveragepy/issues/581 + # Non-regression test for: https://github.com/nedbat/coveragepy/issues/581 # Create some Python modules and put them in the path modules_dir = tmpdir.mkdir('test_modules') diff --git a/tests/test_coverage.py b/tests/test_coverage.py index 1b23f4081..02b577e52 100644 --- a/tests/test_coverage.py +++ b/tests/test_coverage.py @@ -1576,7 +1576,7 @@ def test_excludes_non_ascii(self): ) def test_formfeed(self): - # https://bitbucket.org/ned/coveragepy/issues/461/multiline-asserts-need-too-many-pragma + # https://github.com/nedbat/coveragepy/issues/461 self.check_coverage("""\ x = 1 assert len([]) == 0, ( diff --git a/tests/test_data.py b/tests/test_data.py index d058388c3..b3ac718e1 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -443,7 +443,7 @@ def test_add_to_hash_with_arcs(self): ]) def test_add_to_lines_hash_with_missing_file(self): - # https://bitbucket.org/ned/coveragepy/issues/403 + # https://github.com/nedbat/coveragepy/issues/403 covdata = CoverageData() covdata.add_lines(LINES_1) hasher = mock.Mock() @@ -454,7 +454,7 @@ def test_add_to_lines_hash_with_missing_file(self): ]) def test_add_to_arcs_hash_with_missing_file(self): - # https://bitbucket.org/ned/coveragepy/issues/403 + # https://github.com/nedbat/coveragepy/issues/403 covdata = CoverageData() covdata.add_arcs(ARCS_3) covdata.add_file_tracers({"y.py": "hologram_plugin"}) diff --git a/tests/test_files.py b/tests/test_files.py index 1aeacb517..a84ef61d1 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -47,7 +47,7 @@ def test_peer_directories(self): self.assertEqual(files.relative_filename(a2), a2) def test_filepath_contains_absolute_prefix_twice(self): - # https://bitbucket.org/ned/coveragepy/issue/194 + # https://github.com/nedbat/coveragepy/issues/194 # Build a path that has two pieces matching the absolute path prefix. # Technically, this test doesn't do that on Windows, but drive # letters make that impractical to achieve. @@ -309,7 +309,7 @@ def test_paths_are_os_corrected(self): self.assert_mapped(aliases, r'/home/ned/foo/src/sub/a.py', r'.\mysrc\sub\a.py') def test_windows_on_linux(self): - # https://bitbucket.org/ned/coveragepy/issues/618/problem-when-combining-windows-generated + # https://github.com/nedbat/coveragepy/issues/618 lin = "*/project/module/" win = "*\\project\\module\\" @@ -325,7 +325,7 @@ def test_windows_on_linux(self): ) def test_linux_on_windows(self): - # https://bitbucket.org/ned/coveragepy/issues/618/problem-when-combining-windows-generated + # https://github.com/nedbat/coveragepy/issues/618 lin = "*/project/module/" win = "*\\project\\module\\" diff --git a/tests/test_html.py b/tests/test_html.py index 6f22acc01..12012b6a6 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -408,7 +408,7 @@ def test_execed_liar_ignored_indentation_error(self): self.assert_exists("htmlcov/index.html") def test_decode_error(self): - # https://bitbucket.org/ned/coveragepy/issue/351/files-with-incorrect-encoding-are-ignored + # https://github.com/nedbat/coveragepy/issues/351 # imp.load_module won't load a file with an undecodable character # in a comment, though Python will run them. So we'll change the # file after running. @@ -437,7 +437,7 @@ def test_decode_error(self): self.assertIn(expected, html_report) def test_formfeeds(self): - # https://bitbucket.org/ned/coveragepy/issue/360/html-reports-get-confused-by-l-in-the-code + # https://github.com/nedbat/coveragepy/issues/360 self.make_file("formfeed.py", "line_one = 1\n\f\nline_two = 2\n") cov = coverage.Coverage() self.start_import_stop(cov, "formfeed") @@ -451,7 +451,7 @@ class HtmlTest(HtmlTestHelpers, CoverageTest): """Moar HTML tests.""" def test_missing_source_file_incorrect_message(self): - # https://bitbucket.org/ned/coveragepy/issue/60 + # https://github.com/nedbat/coveragepy/issues/60 self.make_file("thefile.py", "import sub.another\n") self.make_file("sub/__init__.py", "") self.make_file("sub/another.py", "print('another')\n") @@ -468,7 +468,7 @@ def test_missing_source_file_incorrect_message(self): def test_extensionless_file_collides_with_extension(self): # It used to be that "program" and "program.py" would both be reported # to "program.html". Now they are not. - # https://bitbucket.org/ned/coveragepy/issue/69 + # https://github.com/nedbat/coveragepy/issues/69 self.make_file("program", "import program\n") self.make_file("program.py", "a = 1\n") self.run_command("coverage run program") @@ -488,7 +488,7 @@ def test_has_date_stamp_in_files(self): def test_reporting_on_unmeasured_file(self): # It should be ok to ask for an HTML report on a file that wasn't even - # measured at all. https://bitbucket.org/ned/coveragepy/issues/403 + # measured at all. https://github.com/nedbat/coveragepy/issues/403 self.create_initial_files() self.make_file("other.py", "a = 1\n") self.run_coverage(htmlargs=dict(morfs=['other.py'])) diff --git a/tests/test_oddball.py b/tests/test_oddball.py index 90b922497..17f696477 100644 --- a/tests/test_oddball.py +++ b/tests/test_oddball.py @@ -94,7 +94,7 @@ def recur(n): ) def test_long_recursion_recovery(self): - # Test the core of bug 93: https://bitbucket.org/ned/coveragepy/issue/93 + # Test the core of bug 93: https://github.com/nedbat/coveragepy/issues/93 # When recovering from a stack overflow, the Python trace function is # disabled, but the C trace function is not. So if we're using a # Python trace function, we won't trace anything after the stack @@ -141,7 +141,7 @@ class MemoryLeakTest(CoverageTest): """Attempt the impossible: test that memory doesn't leak. Note: this test is truly unusual, and has had a colorful history. See - for example: https://bitbucket.org/ned/coveragepy/issue/186 + for example: https://github.com/nedbat/coveragepy/issues/186 It may still fail occasionally, especially on PyPy. @@ -276,7 +276,7 @@ def foo(): self.assertEqual(missing, []) # Make sure pyexpat isn't recorded as a source file. - # https://bitbucket.org/ned/coveragepy/issues/419/nosource-no-source-for-code-path-to-c + # https://github.com/nedbat/coveragepy/issues/419 files = cov.get_data().measured_files() self.assertFalse( any(f.endswith("pyexpat.c") for f in files), @@ -425,7 +425,7 @@ def return_arg_or_void(arg): class GettraceTest(CoverageTest): """Tests that we work properly with `sys.gettrace()`.""" def test_round_trip_in_untraced_function(self): - # https://bitbucket.org/ned/coveragepy/issues/575/running-doctest-prevents-complete-coverage + # https://github.com/nedbat/coveragepy/issues/575 self.make_file("main.py", """import sample""") self.make_file("sample.py", """\ from swap import swap_it @@ -458,7 +458,7 @@ def swap_it(): self.assertEqual(missing, []) def test_setting_new_trace_function(self): - # https://bitbucket.org/ned/coveragepy/issues/436/disabled-coverage-ctracer-may-rise-from + # https://github.com/nedbat/coveragepy/issues/436 self.check_coverage('''\ import sys @@ -535,7 +535,7 @@ def show_trace_function(): class ExecTest(CoverageTest): """Tests of exec.""" def test_correct_filename(self): - # https://bitbucket.org/ned/coveragepy/issues/380/code-executed-by-exec-excluded-from + # https://github.com/nedbat/coveragepy/issues/380 # Bug was that exec'd files would have their lines attributed to the # calling file. Make two files, both with ~30 lines, but no lines in # common. Line 30 in to_exec.py was recorded as line 30 in main.py, @@ -579,7 +579,7 @@ def test_unencodable_filename(self): class MockingProtectionTest(CoverageTest): """Tests about protecting ourselves from aggressive mocking. - https://bitbucket.org/ned/coveragepy/issues/416/coverage-40-is-causing-existing-unit-tests + https://github.com/nedbat/coveragepy/issues/416 """ def test_os_path_exists(self): diff --git a/tests/test_parser.py b/tests/test_parser.py index a8da45cf8..03bf25de3 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -45,7 +45,7 @@ class Bar: }) def test_generator_exit_counts(self): - # https://bitbucket.org/ned/coveragepy/issue/324/yield-in-loop-confuses-branch-coverage + # https://github.com/nedbat/coveragepy/issues/324 parser = self.parse_source("""\ def gen(input): for n in inp: @@ -453,7 +453,7 @@ def test_encoding(self): def test_missing_line_ending(self): # Test that the set of statements is the same even if a final # multi-line statement has no final newline. - # https://bitbucket.org/ned/coveragepy/issue/293 + # https://github.com/nedbat/coveragepy/issues/293 self.make_file("normal.py", """\ out, err = subprocess.Popen( diff --git a/tests/test_process.py b/tests/test_process.py index 8f8b009c3..25f1fcc9d 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -146,7 +146,7 @@ def test_combine_parallel_data_with_a_corrupt_file(self): self.assertEqual(line_counts(data)['b_or_c.py'], 8) def test_combine_no_usable_files(self): - # https://bitbucket.org/ned/coveragepy/issues/629/multiple-use-of-combine-leads-to-empty + # https://github.com/nedbat/coveragepy/issues/629 self.make_b_or_c_py() out = self.run_command("coverage run b_or_c.py b") self.assertEqual(out, 'done\n') @@ -595,7 +595,7 @@ def test_warns_if_never_run(self): self.assertNotIn("Exception", out) def test_warnings_trace_function_changed_with_threads(self): - # https://bitbucket.org/ned/coveragepy/issue/164 + # https://github.com/nedbat/coveragepy/issues/164 if env.METACOV: self.skipTest("Can't test tracers changing during metacoverage") @@ -754,7 +754,7 @@ def test_lang_c(self): # failures with non-ascii file names. We don't want to make a real file # with strange characters, though, because that gets the test runners # tangled up. This will isolate the concerns to the coverage.py code. - # https://bitbucket.org/ned/coveragepy/issues/533/exception-on-unencodable-file-name + # https://github.com/nedbat/coveragepy/issues/533 self.make_file("weird_file.py", r""" globs = {} code = "a = 1\nb = 2\n" @@ -768,7 +768,7 @@ def test_lang_c(self): def test_deprecation_warnings(self): # Test that coverage doesn't trigger deprecation warnings. - # https://bitbucket.org/ned/coveragepy/issue/305/pendingdeprecationwarning-the-imp-module + # https://github.com/nedbat/coveragepy/issues/305 self.make_file("allok.py", """\ import warnings warnings.simplefilter('default') @@ -784,7 +784,7 @@ def test_deprecation_warnings(self): self.assertEqual(out, "No warnings!\n") def test_run_twice(self): - # https://bitbucket.org/ned/coveragepy/issue/353/40a3-introduces-an-unexpected-third-case + # https://github.com/nedbat/coveragepy/issues/353 self.make_file("foo.py", """\ def foo(): pass @@ -812,7 +812,7 @@ def foo(): ) def test_module_name(self): - # https://bitbucket.org/ned/coveragepy/issues/478/help-shows-silly-program-name-when-running + # https://github.com/nedbat/coveragepy/issues/478 out = self.run_command("python -m coverage") self.assertIn("Use 'coverage help' for help", out) @@ -957,7 +957,7 @@ def test_coverage_run_script_imports_doubledashsource(self): self.assertEqual(self.line_count(out), 6, out) def test_coverage_run_dashm_is_like_python_dashm_off_path(self): - # https://bitbucket.org/ned/coveragepy/issue/242 + # https://github.com/nedbat/coveragepy/issues/242 self.make_file("sub/__init__.py", "") with open(TRY_EXECFILE) as f: self.make_file("sub/run_me.py", f.read()) @@ -967,7 +967,7 @@ def test_coverage_run_dashm_is_like_python_dashm_off_path(self): self.assert_tryexecfile_output(expected, actual) def test_coverage_run_dashm_is_like_python_dashm_with__main__207(self): - # https://bitbucket.org/ned/coveragepy/issue/207 + # https://github.com/nedbat/coveragepy/issues/207 self.make_file("package/__init__.py", "print('init')") self.make_file("package/__main__.py", "print('main')") expected = self.run_command("python -m package") @@ -1404,7 +1404,7 @@ def possible_pth_dirs(): yield pth_dir # If we're still looking, then try the Python library directory. - # https://bitbucket.org/ned/coveragepy/issue/339/pth-test-malfunctions + # https://github.com/nedbat/coveragepy/issues/339 yield sysconfig.get_python_lib() # pragma: cant happen @@ -1505,7 +1505,7 @@ def test_subprocess_with_pth_files(self): # pragma: no metacov self.assertEqual(line_counts(data)['sub.py'], 3) def test_subprocess_with_pth_files_and_parallel(self): # pragma: no metacov - # https://bitbucket.org/ned/coveragepy/issues/492/subprocess-coverage-strange-detection-of + # https://github.com/nedbat/coveragepy/issues/492 if env.METACOV: self.skipTest("Can't test sub-process pth file suppport during metacoverage") diff --git a/tests/test_summary.py b/tests/test_summary.py index 9513d1599..eb25a4d80 100644 --- a/tests/test_summary.py +++ b/tests/test_summary.py @@ -131,7 +131,7 @@ def test_report_including(self): self.assertEqual(self.last_line_squeezed(report), "mycode.py 4 0 100%") def test_run_source_vs_report_include(self): - # https://bitbucket.org/ned/coveragepy/issues/621/include-ignored-warning-when-using + # https://github.com/nedbat/coveragepy/issues/621 self.make_file(".coveragerc", """\ [run] source = . @@ -146,7 +146,7 @@ def test_run_source_vs_report_include(self): cov.stop() # pragma: nested def test_run_omit_vs_report_omit(self): - # https://bitbucket.org/ned/coveragepy/issues/622/report-omit-overwrites-run-omit + # https://github.com/nedbat/coveragepy/issues/622 # report:omit shouldn't clobber run:omit. self.make_mycode() self.make_file(".coveragerc", """\ @@ -646,7 +646,7 @@ def get_report(self, cov): return report def test_bug_156_file_not_run_should_be_zero(self): - # https://bitbucket.org/ned/coveragepy/issue/156 + # https://github.com/nedbat/coveragepy/issues/156 self.make_file("mybranch.py", """\ def branch(x): if x: @@ -693,7 +693,7 @@ def test_pyw_files(self): if not env.WINDOWS: self.skipTest(".pyw files are only on Windows.") - # https://bitbucket.org/ned/coveragepy/issue/261 + # https://github.com/nedbat/coveragepy/issues/261 self.make_file("start.pyw", """\ import mod print("In start.pyw") diff --git a/tests/test_xml.py b/tests/test_xml.py index 8c3995947..e3be7a543 100644 --- a/tests/test_xml.py +++ b/tests/test_xml.py @@ -124,13 +124,13 @@ def test_config_affects_xml_placement(self): self.assert_exists("xml.out") def test_no_data(self): - # https://bitbucket.org/ned/coveragepy/issue/210 + # https://github.com/nedbat/coveragepy/issues/210 self.run_command("coverage xml") self.assert_doesnt_exist("coverage.xml") def test_no_source(self): # Written while investigating a bug, might as well keep it. - # https://bitbucket.org/ned/coveragepy/issue/208 + # https://github.com/nedbat/coveragepy/issues/208 self.make_file("innocuous.py", "a = 4") cov = coverage.Coverage() self.start_import_stop(cov, "innocuous") @@ -165,7 +165,7 @@ def test_filename_format_including_module(self): def test_reporting_on_nothing(self): # Used to raise a zero division error: - # https://bitbucket.org/ned/coveragepy/issue/250 + # https://github.com/nedbat/coveragepy/issues/250 self.make_file("empty.py", "") cov = coverage.Coverage() empty = self.start_import_stop(cov, "empty") @@ -177,7 +177,7 @@ def test_reporting_on_nothing(self): assert elts[0].get('line-rate') == '1' def test_empty_file_is_100_not_0(self): - # https://bitbucket.org/ned/coveragepy/issue/345 + # https://github.com/nedbat/coveragepy/issues/345 cov = self.run_doit() cov.xml_report() dom = ElementTree.parse("coverage.xml") @@ -205,7 +205,7 @@ def test_curdir_source(self): def test_deep_source(self): # When using source=, the XML report needs to mention those directories # in the elements. - # https://bitbucket.org/ned/coveragepy/issues/439/incorrect-cobertura-file-sources-generated + # https://github.com/nedbat/coveragepy/issues/439 self.make_file("src/main/foo.py", "a = 1") self.make_file("also/over/there/bar.py", "b = 2") cov = coverage.Coverage(source=["src/main", "also/over/there", "not/really"]) @@ -242,7 +242,7 @@ def test_deep_source(self): } def test_nonascii_directory(self): - # https://bitbucket.org/ned/coveragepy/issues/573/cant-generate-xml-report-if-some-source + # https://github.com/nedbat/coveragepy/issues/573 self.make_file("테스트/program.py", "a = 1") with change_dir("테스트"): cov = coverage.Coverage() @@ -364,8 +364,8 @@ def test_package_depth_3(self): ]) def test_source_prefix(self): - # https://bitbucket.org/ned/coveragepy/issues/465 - # https://bitbucket.org/ned/coveragepy/issues/526/generated-xml-invalid-paths-for-cobertura + # https://github.com/nedbat/coveragepy/issues/465 + # https://github.com/nedbat/coveragepy/issues/526 self.make_file("src/mod.py", "print(17)") cov = coverage.Coverage(source=["src"]) self.start_import_stop(cov, "mod", modfile="src/mod.py") From d0d49f076c716865b88086e9117d78d8cc3e3d94 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2020 20:52:17 -0400 Subject: [PATCH 19/77] Update requirements --- doc/requirements.pip | 4 ++-- requirements/pip.pip | 4 ++-- requirements/pytest.pip | 2 +- requirements/tox.pip | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/requirements.pip b/doc/requirements.pip index a984af305..fb47cd29f 100644 --- a/doc/requirements.pip +++ b/doc/requirements.pip @@ -4,9 +4,9 @@ doc8==0.8.1 pyenchant==3.1.1 -sphinx==2.4.3 +sphinx==3.2.1 sphinx-rst-builder==0.0.3 -sphinxcontrib-spelling==5.1.2 +sphinxcontrib-spelling==5.3.0 sphinx_rtd_theme==0.5.0 sphinx-autobuild==0.7.1 sphinx-tabs==1.2.0 diff --git a/requirements/pip.pip b/requirements/pip.pip index aa51bca35..01ee89bb7 100644 --- a/requirements/pip.pip +++ b/requirements/pip.pip @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt -pip==20.1.1 -virtualenv==20.0.25 +pip==20.2.2 +virtualenv==20.0.31 diff --git a/requirements/pytest.pip b/requirements/pytest.pip index 795b1d3fd..5149e0736 100644 --- a/requirements/pytest.pip +++ b/requirements/pytest.pip @@ -20,4 +20,4 @@ unittest-mixins==1.6 #-e/Users/ned/unittest_mixins # Just so I have a debugger if I want it -pudb==2019.1 +pudb==2019.2 diff --git a/requirements/tox.pip b/requirements/tox.pip index 1428e42a2..7ba31f447 100644 --- a/requirements/tox.pip +++ b/requirements/tox.pip @@ -2,4 +2,4 @@ # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # The version of tox used by coverage.py -tox==3.16.1 +tox==3.19.0 From 624580b7187d65288767ad7dc0915af1fd2e9a8c Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2020 21:20:56 -0400 Subject: [PATCH 20/77] Don't complain about trivial problems in doc/help --- igor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/igor.py b/igor.py index 3d51e5769..9a632b577 100644 --- a/igor.py +++ b/igor.py @@ -255,6 +255,7 @@ def do_check_eol(): '_build', '_spell', 'tmp', + 'help', ] checked = set() From 4859de2850f703207b0cab2ff6e7116a3e587b65 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2020 21:26:02 -0400 Subject: [PATCH 21/77] Fix two problems with docs --- doc/cmd.rst | 4 ++-- doc/conf.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/cmd.rst b/doc/cmd.rst index b294ee8db..f6087fecf 100644 --- a/doc/cmd.rst +++ b/doc/cmd.rst @@ -197,8 +197,8 @@ could affect the measurement process. The possible warnings include: :meth:`.Coverage.switch_context` function to change the context. Only one of these mechanisms should be in use at a time. -Individual warnings can be disabled with the `disable_warnings -`_ configuration setting. To silence "No data was +Individual warnings can be disabled with the :ref:`disable_warnings +` configuration setting. To silence "No data was collected," add this to your .coveragerc file:: [run] diff --git a/doc/conf.py b/doc/conf.py index a5365bf03..9ca2d8873 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -243,6 +243,6 @@ def setup(app): """Configure Sphinx""" - app.add_stylesheet('coverage.css') + app.add_css_file('coverage.css') app.add_config_value('prerelease', False, 'env') print("** Prerelease = %r" % prerelease) From ebb6b39d745dff6fd1ca03fc67b58f022c2c82bd Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2020 21:56:44 -0400 Subject: [PATCH 22/77] Remove a noisy command from the output --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7b383bbca..a72f9ee61 100644 --- a/Makefile +++ b/Makefile @@ -138,7 +138,7 @@ $(DOCBIN): tox -q -e doc --notest cmd_help: $(DOCBIN) - for cmd in annotate combine debug erase html json report run xml; do \ + @for cmd in annotate combine debug erase html json report run xml; do \ echo > doc/help/$$cmd.rst; \ echo ".. code::" >> doc/help/$$cmd.rst; \ echo >> doc/help/$$cmd.rst; \ From c3159081ae67864f75aacc1b86310fe9d8d614cb Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 2 Sep 2020 07:18:46 -0400 Subject: [PATCH 23/77] Explain a mystery --- tests/coveragetest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/coveragetest.py b/tests/coveragetest.py index 58cfb3dc6..f4961ed9b 100644 --- a/tests/coveragetest.py +++ b/tests/coveragetest.py @@ -348,6 +348,10 @@ def command_line(self, args, ret=OK): ret_actual = command_line(args) self.assertEqual(ret_actual, ret) + # Some distros rename the coverage command, and need a way to indicate + # their new command name to the tests. This is here for them to override, + # for example: + # https://salsa.debian.org/debian/pkg-python-coverage/-/blob/master/debian/patches/02.rename-public-programs.patch coverage_command = "coverage" def run_command(self, cmd): From 154f5284e124e610d80a0b5c7e3fac9132c891d6 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Sat, 12 Sep 2020 21:49:54 +0100 Subject: [PATCH 24/77] replace confusing comment with assertion (#1028) --- tests/test_api.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index 5ede9158b..ab4b8a8f8 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -887,21 +887,30 @@ def test_source_include_exclusive(self): cov.start() cov.stop() # pragma: nested + def test_source_package_as_package(self): + self.assertFalse(os.path.isdir("pkg1")) + lines = self.coverage_usepkgs(source=["pkg1"]) + self.filenames_in(lines, "p1a p1b") + self.filenames_not_in(lines, "p2a p2b othera otherb osa osb") + # Because source= was specified, we do search for unexecuted files. + self.assertEqual(lines['p1c'], 0) + def test_source_package_as_dir(self): - # pkg1 is a directory, since we cd'd into tests/modules in setUp. + self.chdir(self.nice_file(TESTS_DIR, 'modules')) + self.assertTrue(os.path.isdir("pkg1")) lines = self.coverage_usepkgs(source=["pkg1"]) self.filenames_in(lines, "p1a p1b") self.filenames_not_in(lines, "p2a p2b othera otherb osa osb") # Because source= was specified, we do search for unexecuted files. self.assertEqual(lines['p1c'], 0) - def test_source_package_as_package(self): + def test_source_package_dotted_sub(self): lines = self.coverage_usepkgs(source=["pkg1.sub"]) self.filenames_not_in(lines, "p2a p2b othera otherb osa osb") # Because source= was specified, we do search for unexecuted files. self.assertEqual(lines['runmod3'], 0) - def test_source_package_dotted(self): + def test_source_package_dotted_p1b(self): lines = self.coverage_usepkgs(source=["pkg1.p1b"]) self.filenames_in(lines, "p1b") self.filenames_not_in(lines, "p1a p1c p2a p2b othera otherb osa osb") From 39e6d1de90b9574f8eaa266b289a7efc02b2e9e9 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 12 Sep 2020 16:51:04 -0400 Subject: [PATCH 25/77] Thomas Grainger's first commit --- CONTRIBUTORS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 99b8493f4..7af8202b7 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -132,6 +132,7 @@ S. Y. Lee Teake Nutma Ted Wexler Thijs Triemstra +Thomas Grainger Titus Brown Vince Salvino Ville Skyttä From ecd6ab19a43a444bc7fc9dfbc08f3ca5274365ca Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Sun, 13 Sep 2020 00:26:36 +0100 Subject: [PATCH 26/77] Create Way to force package even if filepath exists (#1026) Fixes: #268 --- coverage/config.py | 2 ++ coverage/control.py | 4 ++-- coverage/inorout.py | 1 + tests/modules/ambigious/__init__.py | 0 tests/modules/ambigious/pkg1/__init__.py | 0 tests/modules/ambigious/pkg1/ambigious.py | 0 tests/test_api.py | 22 ++++++++++++++++++++++ tests/test_config.py | 2 ++ 8 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 tests/modules/ambigious/__init__.py create mode 100644 tests/modules/ambigious/pkg1/__init__.py create mode 100644 tests/modules/ambigious/pkg1/ambigious.py diff --git a/coverage/config.py b/coverage/config.py index 84d9758bf..2af4a1cc8 100644 --- a/coverage/config.py +++ b/coverage/config.py @@ -195,6 +195,7 @@ def __init__(self): self.run_include = None self.run_omit = None self.source = None + self.source_pkgs = [] self.timid = False self._crash = None @@ -361,6 +362,7 @@ def copy(self): ('run_include', 'run:include', 'list'), ('run_omit', 'run:omit', 'list'), ('source', 'run:source', 'list'), + ('source_pkgs', 'run:source_pkgs', 'list'), ('timid', 'run:timid', 'boolean'), ('_crash', 'run:_crash'), diff --git a/coverage/control.py b/coverage/control.py index d60db2126..ebc380091 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -99,7 +99,7 @@ def current(cls): def __init__( self, data_file=_DEFAULT_DATAFILE, data_suffix=None, cover_pylib=None, auto_data=False, timid=None, branch=None, config_file=True, - source=None, omit=None, include=None, debug=None, + source=None, source_pkgs=None, omit=None, include=None, debug=None, concurrency=None, check_preimported=False, context=None, ): """ @@ -188,7 +188,7 @@ def __init__( config_file=config_file, data_file=data_file, cover_pylib=cover_pylib, timid=timid, branch=branch, parallel=bool_or_none(data_suffix), - source=source, run_omit=omit, run_include=include, debug=debug, + source=source, source_pkgs=source_pkgs, run_omit=omit, run_include=include, debug=debug, report_omit=omit, report_include=include, concurrency=concurrency, context=context, ) diff --git a/coverage/inorout.py b/coverage/inorout.py index ec5f2c1ac..fbd1a95ed 100644 --- a/coverage/inorout.py +++ b/coverage/inorout.py @@ -132,6 +132,7 @@ def __init__(self, warn, debug): def configure(self, config): """Apply the configuration to get ready for decision-time.""" + self.source_pkgs.extend(config.source_pkgs) for src in config.source or []: if os.path.isdir(src): self.source.append(canonical_filename(src)) diff --git a/tests/modules/ambigious/__init__.py b/tests/modules/ambigious/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/modules/ambigious/pkg1/__init__.py b/tests/modules/ambigious/pkg1/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/modules/ambigious/pkg1/ambigious.py b/tests/modules/ambigious/pkg1/ambigious.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/test_api.py b/tests/test_api.py index ab4b8a8f8..7311073a3 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -935,6 +935,28 @@ def test_source_package_as_package_part_omitted(self): self.filenames_not_in(lines, "p1b") self.assertEqual(lines['p1c'], 0) + def test_ambigious_source_package_as_dir(self): + # pkg1 is a directory and a pkg, since we cd into tests/modules/ambigious + self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambigious")) + # pkg1 defaults to directory because tests/modules/ambigious/pkg1 exists + lines = self.coverage_usepkgs(source=["pkg1"]) + self.assertEqual( + self.coverage_usepkgs(source=["pkg1"]), + { + u"__init__.py": 0, u"__init__": 0, + u"ambigious.py": 0, u"ambigious": 0, + }, + ) + + def test_ambigious_source_package_as_package(self): + # pkg1 is a directory and a pkg, since we cd into tests/modules/ambigious + self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambigious")) + lines = self.coverage_usepkgs(source_pkgs=["pkg1"]) + self.filenames_in(lines, "p1a p1b") + self.filenames_not_in(lines, "p2a p2b othera otherb osa osb ambigious") + # Because source= was specified, we do search for unexecuted files. + self.assertEqual(lines['p1c'], 0) + class ReportIncludeOmitTest(IncludeOmitTestsMixin, CoverageTest): """Tests of the report include/omit functionality.""" diff --git a/tests/test_config.py b/tests/test_config.py index 89ecb17c6..dd86303f2 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -462,6 +462,7 @@ class ConfigFileTest(UsingModulesMixin, CoverageTest): ; this omit is overriden by the omit from [report] omit = twenty source = myapp + source_pkgs = ned plugins = plugins.a_plugin plugins.another @@ -553,6 +554,7 @@ def assert_config_settings_are_correct(self, cov): self.assertTrue(cov.config.parallel) self.assertEqual(cov.config.concurrency, ["thread"]) self.assertEqual(cov.config.source, ["myapp"]) + self.assertEqual(cov.config.source_pkgs, ["ned"]) self.assertEqual(cov.config.disable_warnings, ["abcd", "efgh"]) self.assertEqual(cov.get_exclude_list(), ["if 0:", r"pragma:?\s+no cover", "another_tab"]) From 263f3e1da8e5a6a32056a8697286f9adf0f6a55d Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 12 Sep 2020 19:42:14 -0400 Subject: [PATCH 27/77] Docs and cleanup for source_pkgs --- CHANGES.rst | 8 ++++++++ coverage/control.py | 9 ++++++++- coverage/version.py | 2 +- doc/config.rst | 8 ++++++++ tests/modules/ambigious/pkg1/__init__.py | 1 + tests/modules/ambigious/pkg1/ambigious.py | 2 ++ tests/modules/usepkgs.py | 1 + tests/test_api.py | 9 ++------- 8 files changed, 31 insertions(+), 9 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 0bbf4d34b..604763f74 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -25,6 +25,14 @@ want to know what's different in 5.0 since 4.5.x, see :ref:`whatsnew5x`. Unreleased ---------- +- The ``source`` setting has always been interpreted as either a file path or a + module, depending on which existed. If both interpretations were valid, it + was assumed to be a file path. The new ``source_pkgs`` setting can be used + to name a package to disambiguate this case. Thanks, Thomas Grainger. Fixes + `issue 268`_. + +.. _issue 268: https://github.com/nedbat/coveragepy/issues/268 + .. _changes_521: diff --git a/coverage/control.py b/coverage/control.py index ebc380091..7c4a48280 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -101,7 +101,7 @@ def __init__( auto_data=False, timid=None, branch=None, config_file=True, source=None, source_pkgs=None, omit=None, include=None, debug=None, concurrency=None, check_preimported=False, context=None, - ): + ): # pylint: disable=too-many-arguments """ Many of these arguments duplicate and override values that can be provided in a configuration file. Parameters that are missing here @@ -146,6 +146,10 @@ def __init__( in the trees indicated by the file paths or package names will be measured. + `source_pkgs` is a list of package names. It works the same as + `source`, but can be used to name packages where the name can also be + interpreted as a file path. + `include` and `omit` are lists of file name patterns. Files that match `include` will be measured, files that match `omit` will not. Each will also accept a single string argument. @@ -176,6 +180,9 @@ def __init__( .. versionadded:: 5.0 The `check_preimported` and `context` parameters. + .. versionadded:: 5.3 + The `source_pkgs` parameter. + """ # data_file=None means no disk file at all. data_file missing means # use the value from the config file. diff --git a/coverage/version.py b/coverage/version.py index b4a503376..830285f4d 100644 --- a/coverage/version.py +++ b/coverage/version.py @@ -5,7 +5,7 @@ # This file is exec'ed in setup.py, don't import anything! # Same semantics as sys.version_info. -version_info = (5, 2, 2, "alpha", 0) +version_info = (5, 3, 0, "alpha", 0) def _make_version(major, minor, micro, releaselevel, serial): diff --git a/doc/config.rst b/doc/config.rst index 6a0dbcf82..c6cb94dd5 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -208,6 +208,14 @@ for details. measure during execution. If set, ``include`` is ignored. See :ref:`source` for details. +.. _config_run_source_pkgs: + +``source_pkgs`` (multi-string): a list of packages, the source to measure +during execution. Operates the same as ``source``, but only names packages, +for resolving ambiguities between packages and directories. + +.. versionadded:: 5.3 + .. _config_run_timid: ``timid`` (boolean, default False): use a simpler but slower trace method. diff --git a/tests/modules/ambigious/pkg1/__init__.py b/tests/modules/ambigious/pkg1/__init__.py index e69de29bb..59742bbb9 100644 --- a/tests/modules/ambigious/pkg1/__init__.py +++ b/tests/modules/ambigious/pkg1/__init__.py @@ -0,0 +1 @@ +print("Ambiguous pkg1") diff --git a/tests/modules/ambigious/pkg1/ambigious.py b/tests/modules/ambigious/pkg1/ambigious.py index e69de29bb..6048d6da6 100644 --- a/tests/modules/ambigious/pkg1/ambigious.py +++ b/tests/modules/ambigious/pkg1/ambigious.py @@ -0,0 +1,2 @@ +amb = 1 +amb = 2 diff --git a/tests/modules/usepkgs.py b/tests/modules/usepkgs.py index 63ce7c186..2e4d21a71 100644 --- a/tests/modules/usepkgs.py +++ b/tests/modules/usepkgs.py @@ -5,3 +5,4 @@ import pkg2.p2a, pkg2.p2b import othermods.othera, othermods.otherb import othermods.sub.osa, othermods.sub.osb +import ambigious, ambigious.pkg1.ambigious diff --git a/tests/test_api.py b/tests/test_api.py index 7311073a3..a28d0133c 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -940,13 +940,8 @@ def test_ambigious_source_package_as_dir(self): self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambigious")) # pkg1 defaults to directory because tests/modules/ambigious/pkg1 exists lines = self.coverage_usepkgs(source=["pkg1"]) - self.assertEqual( - self.coverage_usepkgs(source=["pkg1"]), - { - u"__init__.py": 0, u"__init__": 0, - u"ambigious.py": 0, u"ambigious": 0, - }, - ) + self.filenames_in(lines, "ambigious") + self.filenames_not_in(lines, "p1a p1b p1c") def test_ambigious_source_package_as_package(self): # pkg1 is a directory and a pkg, since we cd into tests/modules/ambigious From c907b2ee1184dbcea1a3698588ad198a32fbea71 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 12 Sep 2020 19:53:31 -0400 Subject: [PATCH 28/77] ambigious -> ambiguous --- .../{ambigious => ambiguous}/__init__.py | 0 .../{ambigious => ambiguous}/pkg1/__init__.py | 0 .../pkg1/ambiguous.py} | 0 tests/modules/usepkgs.py | 2 +- tests/test_api.py | 18 +++++++++--------- 5 files changed, 10 insertions(+), 10 deletions(-) rename tests/modules/{ambigious => ambiguous}/__init__.py (100%) rename tests/modules/{ambigious => ambiguous}/pkg1/__init__.py (100%) rename tests/modules/{ambigious/pkg1/ambigious.py => ambiguous/pkg1/ambiguous.py} (100%) diff --git a/tests/modules/ambigious/__init__.py b/tests/modules/ambiguous/__init__.py similarity index 100% rename from tests/modules/ambigious/__init__.py rename to tests/modules/ambiguous/__init__.py diff --git a/tests/modules/ambigious/pkg1/__init__.py b/tests/modules/ambiguous/pkg1/__init__.py similarity index 100% rename from tests/modules/ambigious/pkg1/__init__.py rename to tests/modules/ambiguous/pkg1/__init__.py diff --git a/tests/modules/ambigious/pkg1/ambigious.py b/tests/modules/ambiguous/pkg1/ambiguous.py similarity index 100% rename from tests/modules/ambigious/pkg1/ambigious.py rename to tests/modules/ambiguous/pkg1/ambiguous.py diff --git a/tests/modules/usepkgs.py b/tests/modules/usepkgs.py index 2e4d21a71..7b42976d5 100644 --- a/tests/modules/usepkgs.py +++ b/tests/modules/usepkgs.py @@ -5,4 +5,4 @@ import pkg2.p2a, pkg2.p2b import othermods.othera, othermods.otherb import othermods.sub.osa, othermods.sub.osb -import ambigious, ambigious.pkg1.ambigious +import ambiguous, ambiguous.pkg1.ambiguous diff --git a/tests/test_api.py b/tests/test_api.py index a28d0133c..e2a2a5556 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -935,20 +935,20 @@ def test_source_package_as_package_part_omitted(self): self.filenames_not_in(lines, "p1b") self.assertEqual(lines['p1c'], 0) - def test_ambigious_source_package_as_dir(self): - # pkg1 is a directory and a pkg, since we cd into tests/modules/ambigious - self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambigious")) - # pkg1 defaults to directory because tests/modules/ambigious/pkg1 exists + def test_ambiguous_source_package_as_dir(self): + # pkg1 is a directory and a pkg, since we cd into tests/modules/ambiguous + self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambiguous")) + # pkg1 defaults to directory because tests/modules/ambiguous/pkg1 exists lines = self.coverage_usepkgs(source=["pkg1"]) - self.filenames_in(lines, "ambigious") + self.filenames_in(lines, "ambiguous") self.filenames_not_in(lines, "p1a p1b p1c") - def test_ambigious_source_package_as_package(self): - # pkg1 is a directory and a pkg, since we cd into tests/modules/ambigious - self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambigious")) + def test_ambiguous_source_package_as_package(self): + # pkg1 is a directory and a pkg, since we cd into tests/modules/ambiguous + self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambiguous")) lines = self.coverage_usepkgs(source_pkgs=["pkg1"]) self.filenames_in(lines, "p1a p1b") - self.filenames_not_in(lines, "p2a p2b othera otherb osa osb ambigious") + self.filenames_not_in(lines, "p2a p2b othera otherb osa osb ambiguous") # Because source= was specified, we do search for unexecuted files. self.assertEqual(lines['p1c'], 0) From 987ceb9300c9326e4932dd69d633e7bd7be04e16 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 13 Sep 2020 13:30:20 -0400 Subject: [PATCH 29/77] Fix a missed exception handling for bad plugins --- coverage/ctracer/tracer.c | 3 ++- tests/test_plugins.py | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/coverage/ctracer/tracer.c b/coverage/ctracer/tracer.c index 7d639112d..508086429 100644 --- a/coverage/ctracer/tracer.c +++ b/coverage/ctracer/tracer.c @@ -685,7 +685,8 @@ CTracer_handle_line(CTracer *self, PyFrameObject *frame) STATS( self->stats.pycalls++; ) from_to = PyObject_CallMethodObjArgs(self->pcur_entry->file_tracer, str_line_number_range, frame, NULL); if (from_to == NULL) { - goto error; + CTracer_disable_plugin(self, self->pcur_entry->disposition); + goto ok; } ret2 = CTracer_unpack_pair(self, from_to, &lineno_from, &lineno_to); Py_DECREF(from_to); diff --git a/tests/test_plugins.py b/tests/test_plugins.py index 2477f5ce7..ed58c5f41 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -804,6 +804,28 @@ def coverage_init(reg, options): """) self.run_bad_plugin("bad_plugin", "Plugin") + def test_line_number_range_raises_error(self): + self.make_file("bad_plugin.py", """\ + import coverage.plugin + class Plugin(coverage.plugin.CoveragePlugin): + def file_tracer(self, filename): + if filename.endswith("other.py"): + return BadFileTracer() + + class BadFileTracer(coverage.plugin.FileTracer): + def source_filename(self): + return "something.foo" + + def line_number_range(self, frame): + raise Exception("borked!") + + def coverage_init(reg, options): + reg.add_file_tracer(Plugin()) + """) + self.run_bad_plugin( + "bad_plugin", "Plugin", our_error=False, excmsg="borked!", + ) + def test_line_number_range_returns_non_tuple(self): self.make_file("bad_plugin.py", """\ import coverage.plugin From 24eb6fdc8495f969ffeb724f2e96d3941442dd2d Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 13 Sep 2020 13:58:44 -0400 Subject: [PATCH 30/77] Move disable_plugin to Python --- coverage/collector.py | 11 ++++++++ coverage/ctracer/tracer.c | 56 +++++++-------------------------------- coverage/ctracer/tracer.h | 1 + 3 files changed, 21 insertions(+), 47 deletions(-) diff --git a/coverage/collector.py b/coverage/collector.py index a042357f6..3545ab1e2 100644 --- a/coverage/collector.py +++ b/coverage/collector.py @@ -256,6 +256,8 @@ def _start_tracer(self): if hasattr(tracer, 'should_start_context'): tracer.should_start_context = self.should_start_context tracer.switch_context = self.switch_context + if hasattr(tracer, 'disable_plugin'): + tracer.disable_plugin = self.disable_plugin fn = tracer.start() self.tracers.append(tracer) @@ -381,6 +383,15 @@ def switch_context(self, new_context): context = new_context self.covdata.set_context(context) + def disable_plugin(self, disposition): + """Disable the plugin mentioned in `disposition`.""" + file_tracer = disposition.file_tracer + plugin = file_tracer._coverage_plugin + plugin_name = plugin._coverage_plugin_name + self.warn("Disabling plug-in {!r} due to previous exception".format(plugin_name)) + plugin._coverage_enabled = False + disposition.trace = False + def cached_mapped_file(self, filename): """A locally cached version of file names mapped through file_mapper.""" key = (type(filename), filename) diff --git a/coverage/ctracer/tracer.c b/coverage/ctracer/tracer.c index 508086429..045523524 100644 --- a/coverage/ctracer/tracer.c +++ b/coverage/ctracer/tracer.c @@ -103,6 +103,7 @@ CTracer_dealloc(CTracer *self) Py_XDECREF(self->should_start_context); Py_XDECREF(self->switch_context); Py_XDECREF(self->context); + Py_XDECREF(self->disable_plugin); DataStack_dealloc(&self->stats, &self->data_stack); if (self->data_stacks) { @@ -570,52 +571,17 @@ CTracer_handle_call(CTracer *self, PyFrameObject *frame) static void CTracer_disable_plugin(CTracer *self, PyObject * disposition) { - PyObject * file_tracer = NULL; - PyObject * plugin = NULL; - PyObject * plugin_name = NULL; - PyObject * msg = NULL; - PyObject * ignored = NULL; - + PyObject * ret; PyErr_Print(); - file_tracer = PyObject_GetAttr(disposition, str_file_tracer); - if (file_tracer == NULL) { - goto error; - } - if (file_tracer == Py_None) { - /* This shouldn't happen... */ - goto ok; - } - plugin = PyObject_GetAttr(file_tracer, str__coverage_plugin); - if (plugin == NULL) { - goto error; - } - plugin_name = PyObject_GetAttr(plugin, str__coverage_plugin_name); - if (plugin_name == NULL) { - goto error; - } - msg = MyText_FromFormat( - "Disabling plug-in '%s' due to previous exception", - MyText_AsString(plugin_name) - ); - if (msg == NULL) { - goto error; - } STATS( self->stats.pycalls++; ) - ignored = PyObject_CallFunctionObjArgs(self->warn, msg, NULL); - if (ignored == NULL) { - goto error; - } - - /* Disable the plugin for future files, and stop tracing this file. */ - if (PyObject_SetAttr(plugin, str__coverage_enabled, Py_False) < 0) { - goto error; - } - if (PyObject_SetAttr(disposition, str_trace, Py_False) < 0) { + ret = PyObject_CallFunctionObjArgs(self->disable_plugin, disposition, NULL); + if (ret == NULL) { goto error; } + Py_DECREF(ret); - goto ok; + return; error: /* This function doesn't return a status, so if an error happens, print it, @@ -623,13 +589,6 @@ CTracer_disable_plugin(CTracer *self, PyObject * disposition) /* PySys_WriteStderr is nicer, but is not in the public API. */ fprintf(stderr, "Error occurred while disabling plug-in:\n"); PyErr_Print(); - -ok: - Py_XDECREF(file_tracer); - Py_XDECREF(plugin); - Py_XDECREF(plugin_name); - Py_XDECREF(msg); - Py_XDECREF(ignored); } @@ -1121,6 +1080,9 @@ CTracer_members[] = { { "switch_context", T_OBJECT, offsetof(CTracer, switch_context), 0, PyDoc_STR("Function for switching to a new context.") }, + { "disable_plugin", T_OBJECT, offsetof(CTracer, disable_plugin), 0, + PyDoc_STR("Function for disabling a plugin.") }, + { NULL } }; diff --git a/coverage/ctracer/tracer.h b/coverage/ctracer/tracer.h index a83742ddf..8994a9e3d 100644 --- a/coverage/ctracer/tracer.h +++ b/coverage/ctracer/tracer.h @@ -27,6 +27,7 @@ typedef struct CTracer { PyObject * trace_arcs; PyObject * should_start_context; PyObject * switch_context; + PyObject * disable_plugin; /* Has the tracer been started? */ BOOL started; From 039ef0959c3f21fe0991204c19fb99fab14055f5 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 13 Sep 2020 15:47:15 -0400 Subject: [PATCH 31/77] If a plugin is disabled, don't try to record its file tracers. #1011 --- CHANGES.rst | 5 +++++ coverage/collector.py | 13 ++++++++++++- coverage/control.py | 4 ++++ tests/test_plugins.py | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 604763f74..29d7fbe3b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -31,7 +31,12 @@ Unreleased to name a package to disambiguate this case. Thanks, Thomas Grainger. Fixes `issue 268`_. +- If a plugin was disabled due to an exception, we used to still try to record + its information, causing an exception, as reported in `issue 1011`_. This is + now fixed. + .. _issue 268: https://github.com/nedbat/coveragepy/issues/268 +.. _issue 1011: https://github.com/nedbat/coveragepy/issues/1011 .. _changes_521: diff --git a/coverage/collector.py b/coverage/collector.py index 3545ab1e2..9333d66a8 100644 --- a/coverage/collector.py +++ b/coverage/collector.py @@ -196,6 +196,8 @@ def reset(self): # handle them. self.file_tracers = {} + self.disabled_plugins = set() + # The .should_trace_cache attribute is a cache from file names to # coverage.FileDisposition objects, or None. When a file is first # considered for tracing, a FileDisposition is obtained from @@ -419,6 +421,10 @@ def mapped_file_dict(self, d): return dict((self.cached_mapped_file(k), v) for k, v in items if v) + def plugin_was_disabled(self, plugin): + """Record that `plugin` was disabled during the run.""" + self.disabled_plugins.add(plugin._coverage_plugin_name) + def flush_data(self): """Save the collected data to our associated `CoverageData`. @@ -434,7 +440,12 @@ def flush_data(self): self.covdata.add_arcs(self.mapped_file_dict(self.data)) else: self.covdata.add_lines(self.mapped_file_dict(self.data)) - self.covdata.add_file_tracers(self.mapped_file_dict(self.file_tracers)) + + file_tracers = { + k: v for k, v in self.file_tracers.items() + if v not in self.disabled_plugins + } + self.covdata.add_file_tracers(self.mapped_file_dict(file_tracers)) self._clear_data() return True diff --git a/coverage/control.py b/coverage/control.py index 7c4a48280..2d75417e2 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -709,6 +709,10 @@ def get_data(self): self._init_data(suffix=None) self._post_init() + for plugin in self._plugins: + if not plugin._coverage_enabled: + self._collector.plugin_was_disabled(plugin) + if self._collector and self._collector.flush_data(): self._post_save_work() diff --git a/tests/test_plugins.py b/tests/test_plugins.py index ed58c5f41..6340f9c33 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -611,6 +611,7 @@ def g(x): cov = coverage.Coverage() cov.set_option("run:plugins", [module_name]) self.start_import_stop(cov, "simple") + cov.save() # pytest-cov does a save after stop, so we'll do it too. return cov def run_bad_plugin(self, module_name, plugin_name, our_error=True, excmsg=None, excmsgs=None): @@ -715,6 +716,37 @@ def coverage_init(reg, options): """) self.run_bad_plugin("bad_plugin", "Plugin") + def test_file_tracer_fails_eventually(self): + # Django coverage plugin can report on a few files and then fail. + # https://github.com/nedbat/coveragepy/issues/1011 + self.make_file("bad_plugin.py", """\ + import os.path + import coverage.plugin + class Plugin(coverage.plugin.CoveragePlugin): + def __init__(self): + self.calls = 0 + + def file_tracer(self, filename): + print(filename) + self.calls += 1 + if self.calls <= 2: + return FileTracer(filename) + else: + 17/0 # Oh noes! + + class FileTracer(coverage.FileTracer): + def __init__(self, filename): + self.filename = filename + def source_filename(self): + return os.path.basename(self.filename).replace(".py", ".foo") + def line_number_range(self, frame): + return -1, -1 + + def coverage_init(reg, options): + reg.add_file_tracer(Plugin()) + """) + self.run_bad_plugin("bad_plugin", "Plugin") + def test_file_tracer_returns_wrong(self): self.make_file("bad_plugin.py", """\ import coverage.plugin From d13594e24f18930e96db55d0b49c3ebdd7275f40 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 13 Sep 2020 15:57:29 -0400 Subject: [PATCH 32/77] Making a release --- CHANGES.rst | 6 ++++-- README.rst | 2 +- coverage/version.py | 2 +- doc/conf.py | 6 +++--- doc/index.rst | 2 +- doc/sample_html/cogapp___init___py.html | 4 ++-- doc/sample_html/cogapp___main___py.html | 4 ++-- doc/sample_html/cogapp_backward_py.html | 4 ++-- doc/sample_html/cogapp_cogapp_py.html | 4 ++-- doc/sample_html/cogapp_makefiles_py.html | 4 ++-- doc/sample_html/cogapp_test_cogapp_py.html | 4 ++-- doc/sample_html/cogapp_test_makefiles_py.html | 4 ++-- doc/sample_html/cogapp_test_whiteutils_py.html | 4 ++-- doc/sample_html/cogapp_whiteutils_py.html | 4 ++-- doc/sample_html/index.html | 4 ++-- doc/sample_html/status.json | 2 +- 16 files changed, 31 insertions(+), 29 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 29d7fbe3b..5819a4010 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -22,8 +22,10 @@ want to know what's different in 5.0 since 4.5.x, see :ref:`whatsnew5x`. .. ---------------------------- -Unreleased ----------- +.. _changes_53: + +Version 5.3 --- 2020-09-13 +-------------------------- - The ``source`` setting has always been interpreted as either a file path or a module, depending on which existed. If both interpretations were valid, it diff --git a/README.rst b/README.rst index 778b45a5a..babda472c 100644 --- a/README.rst +++ b/README.rst @@ -20,7 +20,7 @@ library to determine which lines are executable, and which have been executed. Coverage.py runs on many versions of Python: * CPython 2.7. -* CPython 3.5 through 3.9 beta 4. +* CPython 3.5 through 3.9 beta. * PyPy2 7.3.1 and PyPy3 7.3.1. Documentation is on `Read the Docs`_. Code repository and issue tracker are on diff --git a/coverage/version.py b/coverage/version.py index 830285f4d..2f29dd28f 100644 --- a/coverage/version.py +++ b/coverage/version.py @@ -5,7 +5,7 @@ # This file is exec'ed in setup.py, don't import anything! # Same semantics as sys.version_info. -version_info = (5, 3, 0, "alpha", 0) +version_info = (5, 3, 0, "final", 0) def _make_version(major, minor, micro, releaselevel, serial): diff --git a/doc/conf.py b/doc/conf.py index 9ca2d8873..fb6a88eab 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -66,11 +66,11 @@ # built documents. # # The short X.Y version. -version = "5.2.1" # CHANGEME +version = "5.3" # CHANGEME # The full version, including alpha/beta/rc tags. -release = "5.2.1" # CHANGEME +release = "5.3" # CHANGEME # The date of release, in "monthname day, year" format. -release_date = "July 23, 2020" # CHANGEME +release_date = "September 13, 2020" # CHANGEME rst_epilog = """ .. |release_date| replace:: {release_date} diff --git a/doc/index.rst b/doc/index.rst index e5df9263b..d235dcf8a 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -23,7 +23,7 @@ supported on: .. ifconfig:: prerelease **This is a pre-release build. The usual warnings about possible bugs - apply.** The latest stable version is coverage.py 5.2.1, `described here`_. + apply.** The latest stable version is coverage.py 5.3, `described here`_. .. _described here: http://coverage.readthedocs.io/ diff --git a/doc/sample_html/cogapp___init___py.html b/doc/sample_html/cogapp___init___py.html index be753a87c..f18ea24b5 100644 --- a/doc/sample_html/cogapp___init___py.html +++ b/doc/sample_html/cogapp___init___py.html @@ -65,8 +65,8 @@

diff --git a/doc/sample_html/cogapp___main___py.html b/doc/sample_html/cogapp___main___py.html index 6110e8887..0223c84e7 100644 --- a/doc/sample_html/cogapp___main___py.html +++ b/doc/sample_html/cogapp___main___py.html @@ -61,8 +61,8 @@

diff --git a/doc/sample_html/cogapp_backward_py.html b/doc/sample_html/cogapp_backward_py.html index 3cc5ceb52..8f62840a6 100644 --- a/doc/sample_html/cogapp_backward_py.html +++ b/doc/sample_html/cogapp_backward_py.html @@ -98,8 +98,8 @@

diff --git a/doc/sample_html/cogapp_cogapp_py.html b/doc/sample_html/cogapp_cogapp_py.html index a9c893070..3b1737649 100644 --- a/doc/sample_html/cogapp_cogapp_py.html +++ b/doc/sample_html/cogapp_cogapp_py.html @@ -864,8 +864,8 @@

diff --git a/doc/sample_html/cogapp_makefiles_py.html b/doc/sample_html/cogapp_makefiles_py.html index 4ac84bf19..d266132d7 100644 --- a/doc/sample_html/cogapp_makefiles_py.html +++ b/doc/sample_html/cogapp_makefiles_py.html @@ -102,8 +102,8 @@

diff --git a/doc/sample_html/cogapp_test_cogapp_py.html b/doc/sample_html/cogapp_test_cogapp_py.html index 59c6f98c3..43513a5e3 100644 --- a/doc/sample_html/cogapp_test_cogapp_py.html +++ b/doc/sample_html/cogapp_test_cogapp_py.html @@ -2534,8 +2534,8 @@

diff --git a/doc/sample_html/cogapp_test_makefiles_py.html b/doc/sample_html/cogapp_test_makefiles_py.html index 4a9f43549..d0a261060 100644 --- a/doc/sample_html/cogapp_test_makefiles_py.html +++ b/doc/sample_html/cogapp_test_makefiles_py.html @@ -178,8 +178,8 @@

diff --git a/doc/sample_html/cogapp_test_whiteutils_py.html b/doc/sample_html/cogapp_test_whiteutils_py.html index ae853ac14..93610e456 100644 --- a/doc/sample_html/cogapp_test_whiteutils_py.html +++ b/doc/sample_html/cogapp_test_whiteutils_py.html @@ -157,8 +157,8 @@

diff --git a/doc/sample_html/cogapp_whiteutils_py.html b/doc/sample_html/cogapp_whiteutils_py.html index d91bff54c..2b1372f1a 100644 --- a/doc/sample_html/cogapp_whiteutils_py.html +++ b/doc/sample_html/cogapp_whiteutils_py.html @@ -129,8 +129,8 @@

diff --git a/doc/sample_html/index.html b/doc/sample_html/index.html index c5323f34f..f69704794 100644 --- a/doc/sample_html/index.html +++ b/doc/sample_html/index.html @@ -155,8 +155,8 @@

Coverage report: diff --git a/doc/sample_html/status.json b/doc/sample_html/status.json index 636975972..b57cdfbc1 100644 --- a/doc/sample_html/status.json +++ b/doc/sample_html/status.json @@ -1 +1 @@ -{"format":2,"version":"5.2.1","globals":"e6e162746063b971c76587652ff86e5f","files":{"cogapp___init___py":{"hash":"6010eef3af87123028eb691d70094593","index":{"nums":[1,2,0,0,0,0,0],"html_filename":"cogapp___init___py.html","relative_filename":"cogapp/__init__.py"}},"cogapp___main___py":{"hash":"2cec3551dfd9a5818a6550318658ccd4","index":{"nums":[1,3,0,3,0,0,0],"html_filename":"cogapp___main___py.html","relative_filename":"cogapp/__main__.py"}},"cogapp_backward_py":{"hash":"f95e44a818c73b2187e6fadc6257f8ce","index":{"nums":[1,22,0,6,4,2,2],"html_filename":"cogapp_backward_py.html","relative_filename":"cogapp/backward.py"}},"cogapp_cogapp_py":{"hash":"f85acbdbacefaccb9c499ef6cbe2ffc4","index":{"nums":[1,485,1,215,200,28,132],"html_filename":"cogapp_cogapp_py.html","relative_filename":"cogapp/cogapp.py"}},"cogapp_makefiles_py":{"hash":"4fd2add44238312a5567022fe28737de","index":{"nums":[1,27,0,20,14,0,14],"html_filename":"cogapp_makefiles_py.html","relative_filename":"cogapp/makefiles.py"}},"cogapp_test_cogapp_py":{"hash":"ee9b3c832eaa47b9e3940133c58827af","index":{"nums":[1,790,6,549,20,0,18],"html_filename":"cogapp_test_cogapp_py.html","relative_filename":"cogapp/test_cogapp.py"}},"cogapp_test_makefiles_py":{"hash":"66093f767a400ce1720b94a7371de48b","index":{"nums":[1,71,0,53,6,0,6],"html_filename":"cogapp_test_makefiles_py.html","relative_filename":"cogapp/test_makefiles.py"}},"cogapp_test_whiteutils_py":{"hash":"068beefb2872fe6739fad2471c36a4f1","index":{"nums":[1,69,0,50,0,0,0],"html_filename":"cogapp_test_whiteutils_py.html","relative_filename":"cogapp/test_whiteutils.py"}},"cogapp_whiteutils_py":{"hash":"b16b0e7f940175106b11230fea9e8c8c","index":{"nums":[1,45,0,5,34,4,4],"html_filename":"cogapp_whiteutils_py.html","relative_filename":"cogapp/whiteutils.py"}}}} \ No newline at end of file +{"format":2,"version":"5.3","globals":"ea0e0ec5d6d9849e6fc73b34af46a2dc","files":{"cogapp___init___py":{"hash":"6010eef3af87123028eb691d70094593","index":{"nums":[1,2,0,0,0,0,0],"html_filename":"cogapp___init___py.html","relative_filename":"cogapp/__init__.py"}},"cogapp___main___py":{"hash":"2cec3551dfd9a5818a6550318658ccd4","index":{"nums":[1,3,0,3,0,0,0],"html_filename":"cogapp___main___py.html","relative_filename":"cogapp/__main__.py"}},"cogapp_backward_py":{"hash":"f95e44a818c73b2187e6fadc6257f8ce","index":{"nums":[1,22,0,6,4,2,2],"html_filename":"cogapp_backward_py.html","relative_filename":"cogapp/backward.py"}},"cogapp_cogapp_py":{"hash":"f85acbdbacefaccb9c499ef6cbe2ffc4","index":{"nums":[1,485,1,215,200,28,132],"html_filename":"cogapp_cogapp_py.html","relative_filename":"cogapp/cogapp.py"}},"cogapp_makefiles_py":{"hash":"4fd2add44238312a5567022fe28737de","index":{"nums":[1,27,0,20,14,0,14],"html_filename":"cogapp_makefiles_py.html","relative_filename":"cogapp/makefiles.py"}},"cogapp_test_cogapp_py":{"hash":"ee9b3c832eaa47b9e3940133c58827af","index":{"nums":[1,790,6,549,20,0,18],"html_filename":"cogapp_test_cogapp_py.html","relative_filename":"cogapp/test_cogapp.py"}},"cogapp_test_makefiles_py":{"hash":"66093f767a400ce1720b94a7371de48b","index":{"nums":[1,71,0,53,6,0,6],"html_filename":"cogapp_test_makefiles_py.html","relative_filename":"cogapp/test_makefiles.py"}},"cogapp_test_whiteutils_py":{"hash":"068beefb2872fe6739fad2471c36a4f1","index":{"nums":[1,69,0,50,0,0,0],"html_filename":"cogapp_test_whiteutils_py.html","relative_filename":"cogapp/test_whiteutils.py"}},"cogapp_whiteutils_py":{"hash":"b16b0e7f940175106b11230fea9e8c8c","index":{"nums":[1,45,0,5,34,4,4],"html_filename":"cogapp_whiteutils_py.html","relative_filename":"cogapp/whiteutils.py"}}}} \ No newline at end of file From 83e9b17f37f1be3bbaffb8c6ff82561affb60fc1 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 13 Sep 2020 17:17:06 -0400 Subject: [PATCH 33/77] Bump --- CHANGES.rst | 5 +++++ coverage/version.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 5819a4010..a3b43feae 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -21,6 +21,11 @@ want to know what's different in 5.0 since 4.5.x, see :ref:`whatsnew5x`. .. Version 9.8.1 --- 2027-07-27 .. ---------------------------- +Unreleased +---------- + +Nothing yet. + .. _changes_53: diff --git a/coverage/version.py b/coverage/version.py index 2f29dd28f..aca417c8b 100644 --- a/coverage/version.py +++ b/coverage/version.py @@ -5,7 +5,7 @@ # This file is exec'ed in setup.py, don't import anything! # Same semantics as sys.version_info. -version_info = (5, 3, 0, "final", 0) +version_info = (5, 3, 1, "alpha", 0) def _make_version(major, minor, micro, releaselevel, serial): From c1cda7644668f865152fd158dca4501d88420a38 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 13 Sep 2020 17:25:11 -0400 Subject: [PATCH 34/77] Sphinx 3 changed versionadded. Go back while I figure out what to do --- doc/requirements.pip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.pip b/doc/requirements.pip index fb47cd29f..ae72ec834 100644 --- a/doc/requirements.pip +++ b/doc/requirements.pip @@ -4,7 +4,7 @@ doc8==0.8.1 pyenchant==3.1.1 -sphinx==3.2.1 +sphinx==2.4.3 sphinx-rst-builder==0.0.3 sphinxcontrib-spelling==5.3.0 sphinx_rtd_theme==0.5.0 From e20d12422f079e2f6bb9043b204a8ea99a3d6f28 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 23 Sep 2020 17:00:51 -0400 Subject: [PATCH 35/77] Build all the doc formats --- .readthedocs.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index ed3737fbe..8c96c02fd 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -10,8 +10,11 @@ sphinx: builder: html configuration: doc/conf.py -# No other formats than HTML -formats: [] +# Build all the formats +formats: + - epub + - htmlzip + - pdf python: version: 3.7 From 2b34c3075f2e10398de50e0c7613af00bccdabc4 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 23 Sep 2020 17:08:01 -0400 Subject: [PATCH 36/77] dependencies --- doc/requirements.pip | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/requirements.pip b/doc/requirements.pip index ae72ec834..26d03b8f5 100644 --- a/doc/requirements.pip +++ b/doc/requirements.pip @@ -6,7 +6,8 @@ doc8==0.8.1 pyenchant==3.1.1 sphinx==2.4.3 sphinx-rst-builder==0.0.3 -sphinxcontrib-spelling==5.3.0 +# 5.x requires Sphinx 3 +sphinxcontrib-spelling==4.3.0 sphinx_rtd_theme==0.5.0 sphinx-autobuild==0.7.1 sphinx-tabs==1.2.0 From 5524ab5b6a219695ad46bb9e2c0828fe9bcb7eed Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 27 Sep 2020 15:40:43 -0400 Subject: [PATCH 37/77] More about optional --- coverage/optional.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/coverage/optional.py b/coverage/optional.py index ee617b625..507a1ada7 100644 --- a/coverage/optional.py +++ b/coverage/optional.py @@ -14,6 +14,14 @@ Bad:: + # MyModule.py + import unsure + + def use_unsure(): + unsure.something() + +Also bad:: + # MyModule.py from coverage.optional import unsure From 0b1dd531f23d8ba313ee685b156b07f76fa680d5 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 10 Oct 2020 08:53:04 -0400 Subject: [PATCH 38/77] Python 3.10 --- setup.py | 1 + tests/test_plugins.py | 6 +++++- tox.ini | 5 +---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 8c837d72c..86a054ab2 100644 --- a/setup.py +++ b/setup.py @@ -33,6 +33,7 @@ Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 +Programming Language :: Python :: 3.10 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Software Development :: Quality Assurance diff --git a/tests/test_plugins.py b/tests/test_plugins.py index 6340f9c33..d14f5c472 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -921,7 +921,11 @@ def coverage_init(reg, options): reg.add_file_tracer(Plugin()) """) self.run_bad_plugin( - "bad_plugin", "Plugin", our_error=False, excmsg="an integer is required", + "bad_plugin", "Plugin", our_error=False, + excmsgs=[ + "an integer is required", + "cannot be interpreted as an integer", + ], ) diff --git a/tox.ini b/tox.ini index 88fbbd688..077689d0c 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt [tox] -envlist = py{27,35,36,37,38,39}, pypy{2,3}, doc, lint +envlist = py{27,35,36,37,38,39,310}, pypy{2,3}, doc, lint skip_missing_interpreters = {env:COVERAGE_SKIP_MISSING_INTERPRETERS:True} toxworkdir = {env:TOXWORKDIR:.tox} @@ -47,9 +47,6 @@ commands = python setup.py --quiet build_ext --inplace python igor.py test_with_tracer c {posargs} -[testenv:py39] -basepython = python3.9 - [testenv:anypy] # For running against my own builds of CPython, or any other specific Python. basepython = {env:COVERAGE_PYTHON} From 4e8f18ecf5b357ba2bc058dec250da7388892da2 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 10 Oct 2020 08:57:35 -0400 Subject: [PATCH 39/77] More-recent versions of Python --- .travis.yml | 7 ++++--- appveyor.yml | 16 ++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index f5e8fad19..a643d45ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,19 +4,20 @@ # Tell Travis what to do # https://travis-ci.com/nedbat/coveragepy -dist: xenial +dist: focal language: python cache: pip +# https://docs.travis-ci.com/user/languages/python/#python-versions python: - '2.7' - '3.5' - '3.6' - '3.7' - '3.8' - - 'pypy2.7-6.0' - - 'pypy3.5-6.0' + - 'pypy2.7-7.3.1' + - 'pypy3.6-7.3.1' # Only testing it for python3.8 on aarch64 platform, since it already has a lot # of jobs to test and takes long time. diff --git a/appveyor.yml b/appveyor.yml index 6baccd81f..b2a1b2f53 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -47,13 +47,13 @@ environment: - JOB: "3.8 64-bit" TOXENV: "py38" PYTHON: "C:\\Python38-x64" - PYTHON_VERSION: "3.8.5" + PYTHON_VERSION: "3.8.6" PYTHON_ARCH: "64" - JOB: "3.9 64-bit" TOXENV: "py39" PYTHON: "C:\\Python39-x64" - PYTHON_VERSION: "3.9.0b5" + PYTHON_VERSION: "3.9.0" PYTHON_ARCH: "64" # 32-bit jobs don't run the tests under the Python tracer, since that should @@ -89,14 +89,14 @@ environment: - JOB: "3.8 32-bit" TOXENV: "py38" PYTHON: "C:\\Python38" - PYTHON_VERSION: "3.8.5" + PYTHON_VERSION: "3.8.6" PYTHON_ARCH: "32" COVERAGE_NO_PYTRACER: "1" - JOB: "3.9 32-bit" TOXENV: "py39" PYTHON: "C:\\Python39" - PYTHON_VERSION: "3.9.0b5" + PYTHON_VERSION: "3.9.0" PYTHON_ARCH: "32" COVERAGE_NO_PYTRACER: "1" @@ -108,10 +108,10 @@ environment: PYTHON_ARCH: "32" COVERAGE_COVERAGE: "yes" - - JOB: "Meta 3.6" - TOXENV: "py36" - PYTHON: "C:\\Python36" - PYTHON_VERSION: "3.6.11" + - JOB: "Meta 3.8" + TOXENV: "py38" + PYTHON: "C:\\Python38" + PYTHON_VERSION: "3.8.6" PYTHON_ARCH: "32" COVERAGE_COVERAGE: "yes" From ae35c27be0062721c82f1967e9eb7d6f041e5258 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 10 Oct 2020 13:12:16 -0400 Subject: [PATCH 40/77] PyPy 3.7 doesn't act exactly like CPython 3.7 --- coverage/env.py | 2 +- tests/test_parser.py | 2 +- tests/test_process.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/coverage/env.py b/coverage/env.py index b5da3b471..80153ecf1 100644 --- a/coverage/env.py +++ b/coverage/env.py @@ -66,7 +66,7 @@ class PYBEHAVIOR(object): # used to be an empty string (meaning the current directory). It changed # to be the actual path to the current directory, so that os.chdir wouldn't # affect the outcome. - actual_syspath0_dash_m = (PYVERSION >= (3, 7, 0, 'beta', 3)) + actual_syspath0_dash_m = (not PYPY) and (PYVERSION >= (3, 7, 0, 'beta', 3)) # When a break/continue/return statement in a try block jumps to a finally # block, does the finally block do the break/continue/return (pre-3.8), or diff --git a/tests/test_parser.py b/tests/test_parser.py index 03bf25de3..0e6a0859c 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -214,7 +214,7 @@ def bar(self): expected_arcs = set(arcz_to_arcs(".1 14 48 8. .2 2. -8A A-8")) expected_exits = {1: 1, 2: 1, 4: 1, 8: 1, 10: 1} - if env.PYVERSION >= (3, 7, 0, 'beta', 5): + if (not env.PYPY) and (env.PYVERSION >= (3, 7, 0, 'beta', 5)): # 3.7 changed how functions with only docstrings are numbered. expected_arcs.update(set(arcz_to_arcs("-46 6-4"))) expected_exits.update({6: 1}) diff --git a/tests/test_process.py b/tests/test_process.py index 25f1fcc9d..bf0e1ac02 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -743,7 +743,7 @@ def test_fullcoverage(self): # pragma: no metacov self.assertGreater(line_counts(data)['os.py'], 50) @xfail( - env.PYPY3 and env.PYPYVERSION >= (7, 1, 1), + env.PYPY3 and ((7, 1, 1) <= env.PYPYVERSION < (7, 3)), "https://bitbucket.org/pypy/pypy/issues/3074" ) def test_lang_c(self): From 3274cbad045d9ee2e67384564d772a019cad0c9e Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 11 Oct 2020 11:12:04 -0400 Subject: [PATCH 41/77] Fix --source performance regression. #1037 --- CHANGES.rst | 5 ++++- coverage/control.py | 6 +++++- coverage/sqldata.py | 29 ++++++++++++++++++++--------- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index a3b43feae..aa06f318e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -24,7 +24,10 @@ want to know what's different in 5.0 since 4.5.x, see :ref:`whatsnew5x`. Unreleased ---------- -Nothing yet. +- When using ``--source`` on a large source tree, v5.x was slower than previous + versions. This performance regression is now fixed, closing `issue 1037`_. + +.. _issue 1037: https://github.com/nedbat/coveragepy/issues/1037 .. _changes_53: diff --git a/coverage/control.py b/coverage/control.py index 2d75417e2..086490730 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -4,6 +4,7 @@ """Core control stuff for coverage.py.""" import atexit +import collections import contextlib import os import os.path @@ -737,9 +738,12 @@ def _post_save_work(self): # Touch all the files that could have executed, so that we can # mark completely unexecuted files as 0% covered. if self._data is not None: + file_paths = collections.defaultdict(list) for file_path, plugin_name in self._inorout.find_possibly_unexecuted_files(): file_path = self._file_mapper(file_path) - self._data.touch_file(file_path, plugin_name) + file_paths[plugin_name].append(file_path) + for plugin_name, paths in file_paths.items(): + self._data.touch_files(paths, plugin_name) if self.config.note: self._warn("The '[run] note' setting is no longer supported.") diff --git a/coverage/sqldata.py b/coverage/sqldata.py index b8ee88532..702bd42b9 100644 --- a/coverage/sqldata.py +++ b/coverage/sqldata.py @@ -167,7 +167,8 @@ class CoverageData(SimpleReprMixin): To record data for contexts, use :meth:`set_context` to set a context to be used for subsequent :meth:`add_lines` and :meth:`add_arcs` calls. - To add a source file without any measured data, use :meth:`touch_file`. + To add a source file without any measured data, use :meth:`touch_file`, + or :meth:`touch_files` for a list of such files. Write the data to its file with :meth:`write`. @@ -536,16 +537,26 @@ def touch_file(self, filename, plugin_name=""): `plugin_name` is the name of the plugin responsible for this file. It is used to associate the right filereporter, etc. """ + self.touch_files([filename], plugin_name) + + def touch_files(self, filenames, plugin_name=""): + """Ensure that `filenames` appear in the data, empty if needed. + + `plugin_name` is the name of the plugin responsible for these files. It is used + to associate the right filereporter, etc. + """ if self._debug.should('dataop'): - self._debug.write("Touching %r" % (filename,)) + self._debug.write("Touching %r" % (filenames,)) self._start_using() - if not self._has_arcs and not self._has_lines: - raise CoverageException("Can't touch files in an empty CoverageData") - - self._file_id(filename, add=True) - if plugin_name: - # Set the tracer for this file - self.add_file_tracers({filename: plugin_name}) + with self._connect(): # Use this to get one transaction. + if not self._has_arcs and not self._has_lines: + raise CoverageException("Can't touch files in an empty CoverageData") + + for filename in filenames: + self._file_id(filename, add=True) + if plugin_name: + # Set the tracer for this file + self.add_file_tracers({filename: plugin_name}) def update(self, other_data, aliases=None): """Update this data with data from several other :class:`CoverageData` instances. From c8b9a286b343f22a3cd4dcf4906b13faea68ee96 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Thu, 26 Nov 2020 16:31:28 -0500 Subject: [PATCH 42/77] GitHub Action for running tests --- .github/workflows/testsuite.yml | 50 +++++++++++++++++++++++++++++++++ requirements/ci.pip | 2 +- tox.ini | 7 +++-- 3 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/testsuite.yml diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml new file mode 100644 index 000000000..b59e08d97 --- /dev/null +++ b/.github/workflows/testsuite.yml @@ -0,0 +1,50 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +name: "Test Suite" + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + workflow_dispatch: + +jobs: + tests: + name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" + runs-on: "${{ matrix.os }}" + + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "pypy3"] + exclude: + # Windows PyPy doesn't seem to work? + - os: windows-latest + python-version: "pypy3" + fail-fast: false + + steps: + - uses: "actions/checkout@v2" + - uses: "actions/setup-python@v2" + with: + python-version: "${{ matrix.python-version }}" + + - name: "Install Visual C++ for Python 2.7" + if: runner.os == 'Windows' + run: | + choco install vcpython27 -f -y + + - name: "Install dependencies" + shell: bash + run: | + set -xe + python -VV + python -m site + python -m pip install -r requirements/ci.pip + + - name: "Run tox targets for ${{ matrix.python-version }}" + shell: bash + run: | + python -m tox diff --git a/requirements/ci.pip b/requirements/ci.pip index c36045685..c4fdbab52 100644 --- a/requirements/ci.pip +++ b/requirements/ci.pip @@ -5,4 +5,4 @@ -r tox.pip -r pytest.pip -r wheel.pip -tox-travis==0.12 +tox-gh-actions==2.2.0 diff --git a/tox.ini b/tox.ini index 077689d0c..077d4c1fd 100644 --- a/tox.ini +++ b/tox.ini @@ -84,12 +84,13 @@ commands = twine check dist/* python -m pylint --notes= -j 4 {env:LINTABLE} -[travis] -#2.7: py27, lint +[gh-actions] python = 2.7: py27 3.5: py35 3.6: py36 3.7: py37 + 3.8: py38 + 3.9: py39 pypy: pypy - pypy3.5: pypy3 + pypy3: pypy3 From bf479909ee9765fa3007360c12fb3b89906645f3 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 27 Nov 2020 18:54:26 -0500 Subject: [PATCH 43/77] Fix tests for GitHub windows platform The tests were failing because of differences in file paths. It was comparing: C:\Users\runneradmin\AppData\... to: C:\Users\RUNNER~1\AppData\... and failing. These changes normalize the file paths so the comparisons work properly. --- tests/test_api.py | 8 ++++---- tests/test_files.py | 2 +- tests/test_html.py | 4 +++- tests/test_process.py | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index e2a2a5556..3552f8f48 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -18,7 +18,7 @@ from coverage import env from coverage.backward import code_object, import_local_file, StringIO from coverage.data import line_counts -from coverage.files import abs_file +from coverage.files import abs_file, relative_filename from coverage.misc import CoverageException from tests.coveragetest import CoverageTest, CoverageTestMethodsMixin, TESTS_DIR, UsingModulesMixin @@ -472,8 +472,8 @@ def test_ordered_combine(self): # The order of the [paths] setting matters def make_data_file(): data = coverage.CoverageData(".coverage.1") - data.add_lines({os.path.abspath('ci/girder/g1.py'): dict.fromkeys(range(10))}) - data.add_lines({os.path.abspath('ci/girder/plugins/p1.py'): dict.fromkeys(range(10))}) + data.add_lines({abs_file('ci/girder/g1.py'): dict.fromkeys(range(10))}) + data.add_lines({abs_file('ci/girder/plugins/p1.py'): dict.fromkeys(range(10))}) data.write() def get_combined_filenames(): @@ -481,7 +481,7 @@ def get_combined_filenames(): cov.combine() cov.save() data = cov.get_data() - filenames = {os.path.relpath(f).replace("\\", "/") for f in data.measured_files()} + filenames = {relative_filename(f).replace("\\", "/") for f in data.measured_files()} return filenames # Case 1: get the order right. diff --git a/tests/test_files.py b/tests/test_files.py index a84ef61d1..9df4e5d0d 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -25,7 +25,7 @@ class FilesTest(CoverageTest): def abs_path(self, p): """Return the absolute path for `p`.""" - return os.path.join(os.getcwd(), os.path.normpath(p)) + return os.path.join(abs_file(os.getcwd()), os.path.normpath(p)) def test_simple(self): self.make_file("hello.py") diff --git a/tests/test_html.py b/tests/test_html.py index 12012b6a6..85f082040 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -18,7 +18,7 @@ import coverage from coverage.backward import unicode_class from coverage import env -from coverage.files import flat_rootname +from coverage.files import abs_file, flat_rootname import coverage.html from coverage.misc import CoverageException, NotPython, NoSource from coverage.report import get_analysis_to_report @@ -635,6 +635,8 @@ def compare_html(expected, actual): # The temp dir the tests make. (filepath_to_regex(os.getcwd()), 'TEST_TMPDIR'), (filepath_to_regex(flat_rootname(unicode_class(os.getcwd()))), '_TEST_TMPDIR'), + (filepath_to_regex(abs_file(os.getcwd())), 'TEST_TMPDIR'), + (filepath_to_regex(flat_rootname(unicode_class(abs_file(os.getcwd())))), '_TEST_TMPDIR'), (r'/private/var/folders/[\w/]{35}/coverage_test/tests_test_html_\w+_\d{8}', 'TEST_TMPDIR'), (r'_private_var_folders_\w{35}_coverage_test_tests_test_html_\w+_\d{8}', '_TEST_TMPDIR'), ] diff --git a/tests/test_process.py b/tests/test_process.py index bf0e1ac02..7f772e31e 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -20,7 +20,7 @@ import coverage from coverage import env from coverage.data import line_counts -from coverage.files import python_reported_file +from coverage.files import abs_file, python_reported_file from coverage.misc import output_encoding from tests.coveragetest import CoverageTest, TESTS_DIR, xfail @@ -390,8 +390,8 @@ def test_combine_with_aliases(self): data.read() summary = line_counts(data, fullpath=True) self.assertEqual(len(summary), 1) - actual = os.path.normcase(os.path.abspath(list(summary.keys())[0])) - expected = os.path.normcase(os.path.abspath('src/x.py')) + actual = abs_file(list(summary.keys())[0]) + expected = abs_file('src/x.py') self.assertEqual(expected, actual) self.assertEqual(list(summary.values())[0], 6) From 25ee95fef684685dd040130a4d4d24b7178bc678 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 28 Nov 2020 07:42:10 -0500 Subject: [PATCH 44/77] This test is picky about platforms --- tests/test_process.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_process.py b/tests/test_process.py index 7f772e31e..249beb001 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -743,7 +743,7 @@ def test_fullcoverage(self): # pragma: no metacov self.assertGreater(line_counts(data)['os.py'], 50) @xfail( - env.PYPY3 and ((7, 1, 1) <= env.PYPYVERSION < (7, 3)), + env.PYPY3 and (env.PYPYVERSION >= (7, 1, 1)) and env.LINUX, "https://bitbucket.org/pypy/pypy/issues/3074" ) def test_lang_c(self): From 10b2f67dc55d2886adf2286f320e13223a23fbed Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 28 Nov 2020 08:02:59 -0500 Subject: [PATCH 45/77] Retry tox if it fails, to avoid flaky failures --- .github/workflows/testsuite.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index b59e08d97..62de408a8 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -44,7 +44,26 @@ jobs: python -m site python -m pip install -r requirements/ci.pip - - name: "Run tox targets for ${{ matrix.python-version }}" + - name: "Run tox for ${{ matrix.python-version }}" shell: bash + continue-on-error: true + id: tox1 run: | python -m tox + + - name: "Retry tox for ${{ matrix.python-version }}" + shell: bash + id: tox2 + if: steps.tox1.outcome == 'failure' + run: | + python -m tox + + - name: "Set status" + shell: bash + if: always() + run: | + if ${{ steps.tox1.outcome == 'success' || steps.tox2.outcome == 'success' }}; then + echo success + else + exit 1 + fi From 52e361421322414c5a30dc490805195bfb402ea7 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 28 Nov 2020 08:59:54 -0500 Subject: [PATCH 46/77] Building kits with GitHub Actions --- .github/workflows/kit.yml | 69 ++++++++++++++++++++++++++++++++++++ ci/download_gha_artifacts.py | 40 +++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 .github/workflows/kit.yml create mode 100644 ci/download_gha_artifacts.py diff --git a/.github/workflows/kit.yml b/.github/workflows/kit.yml new file mode 100644 index 000000000..167199cd1 --- /dev/null +++ b/.github/workflows/kit.yml @@ -0,0 +1,69 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +# Based on: +# https://github.com/joerick/cibuildwheel/blob/master/examples/github-deploy.yml + +name: Build kits + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + workflow_dispatch: + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + fail-fast: false + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: "3.7" + + - name: Install cibuildwheel + run: | + python -m pip install cibuildwheel==1.7.0 + + - name: Install Visual C++ for Python 2.7 + if: runner.os == 'Windows' + run: | + choco install vcpython27 -f -y + + - name: Build wheels + env: + # Don't build wheels for PyPy. + CIBW_SKIP: pp* + run: | + python -m cibuildwheel --output-dir wheelhouse + + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: "3.7" + + - name: Build sdist + run: python setup.py sdist + + - uses: actions/upload-artifact@v2 + with: + path: dist/*.tar.gz diff --git a/ci/download_gha_artifacts.py b/ci/download_gha_artifacts.py new file mode 100644 index 000000000..9580dced4 --- /dev/null +++ b/ci/download_gha_artifacts.py @@ -0,0 +1,40 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Use the GitHub API to download built artifacts.""" + +import os +import os.path +import zipfile + +import requests + +def download_url(url, filename): + """Download a file from `url` to `filename`.""" + response = requests.get(url, stream=True) + if response.status_code == 200: + with open(filename, "wb") as f: + for chunk in response.iter_content(16*1024): + f.write(chunk) + +def unpack_zipfile(filename): + """Unpack a zipfile, using the names in the zip.""" + with open(filename, "rb") as fzip: + z = zipfile.ZipFile(fzip) + for name in z.namelist(): + print(f" extracting {name}") + z.extract(name) + +dest = "dist" +repo_owner = "nedbat/coveragepy" +temp_zip = "artifacts.zip" + +if not os.path.exists(dest): + os.makedirs(dest) +os.chdir(dest) + +r = requests.get(f"https://api.github.com/repos/{repo_owner}/actions/artifacts") +latest = max(r.json()["artifacts"], key=lambda a: a["created_at"]) +download_url(latest["archive_download_url"], temp_zip) +unpack_zipfile(temp_zip) +os.remove(temp_zip) From 73b63060c3de39453f2af57db5eb9610c0f39625 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 28 Nov 2020 13:00:28 -0500 Subject: [PATCH 47/77] Keep version pins in .pip files --- .github/workflows/kit.yml | 2 +- .github/workflows/testsuite.yml | 1 + requirements/ci.pip | 3 +-- requirements/pins.pip | 7 +++++++ 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 requirements/pins.pip diff --git a/.github/workflows/kit.yml b/.github/workflows/kit.yml index 167199cd1..94ed23e11 100644 --- a/.github/workflows/kit.yml +++ b/.github/workflows/kit.yml @@ -32,7 +32,7 @@ jobs: - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==1.7.0 + python -m pip install -c requirements/pins.pip cibuildwheel - name: Install Visual C++ for Python 2.7 if: runner.os == 'Windows' diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index 62de408a8..c94f4e5fa 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -43,6 +43,7 @@ jobs: python -VV python -m site python -m pip install -r requirements/ci.pip + python -m pip install -c requirements/pins.pip tox-gh-actions - name: "Run tox for ${{ matrix.python-version }}" shell: bash diff --git a/requirements/ci.pip b/requirements/ci.pip index c4fdbab52..060d1de3f 100644 --- a/requirements/ci.pip +++ b/requirements/ci.pip @@ -1,8 +1,7 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt -# Things CI servers need to succeeed. +# Things CI servers need for running tests. -r tox.pip -r pytest.pip -r wheel.pip -tox-gh-actions==2.2.0 diff --git a/requirements/pins.pip b/requirements/pins.pip new file mode 100644 index 000000000..223e7cbdf --- /dev/null +++ b/requirements/pins.pip @@ -0,0 +1,7 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +# Version pins, for use as a constraints file. + +cibuildwheel==1.7.0 +tox-gh-actions==2.2.0 From 76e80108c11b042e6e929641fe3f38975f5765ba Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 28 Nov 2020 19:11:18 -0500 Subject: [PATCH 48/77] Remove unneeded CI and kitting support We no longer: - Use Travis - Use AppVeyor - Build manylinux wheels locally - Build other wheels locally --- .travis.yml | 53 ----------- MANIFEST.in | 4 +- Makefile | 26 +---- README.rst | 9 +- appveyor.yml | 167 --------------------------------- ci/download_appveyor.py | 95 ------------------- ci/install.ps1 | 203 ---------------------------------------- ci/manylinux.sh | 60 ------------ ci/run_with_env.cmd | 91 ------------------ howto.txt | 13 +-- igor.py | 3 +- tox_wheels.ini | 21 ----- 12 files changed, 11 insertions(+), 734 deletions(-) delete mode 100644 .travis.yml delete mode 100644 appveyor.yml delete mode 100644 ci/download_appveyor.py delete mode 100644 ci/install.ps1 delete mode 100755 ci/manylinux.sh delete mode 100644 ci/run_with_env.cmd delete mode 100644 tox_wheels.ini diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a643d45ba..000000000 --- a/.travis.yml +++ /dev/null @@ -1,53 +0,0 @@ -# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt -# -# Tell Travis what to do -# https://travis-ci.com/nedbat/coveragepy - -dist: focal -language: python - -cache: pip - -# https://docs.travis-ci.com/user/languages/python/#python-versions -python: - - '2.7' - - '3.5' - - '3.6' - - '3.7' - - '3.8' - - 'pypy2.7-7.3.1' - - 'pypy3.6-7.3.1' - -# Only testing it for python3.8 on aarch64 platform, since it already has a lot -# of jobs to test and takes long time. -matrix: - include: - - python: 3.8 - arch: arm64 - env: - - COVERAGE_COVERAGE=no - - python: 3.8 - arch: arm64 - env: - - COVERAGE_COVERAGE=yes - -env: - matrix: - - COVERAGE_COVERAGE=no - - COVERAGE_COVERAGE=yes - -install: - - pip install -r requirements/ci.pip - - pip freeze - -script: - - tox - -after_script: - - | - if [[ $COVERAGE_COVERAGE == 'yes' ]]; then - python igor.py combine_html - pip install codecov - codecov -X gcov --file coverage.xml - fi diff --git a/MANIFEST.in b/MANIFEST.in index 75257c606..60da201de 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -16,8 +16,6 @@ include Makefile include NOTICE.txt include README.rst include __main__.py -include .travis.yml -include appveyor.yml include howto.txt include igor.py include metacov.ini @@ -31,6 +29,8 @@ include .readthedocs.yml recursive-include ci * exclude ci/*.token +recursive-include .github * + recursive-include coverage/fullcoverage *.py recursive-include coverage/ctracer *.c *.h diff --git a/Makefile b/Makefile index a72f9ee61..ec1a5aa81 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,6 @@ clean: clean_platform ## Remove artifacts of test execution, i sterile: clean ## Remove all non-controlled content, even if expensive. rm -rf .tox - -docker image rm -f quay.io/pypa/manylinux1_i686 quay.io/pypa/manylinux1_x86_64 CSS = coverage/htmlfiles/style.css @@ -68,20 +67,6 @@ smoke: ## Run tests quickly with the C tracer in the lowest supported Pytho pysmoke: ## Run tests quickly with the Python tracer in the lowest supported Python versions. COVERAGE_NO_CTRACER=1 tox -q -e py27,py35 -- $(PYTEST_SMOKE_ARGS) -DOCKER_RUN = docker run -it --init --rm -v `pwd`:/io -RUN_MANYLINUX_X86 = $(DOCKER_RUN) quay.io/pypa/manylinux1_x86_64 /io/ci/manylinux.sh -RUN_MANYLINUX_I686 = $(DOCKER_RUN) quay.io/pypa/manylinux1_i686 /io/ci/manylinux.sh - -test_linux: ## Run the tests in Linux under Docker. - # The Linux .pyc files clash with the host's because of file path - # changes, so clean them before and after running tests. - make clean_platform - $(RUN_MANYLINUX_X86) test $(ARGS) - make clean_platform - -meta_linux: ## Run meta-coverage in Linux under Docker. - ARGS="meta $(ARGS)" make test_linux - # Coverage measurement of coverage.py itself (meta-coverage). See metacov.ini # for details. @@ -96,13 +81,6 @@ metahtml: ## Produce meta-coverage HTML reports. kit: ## Make the source distribution. python setup.py sdist -wheel: ## Make the wheels for distribution. - tox -c tox_wheels.ini $(ARGS) - -kit_linux: ## Make the Linux wheels. - $(RUN_MANYLINUX_X86) build - $(RUN_MANYLINUX_I686) build - kit_upload: ## Upload the built distributions to PyPI. twine upload --verbose dist/* @@ -118,8 +96,8 @@ kit_local: # don't go crazy trying to figure out why our new code isn't installing. find ~/Library/Caches/pip/wheels -name 'coverage-*' -delete -download_appveyor: ## Download the latest Windows artifacts from AppVeyor. - python ci/download_appveyor.py nedbat/coveragepy +download_kits: ## Download the built kits from GitHub + python ci/download_gha_artifacts.py build_ext: python setup.py build_ext diff --git a/README.rst b/README.rst index babda472c..6cd341e74 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ Coverage.py Code coverage testing for Python. | |license| |versions| |status| -| |ci-status| |win-ci-status| |docs| |codecov| +| |ci-status| |docs| |codecov| | |kit| |format| |repos| |downloads| | |stars| |forks| |contributors| | |tidelift| |twitter-coveragepy| |twitter-nedbat| @@ -95,12 +95,9 @@ Licensed under the `Apache 2.0 License`_. For details, see `NOTICE.txt`_. .. _NOTICE.txt: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt -.. |ci-status| image:: https://travis-ci.com/nedbat/coveragepy.svg?branch=master - :target: https://travis-ci.com/nedbat/coveragepy +.. |ci-status| image:: https://github.com/nedbat/coveragepy/workflows/Test%20Suite/badge.svg + :target: https://github.com/nedbat/coveragepy/actions?query=workflow%3A%22Test+Suite%22 :alt: Build status -.. |win-ci-status| image:: https://ci.appveyor.com/api/projects/status/kmeqpdje7h9r6vsf/branch/master?svg=true - :target: https://ci.appveyor.com/project/nedbat/coveragepy - :alt: Windows build status .. |docs| image:: https://readthedocs.org/projects/coverage/badge/?version=latest&style=flat :target: https://coverage.readthedocs.io/ :alt: Documentation diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index b2a1b2f53..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,167 +0,0 @@ -# Appveyor, continuous integration for Windows -# https://ci.appveyor.com/project/nedbat/coveragepy - -version: '{branch}-{build}' - -shallow_clone: true - -cache: - - '%LOCALAPPDATA%\pip\Cache' - -environment: - - CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci\\run_with_env.cmd" - - PYTEST_ADDOPTS: "-n auto" - - # Note: There is logic to install Python version $PYTHON_VERSION if the - # $PYTHON directory doesn't exist. $PYTHON_VERSION is visible in the job - # descriptions, but can be wrong in the minor version, since we use the - # version pre-installed on AppVeyor. - # - matrix: - - JOB: "2.7 64-bit" - TOXENV: "py27" - PYTHON: "C:\\Python27-x64" - PYTHON_VERSION: "2.7.18" - PYTHON_ARCH: "64" - - - JOB: "3.5 64-bit" - TOXENV: "py35" - PYTHON: "C:\\Python35-x64" - PYTHON_VERSION: "3.5.9" - PYTHON_ARCH: "64" - - - JOB: "3.6 64-bit" - TOXENV: "py36" - PYTHON: "C:\\Python36-x64" - PYTHON_VERSION: "3.6.11" - PYTHON_ARCH: "64" - - - JOB: "3.7 64-bit" - TOXENV: "py37" - PYTHON: "C:\\Python37-x64" - PYTHON_VERSION: "3.7.8" - PYTHON_ARCH: "64" - - - JOB: "3.8 64-bit" - TOXENV: "py38" - PYTHON: "C:\\Python38-x64" - PYTHON_VERSION: "3.8.6" - PYTHON_ARCH: "64" - - - JOB: "3.9 64-bit" - TOXENV: "py39" - PYTHON: "C:\\Python39-x64" - PYTHON_VERSION: "3.9.0" - PYTHON_ARCH: "64" - - # 32-bit jobs don't run the tests under the Python tracer, since that should - # be exactly the same as 64-bit. - - JOB: "2.7 32-bit" - TOXENV: "py27" - PYTHON: "C:\\Python27" - PYTHON_VERSION: "2.7.18" - PYTHON_ARCH: "32" - COVERAGE_NO_PYTRACER: "1" - - - JOB: "3.5 32-bit" - TOXENV: "py35" - PYTHON: "C:\\Python35" - PYTHON_VERSION: "3.5.9" - PYTHON_ARCH: "32" - COVERAGE_NO_PYTRACER: "1" - - - JOB: "3.6 32-bit" - TOXENV: "py36" - PYTHON: "C:\\Python36" - PYTHON_VERSION: "3.6.11" - PYTHON_ARCH: "32" - COVERAGE_NO_PYTRACER: "1" - - - JOB: "3.7 32-bit" - TOXENV: "py37" - PYTHON: "C:\\Python37" - PYTHON_VERSION: "3.7.8" - PYTHON_ARCH: "32" - COVERAGE_NO_PYTRACER: "1" - - - JOB: "3.8 32-bit" - TOXENV: "py38" - PYTHON: "C:\\Python38" - PYTHON_VERSION: "3.8.6" - PYTHON_ARCH: "32" - COVERAGE_NO_PYTRACER: "1" - - - JOB: "3.9 32-bit" - TOXENV: "py39" - PYTHON: "C:\\Python39" - PYTHON_VERSION: "3.9.0" - PYTHON_ARCH: "32" - COVERAGE_NO_PYTRACER: "1" - - # Meta coverage - - JOB: "Meta 2.7" - TOXENV: "py27" - PYTHON: "C:\\Python27" - PYTHON_VERSION: "2.7.18" - PYTHON_ARCH: "32" - COVERAGE_COVERAGE: "yes" - - - JOB: "Meta 3.8" - TOXENV: "py38" - PYTHON: "C:\\Python38" - PYTHON_VERSION: "3.8.6" - PYTHON_ARCH: "32" - COVERAGE_COVERAGE: "yes" - -init: - - "ECHO %TOXENV%" - -install: - # Install Python (from the official .msi of http://python.org) and pip when - # not already installed. - - ps: if (-not(Test-Path($env:PYTHON))) { & ci\install.ps1 } - - # Prepend newly installed Python to the PATH of this build (this cannot be - # done from inside the powershell script as it would require to restart - # the parent CMD process). - - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - - # Check that we have the expected version and architecture for Python - - "python -c \"import struct, sys; print('{}\\n{}-bit'.format(sys.version, struct.calcsize('P') * 8))\"" - - # Upgrade to the right version of pip to avoid it displaying warnings - # about it being out of date. - - "python -m pip install --disable-pip-version-check -r requirements/pip.pip" - - # Install requirements. - - "%CMD_IN_ENV% pip install -r requirements/ci.pip" - - # Make a pythonX.Y.bat file in the current directory so that tox will find it - # and pythonX.Y will mean what we want it to. - - "python -c \"import os; open('python{}.{}.bat'.format(*os.environ['TOXENV'][2:]), 'w').write('@{}\\\\python \\x25*\\n'.format(os.environ['PYTHON']))\"" - -build_script: - # If not a metacov job, then build wheel installers. - - if NOT "%COVERAGE_COVERAGE%" == "yes" %CMD_IN_ENV% %PYTHON%\python setup.py bdist_wheel - - # Push everything in dist\ as an artifact. - - ps: if ( Test-Path 'dist' -PathType Container ) { Get-ChildItem dist\*.* | % { Push-AppveyorArtifact $_.FullName -FileName ('dist\' + $_.Name) } } - -test_script: - - "%CMD_IN_ENV% %PYTHON%\\Scripts\\tox" - -after_test: - - if "%COVERAGE_COVERAGE%" == "yes" 7z a metacov-win-%TOXENV%.zip %APPVEYOR_BUILD_FOLDER%\.metacov* - - if "%COVERAGE_COVERAGE%" == "yes" %CMD_IN_ENV% %PYTHON%\python igor.py combine_html - - if "%COVERAGE_COVERAGE%" == "yes" %CMD_IN_ENV% pip install codecov - - if "%COVERAGE_COVERAGE%" == "yes" %CMD_IN_ENV% codecov -X gcov --file coverage.xml - -# Uncomment this to enable RDP access to the build when done. -# https://www.appveyor.com/docs/how-to/rdp-to-build-worker/ -# on_finish: -# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - -artifacts: - - path: "metacov-*.zip" diff --git a/ci/download_appveyor.py b/ci/download_appveyor.py deleted file mode 100644 index a3d814962..000000000 --- a/ci/download_appveyor.py +++ /dev/null @@ -1,95 +0,0 @@ -# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt - -"""Use the Appveyor API to download Windows artifacts.""" - -import os -import os.path -import sys -import zipfile - -import requests - - -def make_auth_headers(): - """Make the authentication headers needed to use the Appveyor API.""" - with open("ci/appveyor.token") as f: - token = f.read().strip() - - headers = { - 'Authorization': 'Bearer {}'.format(token), - } - return headers - - -def make_url(url, **kwargs): - """Build an Appveyor API url.""" - return "https://ci.appveyor.com/api" + url.format(**kwargs) - - -def get_project_build(account_project): - """Get the details of the latest Appveyor build.""" - url = make_url("/projects/{account_project}", account_project=account_project) - response = requests.get(url, headers=make_auth_headers()) - return response.json() - - -def download_latest_artifacts(account_project): - """Download all the artifacts from the latest build.""" - build = get_project_build(account_project) - jobs = build['build']['jobs'] - print("Build {0[build][version]}, {1} jobs: {0[build][message]}".format(build, len(jobs))) - for job in jobs: - name = job['name'].partition(':')[2].split(',')[0].strip() - print(" {0}: {1[status]}, {1[artifactsCount]} artifacts".format(name, job)) - - url = make_url("/buildjobs/{jobid}/artifacts", jobid=job['jobId']) - response = requests.get(url, headers=make_auth_headers()) - artifacts = response.json() - - for artifact in artifacts: - is_zip = artifact['type'] == "Zip" - filename = artifact['fileName'] - print(" {}, {} bytes".format(filename, artifact['size'])) - - url = make_url( - "/buildjobs/{jobid}/artifacts/{filename}", - jobid=job['jobId'], - filename=filename - ) - download_url(url, filename, make_auth_headers()) - - if is_zip: - unpack_zipfile(filename) - os.remove(filename) - - -def ensure_dirs(filename): - """Make sure the directories exist for `filename`.""" - dirname, _ = os.path.split(filename) - if dirname and not os.path.exists(dirname): - os.makedirs(dirname) - - -def download_url(url, filename, headers): - """Download a file from `url` to `filename`.""" - ensure_dirs(filename) - response = requests.get(url, headers=headers, stream=True) - if response.status_code == 200: - with open(filename, 'wb') as f: - for chunk in response.iter_content(16*1024): - f.write(chunk) - - -def unpack_zipfile(filename): - """Unpack a zipfile, using the names in the zip.""" - with open(filename, 'rb') as fzip: - z = zipfile.ZipFile(fzip) - for name in z.namelist(): - print(" extracting {}".format(name)) - ensure_dirs(name) - z.extract(name) - - -if __name__ == "__main__": - download_latest_artifacts(sys.argv[1]) diff --git a/ci/install.ps1 b/ci/install.ps1 deleted file mode 100644 index fd5ab2202..000000000 --- a/ci/install.ps1 +++ /dev/null @@ -1,203 +0,0 @@ -# From: https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor/install.ps1 -# -# -# Sample script to install Python and pip under Windows -# Authors: Olivier Grisel, Jonathan Helmus, Kyle Kastner, and Alex Willmer -# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ - -$MINICONDA_URL = "http://repo.continuum.io/miniconda/" -$BASE_URL = "https://www.python.org/ftp/python/" -$GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py" -$GET_PIP_PATH = "C:\get-pip.py" - -$PYTHON_PRERELEASE_REGEX = @" -(?x) -(?\d+) -\. -(?\d+) -\. -(?\d+) -(?[a-z]{1,2}\d+) -"@ - - -function Download ($filename, $url) { - $webclient = New-Object System.Net.WebClient - - $basedir = $pwd.Path + "\" - $filepath = $basedir + $filename - if (Test-Path $filename) { - Write-Host "Reusing" $filepath - return $filepath - } - - # Download and retry up to 3 times in case of network transient errors. - Write-Host "Downloading" $filename "from" $url - $retry_attempts = 2 - for ($i = 0; $i -lt $retry_attempts; $i++) { - try { - $webclient.DownloadFile($url, $filepath) - break - } - Catch [Exception]{ - Start-Sleep 1 - } - } - if (Test-Path $filepath) { - Write-Host "File saved at" $filepath - } else { - # Retry once to get the error message if any at the last try - $webclient.DownloadFile($url, $filepath) - } - return $filepath -} - - -function ParsePythonVersion ($python_version) { - if ($python_version -match $PYTHON_PRERELEASE_REGEX) { - return ([int]$matches.major, [int]$matches.minor, [int]$matches.micro, - $matches.prerelease) - } - $version_obj = [version]$python_version - return ($version_obj.major, $version_obj.minor, $version_obj.build, "") -} - - -function DownloadPython ($python_version, $platform_suffix) { - $major, $minor, $micro, $prerelease = ParsePythonVersion $python_version - - $dir = "$major.$minor.$micro" - $ext = "exe" - if ($platform_suffix) { - $platform_suffix = "-$platform_suffix" - } - - $filename = "python-$python_version$platform_suffix.$ext" - $url = "$BASE_URL$dir/$filename" - $filepath = Download $filename $url - return $filepath -} - - -function InstallPython ($python_version, $architecture, $python_home) { - Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home - if (Test-Path $python_home) { - Write-Host $python_home "already exists, skipping." - return $false - } - if ($architecture -eq "32") { - $platform_suffix = "" - } else { - $platform_suffix = "amd64" - } - $installer_path = DownloadPython $python_version $platform_suffix - $installer_ext = [System.IO.Path]::GetExtension($installer_path) - Write-Host "Installing $installer_path to $python_home" - $install_log = $python_home + ".log" - if ($installer_ext -eq '.msi') { - InstallPythonMSI $installer_path $python_home $install_log - } else { - InstallPythonEXE $installer_path $python_home $install_log - } - if (Test-Path $python_home) { - Write-Host "Python $python_version ($architecture) installation complete" - } else { - Write-Host "Failed to install Python in $python_home" - Get-Content -Path $install_log - Exit 1 - } -} - - -function InstallPythonEXE ($exepath, $python_home, $install_log) { - $install_args = "/quiet InstallAllUsers=1 TargetDir=$python_home" - RunCommand $exepath $install_args -} - - -function InstallPythonMSI ($msipath, $python_home, $install_log) { - $install_args = "/qn /log $install_log /i $msipath TARGETDIR=$python_home" - $uninstall_args = "/qn /x $msipath" - RunCommand "msiexec.exe" $install_args - if (-not(Test-Path $python_home)) { - Write-Host "Python seems to be installed else-where, reinstalling." - RunCommand "msiexec.exe" $uninstall_args - RunCommand "msiexec.exe" $install_args - } -} - -function RunCommand ($command, $command_args) { - Write-Host $command $command_args - Start-Process -FilePath $command -ArgumentList $command_args -Wait -Passthru -} - - -function InstallPip ($python_home) { - $pip_path = $python_home + "\Scripts\pip.exe" - $python_path = $python_home + "\python.exe" - if (-not(Test-Path $pip_path)) { - Write-Host "Installing pip..." - $webclient = New-Object System.Net.WebClient - $webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH) - Write-Host "Executing:" $python_path $GET_PIP_PATH - & $python_path $GET_PIP_PATH - } else { - Write-Host "pip already installed." - } -} - - -function DownloadMiniconda ($python_version, $platform_suffix) { - $filename = "Miniconda-3.5.5-Windows-" + $platform_suffix + ".exe" - $url = $MINICONDA_URL + $filename - $filepath = Download $filename $url - return $filepath -} - - -function InstallMiniconda ($python_version, $architecture, $python_home) { - Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home - if (Test-Path $python_home) { - Write-Host $python_home "already exists, skipping." - return $false - } - if ($architecture -eq "32") { - $platform_suffix = "x86" - } else { - $platform_suffix = "x86_64" - } - $filepath = DownloadMiniconda $python_version $platform_suffix - Write-Host "Installing" $filepath "to" $python_home - $install_log = $python_home + ".log" - $args = "/S /D=$python_home" - Write-Host $filepath $args - Start-Process -FilePath $filepath -ArgumentList $args -Wait -Passthru - if (Test-Path $python_home) { - Write-Host "Python $python_version ($architecture) installation complete" - } else { - Write-Host "Failed to install Python in $python_home" - Get-Content -Path $install_log - Exit 1 - } -} - - -function InstallMinicondaPip ($python_home) { - $pip_path = $python_home + "\Scripts\pip.exe" - $conda_path = $python_home + "\Scripts\conda.exe" - if (-not(Test-Path $pip_path)) { - Write-Host "Installing pip..." - $args = "install --yes pip" - Write-Host $conda_path $args - Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru - } else { - Write-Host "pip already installed." - } -} - -function main () { - InstallPython $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON - InstallPip $env:PYTHON -} - -main diff --git a/ci/manylinux.sh b/ci/manylinux.sh deleted file mode 100755 index 1fafec9de..000000000 --- a/ci/manylinux.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# From: https://github.com/pypa/python-manylinux-demo/blob/master/travis/build-wheels.sh -# which is in the public domain. -# -# This is run inside a CentOS 5 virtual machine to build manylinux wheels: -# -# $ docker run -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /io/ci/build_manylinux.sh -# - -set -e -x - -action=$1 -shift - -if [[ $action == "build" ]]; then - # Compile wheels - cd /io - for PYBIN in /opt/python/*/bin; do - if [[ $PYBIN == *cp34* ]]; then - # manylinux docker images have Python 3.4, but we don't use it. - continue - fi - "$PYBIN/pip" install -r requirements/wheel.pip - "$PYBIN/python" setup.py clean -a - "$PYBIN/python" setup.py bdist_wheel -d ~/wheelhouse/ - done - cd ~ - - # Bundle external shared libraries into the wheels - for whl in wheelhouse/*.whl; do - auditwheel repair "$whl" -w /io/dist/ - done - -elif [[ $action == "test" ]]; then - # Create "pythonX.Y" links - for PYBIN in /opt/python/*/bin/; do - if [[ $PYBIN == *cp34* ]]; then - # manylinux docker images have Python 3.4, but we don't use it. - continue - fi - PYNAME=$("$PYBIN/python" -c "import sys; print('python{0[0]}.{0[1]}'.format(sys.version_info))") - ln -sf "$PYBIN/$PYNAME" /usr/local/bin/$PYNAME - done - - # Install packages and test - TOXBIN=/opt/python/cp36-cp36m/bin - "$TOXBIN/pip" install -r /io/requirements/tox.pip - - cd /io - export PYTHONPYCACHEPREFIX=/opt/pyc - if [[ $1 == "meta" ]]; then - shift - export COVERAGE_COVERAGE=yes - fi - TOXWORKDIR=.tox/linux "$TOXBIN/tox" "$@" || true - cd ~ - -else - echo "Need an action to perform!" -fi diff --git a/ci/run_with_env.cmd b/ci/run_with_env.cmd deleted file mode 100644 index 66b9252ef..000000000 --- a/ci/run_with_env.cmd +++ /dev/null @@ -1,91 +0,0 @@ -:: From: https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor/run_with_env.cmd -:: -:: -:: To build extensions for 64 bit Python 3, we need to configure environment -:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of: -:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1) -:: -:: To build extensions for 64 bit Python 2, we need to configure environment -:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of: -:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0) -:: -:: 32 bit builds, and 64-bit builds for 3.5 and beyond, do not require specific -:: environment configurations. -:: -:: Note: this script needs to be run with the /E:ON and /V:ON flags for the -:: cmd interpreter, at least for (SDK v7.0) -:: -:: More details at: -:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows -:: http://stackoverflow.com/a/13751649/163740 -:: -:: Author: Olivier Grisel -:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ -:: -:: Notes about batch files for Python people: -:: -:: Quotes in values are literally part of the values: -:: SET FOO="bar" -:: FOO is now five characters long: " b a r " -:: If you don't want quotes, don't include them on the right-hand side. -:: -:: The CALL lines at the end of this file look redundant, but if you move them -:: outside of the IF clauses, they do not run properly in the SET_SDK_64==Y -:: case, I don't know why. -@ECHO OFF - -SET COMMAND_TO_RUN=%* -SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows -SET WIN_WDK=c:\Program Files (x86)\Windows Kits\10\Include\wdf - -:: Extract the major and minor versions, and allow for the minor version to be -:: more than 9. This requires the version number to have two dots in it. -SET MAJOR_PYTHON_VERSION=%PYTHON_VERSION:~0,1% -IF "%PYTHON_VERSION:~3,1%" == "." ( - SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,1% -) ELSE ( - SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,2% -) - -:: Based on the Python version, determine what SDK version to use, and whether -:: to set the SDK for 64-bit. -IF %MAJOR_PYTHON_VERSION% == 2 ( - SET WINDOWS_SDK_VERSION="v7.0" - SET SET_SDK_64=Y -) ELSE ( - IF %MAJOR_PYTHON_VERSION% == 3 ( - SET WINDOWS_SDK_VERSION="v7.1" - IF %MINOR_PYTHON_VERSION% LEQ 4 ( - SET SET_SDK_64=Y - ) ELSE ( - SET SET_SDK_64=N - IF EXIST "%WIN_WDK%" ( - :: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/ - REN "%WIN_WDK%" 0wdf - ) - ) - ) ELSE ( - ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" - EXIT 1 - ) -) - -IF %PYTHON_ARCH% == 64 ( - IF %SET_SDK_64% == Y ( - ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture - SET DISTUTILS_USE_SDK=1 - SET MSSdk=1 - "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% - "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release - ECHO Executing: %COMMAND_TO_RUN% - call %COMMAND_TO_RUN% || EXIT 1 - ) ELSE ( - ECHO Using default MSVC build environment for 64 bit architecture - ECHO Executing: %COMMAND_TO_RUN% - call %COMMAND_TO_RUN% || EXIT 1 - ) -) ELSE ( - ECHO Using default MSVC build environment for 32 bit architecture - ECHO Executing: %COMMAND_TO_RUN% - call %COMMAND_TO_RUN% || EXIT 1 -) diff --git a/howto.txt b/howto.txt index 1ad455d35..f0def3b43 100644 --- a/howto.txt +++ b/howto.txt @@ -8,7 +8,6 @@ version_info = (4, 0, 2, "final", 0) - Python version number in classifiers in setup.py - Copyright date in NOTICE.txt -- Update specific Python versions in appveyor.yml ("PYTHON_VERSION") - Update CHANGES.rst, including release date. - don't forget the jump target - Update README.rst @@ -45,16 +44,8 @@ - ELSE: $ make publish - Kits: - - Start fresh: - $ make sterile - - Source kit and wheels: - $ make kit wheel - - Linux wheels: - $ make kit_linux - - Windows kits - - wait for over an hour for Appveyor to build kits. - - https://ci.appveyor.com/project/nedbat/coveragepy - $ make download_appveyor + - Download built kits from GitHub Actions: + $ make download_kits - examine the dist directory, and remove anything that looks malformed. - check the dist directory: $ python -m twine check dist/* diff --git a/igor.py b/igor.py index 9a632b577..31d4bacc2 100644 --- a/igor.py +++ b/igor.py @@ -310,9 +310,10 @@ def check_files(root, patterns, **kwargs): check_file("setup.py") check_file("igor.py") check_file("Makefile") - check_file(".travis.yml") check_files(".", ["*.rst", "*.txt"]) check_files(".", ["*.pip"]) + check_files(".github", ["*"]) + check_files("ci", ["*"]) def print_banner(label): diff --git a/tox_wheels.ini b/tox_wheels.ini deleted file mode 100644 index 3dd06b61d..000000000 --- a/tox_wheels.ini +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt - -[tox] -envlist = py{27,35,36,37,38,39,sys} -toxworkdir = {toxinidir}/.tox/wheels - -[testenv] -deps = - -rrequirements/wheel.pip - -commands = - python -c "import sys; print(sys.base_prefix)" - python setup.py bdist_wheel {posargs} - -[testenv:py27] -basepython = python2.7 - -[testenv:pysys] -# For building with the Mac Framework Python. -basepython = /usr/bin/python From bbc60b77f40f8a850522278997bb678c0f19517a Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 28 Nov 2020 19:52:18 -0500 Subject: [PATCH 49/77] Mention the CI changes --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index aa06f318e..52fd6645e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -27,6 +27,8 @@ Unreleased - When using ``--source`` on a large source tree, v5.x was slower than previous versions. This performance regression is now fixed, closing `issue 1037`_. +- Continuous integration has moved from Travis and AppVeyor to GitHub Actions. + .. _issue 1037: https://github.com/nedbat/coveragepy/issues/1037 From c27e0a97980ac5c0fb2cba0812b429a575227104 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 28 Nov 2020 19:52:36 -0500 Subject: [PATCH 50/77] Kits are built on demand only --- .github/workflows/kit.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/kit.yml b/.github/workflows/kit.yml index 94ed23e11..a4dcf6251 100644 --- a/.github/workflows/kit.yml +++ b/.github/workflows/kit.yml @@ -7,10 +7,6 @@ name: Build kits on: - push: - branches: ["master"] - pull_request: - branches: ["master"] workflow_dispatch: jobs: From 209ee3438d2169a0ea89ff32efd295aa1edf316e Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 29 Nov 2020 07:50:24 -0500 Subject: [PATCH 51/77] Small tweaks to GHA syntax --- .github/workflows/testsuite.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index c94f4e5fa..81db41dd9 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -18,7 +18,14 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "pypy3"] + python-version: + - "2.7" + - "3.5" + - "3.6" + - "3.7" + - "3.8" + - "3.9" + - "pypy3" exclude: # Windows PyPy doesn't seem to work? - os: windows-latest @@ -46,14 +53,12 @@ jobs: python -m pip install -c requirements/pins.pip tox-gh-actions - name: "Run tox for ${{ matrix.python-version }}" - shell: bash continue-on-error: true id: tox1 run: | python -m tox - name: "Retry tox for ${{ matrix.python-version }}" - shell: bash id: tox2 if: steps.tox1.outcome == 'failure' run: | @@ -63,8 +68,6 @@ jobs: shell: bash if: always() run: | - if ${{ steps.tox1.outcome == 'success' || steps.tox2.outcome == 'success' }}; then - echo success - else + if ${{ steps.tox1.outcome != 'success' && steps.tox2.outcome != 'success' }}; then exit 1 fi From 9d82ce7e25084202d0b3acbf6c9f0f97d4de2129 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 29 Nov 2020 08:00:45 -0500 Subject: [PATCH 52/77] Only install Windows 2.7 support for 2.7 --- .github/workflows/testsuite.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index 81db41dd9..ff72d9f83 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -38,8 +38,8 @@ jobs: with: python-version: "${{ matrix.python-version }}" - - name: "Install Visual C++ for Python 2.7" - if: runner.os == 'Windows' + - name: "Install Visual C++ if needed" + if: runner.os == 'Windows' && matrix.python-version == '2.7' run: | choco install vcpython27 -f -y From 5c5d7ccf1f890dfabf679041e9f8218f304b1d57 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 29 Nov 2020 08:11:01 -0500 Subject: [PATCH 53/77] Use bash for everything --- .github/workflows/testsuite.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index ff72d9f83..8561aea2d 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -10,6 +10,10 @@ on: branches: ["master"] workflow_dispatch: +defaults: + run: + shell: bash + jobs: tests: name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" @@ -44,7 +48,6 @@ jobs: choco install vcpython27 -f -y - name: "Install dependencies" - shell: bash run: | set -xe python -VV @@ -65,7 +68,6 @@ jobs: python -m tox - name: "Set status" - shell: bash if: always() run: | if ${{ steps.tox1.outcome != 'success' && steps.tox2.outcome != 'success' }}; then From d571d478004854e535338e80d34bd212425250af Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 29 Nov 2020 08:11:13 -0500 Subject: [PATCH 54/77] Give every step a human name --- .github/workflows/testsuite.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index 8561aea2d..6413c7b9c 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -37,8 +37,11 @@ jobs: fail-fast: false steps: - - uses: "actions/checkout@v2" - - uses: "actions/setup-python@v2" + - name: "Check out the repo" + uses: "actions/checkout@v2" + + - name: "Set up Python" + uses: "actions/setup-python@v2" with: python-version: "${{ matrix.python-version }}" From 570298931bb2e9e1505aad4e4233a247a15f0148 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 29 Nov 2020 14:25:58 -0500 Subject: [PATCH 55/77] Use --force-flaky to decrease the need for tox re-runs --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 00b7acc28..16e2bc6cc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [tool:pytest] -addopts = -q -n3 --strict --no-flaky-report -rfe --failed-first +addopts = -q -n3 --strict --force-flaky --no-flaky-report -rfe --failed-first markers = expensive: too slow to run during "make smoke" # How come this warning is suppressed successfully here, but not in conftest.py?? From 4360c9a0e0a2d2b1cefbd77824d4688cd76d0753 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 29 Nov 2020 16:14:43 -0500 Subject: [PATCH 56/77] Run lint etc in GitHub Actions --- .github/workflows/kit.yml | 7 ++-- .github/workflows/quality.yml | 64 +++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/quality.yml diff --git a/.github/workflows/kit.yml b/.github/workflows/kit.yml index a4dcf6251..9f96ac260 100644 --- a/.github/workflows/kit.yml +++ b/.github/workflows/kit.yml @@ -19,10 +19,11 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v2 + - name: Check out the repo + uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - name: Install Python + - name: Install Python + uses: actions/setup-python@v2 with: python-version: "3.7" diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml new file mode 100644 index 000000000..59a0ff9f0 --- /dev/null +++ b/.github/workflows/quality.yml @@ -0,0 +1,64 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +name: "Quality checks" + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + workflow_dispatch: + +defaults: + run: + shell: bash + +jobs: + lint: + name: Pylint etc + runs-on: ubuntu-latest + + steps: + - name: "Check out the repo" + uses: "actions/checkout@v2" + + - name: "Install Python" + uses: "actions/setup-python@v2" + with: + python-version: "3.8" + + - name: "Install dependencies" + run: | + set -xe + python -VV + python -m site + python -m pip install -r requirements/tox.pip + + - name: "Tox lint" + run: | + python -m tox -e lint + + doc: + name: Build docs + runs-on: ubuntu-latest + + steps: + - name: "Check out the repo" + uses: "actions/checkout@v2" + + - name: "Install Python" + uses: "actions/setup-python@v2" + with: + python-version: "3.8" + + - name: "Install dependencies" + run: | + set -xe + python -VV + python -m site + python -m pip install -r requirements/tox.pip + + - name: "Tox doc" + run: | + python -m tox -e doc From 9169aeadf5cf9e4fc30cd76ef53c0dff2ec946ef Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 29 Nov 2020 18:57:05 -0500 Subject: [PATCH 57/77] Silence previously unreported pylint warnings --- coverage/pytracer.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/coverage/pytracer.py b/coverage/pytracer.py index 44bfc8d6a..7d7a519b7 100644 --- a/coverage/pytracer.py +++ b/coverage/pytracer.py @@ -107,7 +107,7 @@ def _trace(self, frame, event, arg_unused): if event == 'call': # Should we start a new context? if self.should_start_context and self.context is None: - context_maybe = self.should_start_context(frame) + context_maybe = self.should_start_context(frame) # pylint: disable=not-callable if context_maybe is not None: self.context = context_maybe self.started_context = True @@ -132,15 +132,15 @@ def _trace(self, frame, event, arg_unused): self.cur_file_name = filename disp = self.should_trace_cache.get(filename) if disp is None: - disp = self.should_trace(filename, frame) - self.should_trace_cache[filename] = disp + disp = self.should_trace(filename, frame) # pylint: disable=not-callable + self.should_trace_cache[filename] = disp # pylint: disable=unsupported-assignment-operation self.cur_file_dict = None if disp.trace: tracename = disp.source_filename - if tracename not in self.data: - self.data[tracename] = {} - self.cur_file_dict = self.data[tracename] + if tracename not in self.data: # pylint: disable=unsupported-membership-test + self.data[tracename] = {} # pylint: disable=unsupported-assignment-operation + self.cur_file_dict = self.data[tracename] # pylint: disable=unsubscriptable-object # The call event is really a "start frame" event, and happens for # function calls and re-entering generators. The f_lasti field is # -1 for calls, and a real offset for generators. Use <0 as the @@ -227,7 +227,7 @@ def stop(self): # has changed to None. dont_warn = (env.PYPY and env.PYPYVERSION >= (5, 4) and self.in_atexit and tf is None) if (not dont_warn) and tf != self._trace: # pylint: disable=comparison-with-callable - self.warn( + self.warn( # pylint: disable=not-callable "Trace function changed, measurement is likely wrong: %r" % (tf,), slug="trace-changed", ) From 4f8e7d83316712d606d344169f1bdb5ac2ae152b Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 29 Nov 2020 06:12:28 -0500 Subject: [PATCH 58/77] Upgrades --- requirements/pip.pip | 4 ++-- requirements/pytest.pip | 5 +++-- requirements/tox.pip | 2 +- requirements/wheel.pip | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/requirements/pip.pip b/requirements/pip.pip index 01ee89bb7..c7c4895f2 100644 --- a/requirements/pip.pip +++ b/requirements/pip.pip @@ -1,5 +1,5 @@ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt -pip==20.2.2 -virtualenv==20.0.31 +pip==20.2.4 +virtualenv==20.2.1 diff --git a/requirements/pytest.pip b/requirements/pytest.pip index 5149e0736..43d4efe51 100644 --- a/requirements/pytest.pip +++ b/requirements/pytest.pip @@ -5,8 +5,9 @@ # 4.x is last to support py2 pytest==4.6.11 -pytest-xdist==1.32.0 -flaky==3.6.1 +# 1.34 is last to support py2 +pytest-xdist==1.34.0 +flaky==3.7.0 # 4.x is py3-only mock==3.0.5 # Use a fork of PyContracts that supports Python 3.9 diff --git a/requirements/tox.pip b/requirements/tox.pip index 7ba31f447..0e0f20f2f 100644 --- a/requirements/tox.pip +++ b/requirements/tox.pip @@ -2,4 +2,4 @@ # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt # The version of tox used by coverage.py -tox==3.19.0 +tox==3.20.1 diff --git a/requirements/wheel.pip b/requirements/wheel.pip index 2fd03ad2e..ae84163ab 100644 --- a/requirements/wheel.pip +++ b/requirements/wheel.pip @@ -3,5 +3,6 @@ # Things needed to make wheels for coverage.py +# setuptools 45.x is py3-only setuptools==44.1.1 -wheel==0.34.2 +wheel==0.35.1 From c77977f316250fbfa4387ca9b3d5839800675166 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 30 Nov 2020 16:47:30 -0500 Subject: [PATCH 59/77] Run actions on any pull request, not just those going to master --- .github/workflows/quality.yml | 1 - .github/workflows/testsuite.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 59a0ff9f0..ad45b2eef 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -7,7 +7,6 @@ on: push: branches: ["master"] pull_request: - branches: ["master"] workflow_dispatch: defaults: diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index 6413c7b9c..59f5380b2 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -7,7 +7,6 @@ on: push: branches: ["master"] pull_request: - branches: ["master"] workflow_dispatch: defaults: From 104d51ede4b27ac26429a55340605962e81755d4 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Thu, 3 Dec 2020 19:43:27 -0500 Subject: [PATCH 60/77] Coverage action --- .github/workflows/coverage.yml | 57 ++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 000000000..2120a6677 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,57 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +name: "Coverage" + +on: + push: + branches: ["master"] + pull_request: + workflow_dispatch: + +defaults: + run: + shell: bash + +jobs: + coverage: + name: "Python ${{ matrix.python-version }}" + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: + - "2.7" + - "3.5" + - "3.9" + - "pypy3" + fail-fast: false + + steps: + - name: "Check out the repo" + uses: "actions/checkout@v2" + + - name: "Set up Python" + uses: "actions/setup-python@v2" + with: + python-version: "${{ matrix.python-version }}" + + - name: "Install dependencies" + run: | + set -xe + python -VV + python -m site + python -m pip install -r requirements/ci.pip + python -m pip install -c requirements/pins.pip tox-gh-actions + + - name: "Run tox coverage for ${{ matrix.python-version }}" + env: + COVERAGE_COVERAGE: "yes" + run: | + python -m tox + python -m igor combine_html + + - name: "Upload to codecov" + uses: codecov/codecov-action@v1 + with: + file: coverage.xml From 3f18bfc67aa40797d68745d5ea26a369b6c97ae9 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 24 Nov 2020 19:41:38 -0500 Subject: [PATCH 61/77] Retry in the case of failures. #1010 PyPy seems prone to intermittent SQLite failures. An immediate retry avoids them. Not great, but it works. --- CHANGES.rst | 5 +++++ coverage/sqldata.py | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 52fd6645e..800ab2cf4 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -27,9 +27,14 @@ Unreleased - When using ``--source`` on a large source tree, v5.x was slower than previous versions. This performance regression is now fixed, closing `issue 1037`_. +- Mysterious SQLite errors can happen on PyPy, as reported in `issue 1010`_. An + immediate retry seems to fix the problem, although it is an unsatisfying + solution. + - Continuous integration has moved from Travis and AppVeyor to GitHub Actions. .. _issue 1037: https://github.com/nedbat/coveragepy/issues/1037 +.. _issue 1010: https://github.com/nedbat/coveragepy/issues/1010 .. _changes_53: diff --git a/coverage/sqldata.py b/coverage/sqldata.py index 702bd42b9..7a3b5c795 100644 --- a/coverage/sqldata.py +++ b/coverage/sqldata.py @@ -1056,7 +1056,13 @@ def execute(self, sql, parameters=()): tail = " with {!r}".format(parameters) if parameters else "" self.debug.write("Executing {!r}{}".format(sql, tail)) try: - return self.con.execute(sql, parameters) + try: + return self.con.execute(sql, parameters) + except Exception: + # In some cases, an error might happen that isn't really an + # error. Try again immediately. + # https://github.com/nedbat/coveragepy/issues/1010 + return self.con.execute(sql, parameters) except sqlite3.Error as exc: msg = str(exc) try: From 802f60c8df2034913db242323a8d0b3a15abe5eb Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 5 Dec 2020 13:22:46 -0500 Subject: [PATCH 62/77] Auto-cancel workflows when pushing to a branch --- .github/workflows/cancel.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/cancel.yml diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml new file mode 100644 index 000000000..a0da0a1ea --- /dev/null +++ b/.github/workflows/cancel.yml @@ -0,0 +1,20 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +# This action finds in-progress Action jobs for the same branch, and cancels +# them. There's little point in continuing to run superceded jobs. + +name: Cancel + +on: + push: + +jobs: + cancel: + runs-on: ubuntu-latest + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.6.0 + with: + access_token: ${{ github.token }} + workflow_id: coverage.yml, kit.yml, quality.yml, testsuite.yml From 6dfd89f90447f88ba295982dcafc627f4dca967d Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 5 Dec 2020 13:05:06 -0500 Subject: [PATCH 63/77] A favicon for the HTML report --- CHANGES.rst | 2 ++ coverage/html.py | 1 + coverage/htmlfiles/favicon_32.png | Bin 0 -> 1732 bytes coverage/htmlfiles/index.html | 1 + coverage/htmlfiles/pyfile.html | 1 + 5 files changed, 5 insertions(+) create mode 100644 coverage/htmlfiles/favicon_32.png diff --git a/CHANGES.rst b/CHANGES.rst index 800ab2cf4..e175d74dd 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -31,6 +31,8 @@ Unreleased immediate retry seems to fix the problem, although it is an unsatisfying solution. +- The HTML report pages now have a :ref:`Sleepy Snake ` favicon. + - Continuous integration has moved from Travis and AppVeyor to GitHub Actions. .. _issue 1037: https://github.com/nedbat/coveragepy/issues/1037 diff --git a/coverage/html.py b/coverage/html.py index 3596bbe1d..247d2ae19 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -166,6 +166,7 @@ class HtmlReporter(object): ("coverage_html.js", ""), ("keybd_closed.png", ""), ("keybd_open.png", ""), + ("favicon_32.png", ""), ] def __init__(self, cov): diff --git a/coverage/htmlfiles/favicon_32.png b/coverage/htmlfiles/favicon_32.png new file mode 100644 index 0000000000000000000000000000000000000000..8649f0475d8d20793b2ec431fe25a186a414cf10 GIT binary patch literal 1732 zcmV;#20QtQP)K2KOkBOVxIZChq#W-v7@TU%U6P(wycKT1hUJUToW3ke1U1ONa4 z000000000000000bb)GRa9mqwR9|UWHy;^RUrt?IT__Y0JUcxmBP0(51q1>E00030 z|NrOz)aw7%8sJzM<5^g%z7^qE`}_Ot|JUUG(NUkWzR|7K?Zo%@_v-8G-1N%N=D$;; zw;keH4dGY$`1t4M=HK_s*zm^0#KgqfwWhe3qO_HtvXYvtjgX>;-~C$L`&k>^R)9)7 zdPh2TL^pCnHC#0+_4D)M`p?qp!pq{jO_{8;$fbaflbx`Tn52n|n}8VFRTA1&ugOP< zPd{uvFjz7t*Vot1&d$l-xWCk}s;sQL&#O(Bskh6gqNJv>#iB=ypG1e3K!K4yc7!~M zfj4S*g^zZ7eP$+_Sl07Z646l;%urinP#D8a6TwRtnLIRcI!r4f@bK~9-`~;E(N?Lv zSEst7s;rcxsi~}{Nsytfz@MtUoR*iFc8!#vvx}Umhm4blk(_~MdVD-@dW&>!Nn~ro z_E~-ESVQAj6Wmn;(olz(O&_{U2*pZBc1aYjMh>Dq3z|6`jW`RDHV=t3I6yRKJ~LOX zz_z!!vbVXPqob#=pj3^VMT?x6t(irRmSKsMo1~LLkB&=#j!=M%NP35mfqim$drWb9 zYIb>no_LUwc!r^NkDzs4YHu@=ZHRzrafWDZd1EhEVq=tGX?tK$pIa)DTh#bkvh!J- z?^%@YS!U*0E8$q$_*aOTQ&)Ra64g>ep;BdcQgvlg8qQHrP*E$;P{-m=A*@axn@$bO zO-Y4JzS&EAi%YG}N?cn?YFS7ivPY=EMV6~YH;+Xxu|tefLS|Aza)Cg6us#)=JW!uH zQa?H>d^j+YHCtyjL^LulF*05|F$RG!AX_OHVI&MtA~_@=5_lU|0000rbW%=J06GH4 z^5LD8b8apw8vNh1ua1mF{{Hy)_U`NA;Nacc+sCpuHXa-V{r&yz?c(9#+}oX+NmiRW z+W-IqK1oDDR5;6GfCDCOP5}iL5fK(cB~ET81`MFgF2kGa9AjhSIk~-E-4&*tPPKdiilQJ11k_J082ZS z>@TvivP!5ZFG?t@{t+GpR3XR&@*hA_VE1|Lo8@L@)l*h(Z@=?c-NS$Fk&&61IzUU9 z*nPqBM=OBZ-6ka1SJgGAS-Us5EN)r#dUX%>wQZLa2ytPCtMKp)Ob z*xcu38Z&d5<-NBS)@jRD+*!W*cf-m_wmxDEqBf?czI%3U0J$Xik;lA`jg}VH?(S(V zE!M3;X2B8w0TnnW&6(8;_Uc)WD;Ms6PKP+s(sFgO!}B!^ES~GDt4qLPxwYB)^7)XA zZwo9zDy-B0B+jT6V=!=bo(zs_8{eBA78gT9GH$(DVhz;4VAYwz+bOIdZ-PNb|I&rl z^XG=vFLF)1{&nT2*0vMz#}7^9hXzzf&ZdKlEj{LihP;|;Ywqn35ajP?H?7t|i-Un% z&&kxee@9B{nwgv1+S-~0)E1{ob1^Wn`F2isurqThKK=3%&;`@{0{!D- z&CSj80t;uPu&FaJFtSXKH#ajgGj}=sEad7US6jP0|Db@0j)?(5@sf<7`~a9>s;wCa zm^)spe{uxGFmrJYI9cOh7s$>8Npkt-5EWB1UKc`{W{y5Ce$1+nM9Cr;);=Ju#N^62OSlJMn7omiUgP&ErsYzT~iGxcW aE(`!K@+CXylaC4j0000 {{ title|escape }} + {% if extra_css %} diff --git a/coverage/htmlfiles/pyfile.html b/coverage/htmlfiles/pyfile.html index ec0f416ff..e15be066f 100644 --- a/coverage/htmlfiles/pyfile.html +++ b/coverage/htmlfiles/pyfile.html @@ -9,6 +9,7 @@ {# http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/7684445e-f080-4d8f-8529-132763348e21 #} Coverage for {{relative_filename|escape}}: {{nums.pc_covered_str}}% + {% if extra_css %} From 380dcc3e82e5fa5028ddf886dc2743319fc3fd3f Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 5 Dec 2020 15:16:14 -0500 Subject: [PATCH 64/77] Updated gold html files --- tests/gold/html/a/a_py.html | 5 +++-- tests/gold/html/a/index.html | 5 +++-- tests/gold/html/b_branch/b_py.html | 5 +++-- tests/gold/html/b_branch/index.html | 5 +++-- tests/gold/html/bom/2/bom_py.html | 5 +++-- tests/gold/html/bom/2/index.html | 5 +++-- tests/gold/html/bom/bom_py.html | 5 +++-- tests/gold/html/bom/index.html | 5 +++-- tests/gold/html/isolatin1/index.html | 5 +++-- tests/gold/html/isolatin1/isolatin1_py.html | 5 +++-- tests/gold/html/omit_1/index.html | 5 +++-- tests/gold/html/omit_1/m1_py.html | 5 +++-- tests/gold/html/omit_1/m2_py.html | 5 +++-- tests/gold/html/omit_1/m3_py.html | 5 +++-- tests/gold/html/omit_1/main_py.html | 5 +++-- tests/gold/html/omit_2/index.html | 5 +++-- tests/gold/html/omit_2/m2_py.html | 5 +++-- tests/gold/html/omit_2/m3_py.html | 5 +++-- tests/gold/html/omit_2/main_py.html | 5 +++-- tests/gold/html/omit_3/index.html | 5 +++-- tests/gold/html/omit_3/m3_py.html | 5 +++-- tests/gold/html/omit_3/main_py.html | 5 +++-- tests/gold/html/omit_4/index.html | 5 +++-- tests/gold/html/omit_4/m1_py.html | 5 +++-- tests/gold/html/omit_4/m3_py.html | 5 +++-- tests/gold/html/omit_4/main_py.html | 5 +++-- tests/gold/html/omit_5/index.html | 5 +++-- tests/gold/html/omit_5/m1_py.html | 5 +++-- tests/gold/html/omit_5/main_py.html | 5 +++-- tests/gold/html/other/blah_blah_other_py.html | 9 +++++---- tests/gold/html/other/here_py.html | 5 +++-- tests/gold/html/other/index.html | 7 ++++--- tests/gold/html/partial/index.html | 5 +++-- tests/gold/html/partial/partial_py.html | 5 +++-- tests/gold/html/styled/a_py.html | 5 +++-- tests/gold/html/styled/index.html | 5 +++-- tests/gold/html/unicode/index.html | 5 +++-- tests/gold/html/unicode/unicode_py.html | 5 +++-- 38 files changed, 117 insertions(+), 79 deletions(-) diff --git a/tests/gold/html/a/a_py.html b/tests/gold/html/a/a_py.html index af5d72a19..5bfb1c898 100644 --- a/tests/gold/html/a/a_py.html +++ b/tests/gold/html/a/a_py.html @@ -4,6 +4,7 @@ Coverage for a.py: 67% + @@ -60,8 +61,8 @@

diff --git a/tests/gold/html/a/index.html b/tests/gold/html/a/index.html index 3276f1d65..2520e1563 100644 --- a/tests/gold/html/a/index.html +++ b/tests/gold/html/a/index.html @@ -3,6 +3,7 @@ Coverage report + @@ -75,8 +76,8 @@

Coverage report: diff --git a/tests/gold/html/b_branch/b_py.html b/tests/gold/html/b_branch/b_py.html index ee28735e5..2be085b91 100644 --- a/tests/gold/html/b_branch/b_py.html +++ b/tests/gold/html/b_branch/b_py.html @@ -4,6 +4,7 @@ Coverage for b.py: 70% + @@ -83,8 +84,8 @@

diff --git a/tests/gold/html/b_branch/index.html b/tests/gold/html/b_branch/index.html index 0dfc20cad..284599970 100644 --- a/tests/gold/html/b_branch/index.html +++ b/tests/gold/html/b_branch/index.html @@ -3,6 +3,7 @@ Coverage report + @@ -83,8 +84,8 @@

Coverage report: diff --git a/tests/gold/html/bom/2/bom_py.html b/tests/gold/html/bom/2/bom_py.html index a66988452..b38312aed 100644 --- a/tests/gold/html/bom/2/bom_py.html +++ b/tests/gold/html/bom/2/bom_py.html @@ -4,6 +4,7 @@ Coverage for bom.py: 71% + @@ -66,8 +67,8 @@

diff --git a/tests/gold/html/bom/2/index.html b/tests/gold/html/bom/2/index.html index 28abec0a6..85b712df8 100644 --- a/tests/gold/html/bom/2/index.html +++ b/tests/gold/html/bom/2/index.html @@ -3,6 +3,7 @@ Coverage report + @@ -75,8 +76,8 @@

Coverage report: diff --git a/tests/gold/html/bom/bom_py.html b/tests/gold/html/bom/bom_py.html index 3b181c633..cf0de385c 100644 --- a/tests/gold/html/bom/bom_py.html +++ b/tests/gold/html/bom/bom_py.html @@ -4,6 +4,7 @@ Coverage for bom.py: 71% + @@ -66,8 +67,8 @@

diff --git a/tests/gold/html/bom/index.html b/tests/gold/html/bom/index.html index 0e56a99a6..598116cd9 100644 --- a/tests/gold/html/bom/index.html +++ b/tests/gold/html/bom/index.html @@ -3,6 +3,7 @@ Coverage report + @@ -75,8 +76,8 @@

Coverage report: diff --git a/tests/gold/html/isolatin1/index.html b/tests/gold/html/isolatin1/index.html index ec9c50b52..3a4700b35 100644 --- a/tests/gold/html/isolatin1/index.html +++ b/tests/gold/html/isolatin1/index.html @@ -3,6 +3,7 @@ Coverage report + @@ -75,8 +76,8 @@

Coverage report: diff --git a/tests/gold/html/isolatin1/isolatin1_py.html b/tests/gold/html/isolatin1/isolatin1_py.html index 3dd8c8fd0..9a5891374 100644 --- a/tests/gold/html/isolatin1/isolatin1_py.html +++ b/tests/gold/html/isolatin1/isolatin1_py.html @@ -4,6 +4,7 @@ Coverage for isolatin1.py: 100% + @@ -60,8 +61,8 @@

diff --git a/tests/gold/html/omit_1/index.html b/tests/gold/html/omit_1/index.html index a97add0f6..5590b82bd 100644 --- a/tests/gold/html/omit_1/index.html +++ b/tests/gold/html/omit_1/index.html @@ -3,6 +3,7 @@ Coverage report + @@ -96,8 +97,8 @@

Coverage report: diff --git a/tests/gold/html/omit_1/m1_py.html b/tests/gold/html/omit_1/m1_py.html index 94fba21eb..2257fd094 100644 --- a/tests/gold/html/omit_1/m1_py.html +++ b/tests/gold/html/omit_1/m1_py.html @@ -4,6 +4,7 @@ Coverage for m1.py: 100% + @@ -57,8 +58,8 @@

diff --git a/tests/gold/html/omit_1/m2_py.html b/tests/gold/html/omit_1/m2_py.html index ade526d30..0a5ca20eb 100644 --- a/tests/gold/html/omit_1/m2_py.html +++ b/tests/gold/html/omit_1/m2_py.html @@ -4,6 +4,7 @@ Coverage for m2.py: 100% + @@ -57,8 +58,8 @@

diff --git a/tests/gold/html/omit_1/m3_py.html b/tests/gold/html/omit_1/m3_py.html index d6b4756d1..f9f56f7c8 100644 --- a/tests/gold/html/omit_1/m3_py.html +++ b/tests/gold/html/omit_1/m3_py.html @@ -4,6 +4,7 @@ Coverage for m3.py: 100% + @@ -57,8 +58,8 @@

diff --git a/tests/gold/html/omit_1/main_py.html b/tests/gold/html/omit_1/main_py.html index 5d4781245..5ff014aef 100644 --- a/tests/gold/html/omit_1/main_py.html +++ b/tests/gold/html/omit_1/main_py.html @@ -4,6 +4,7 @@ Coverage for main.py: 100% + @@ -65,8 +66,8 @@

diff --git a/tests/gold/html/omit_2/index.html b/tests/gold/html/omit_2/index.html index 5b5e3c6ea..ebe8195b5 100644 --- a/tests/gold/html/omit_2/index.html +++ b/tests/gold/html/omit_2/index.html @@ -3,6 +3,7 @@ Coverage report + @@ -89,8 +90,8 @@

Coverage report: diff --git a/tests/gold/html/omit_2/m2_py.html b/tests/gold/html/omit_2/m2_py.html index ade526d30..0a5ca20eb 100644 --- a/tests/gold/html/omit_2/m2_py.html +++ b/tests/gold/html/omit_2/m2_py.html @@ -4,6 +4,7 @@ Coverage for m2.py: 100% + @@ -57,8 +58,8 @@

diff --git a/tests/gold/html/omit_2/m3_py.html b/tests/gold/html/omit_2/m3_py.html index d6b4756d1..f9f56f7c8 100644 --- a/tests/gold/html/omit_2/m3_py.html +++ b/tests/gold/html/omit_2/m3_py.html @@ -4,6 +4,7 @@ Coverage for m3.py: 100% + @@ -57,8 +58,8 @@

diff --git a/tests/gold/html/omit_2/main_py.html b/tests/gold/html/omit_2/main_py.html index 5d4781245..5ff014aef 100644 --- a/tests/gold/html/omit_2/main_py.html +++ b/tests/gold/html/omit_2/main_py.html @@ -4,6 +4,7 @@ Coverage for main.py: 100% + @@ -65,8 +66,8 @@

diff --git a/tests/gold/html/omit_3/index.html b/tests/gold/html/omit_3/index.html index f5bc1aaeb..8f304c478 100644 --- a/tests/gold/html/omit_3/index.html +++ b/tests/gold/html/omit_3/index.html @@ -3,6 +3,7 @@ Coverage report + @@ -82,8 +83,8 @@

Coverage report: diff --git a/tests/gold/html/omit_3/m3_py.html b/tests/gold/html/omit_3/m3_py.html index d6b4756d1..f9f56f7c8 100644 --- a/tests/gold/html/omit_3/m3_py.html +++ b/tests/gold/html/omit_3/m3_py.html @@ -4,6 +4,7 @@ Coverage for m3.py: 100% + @@ -57,8 +58,8 @@

diff --git a/tests/gold/html/omit_3/main_py.html b/tests/gold/html/omit_3/main_py.html index 5d4781245..5ff014aef 100644 --- a/tests/gold/html/omit_3/main_py.html +++ b/tests/gold/html/omit_3/main_py.html @@ -4,6 +4,7 @@ Coverage for main.py: 100% + @@ -65,8 +66,8 @@

diff --git a/tests/gold/html/omit_4/index.html b/tests/gold/html/omit_4/index.html index 861ba02e3..96e45bafa 100644 --- a/tests/gold/html/omit_4/index.html +++ b/tests/gold/html/omit_4/index.html @@ -3,6 +3,7 @@ Coverage report + @@ -89,8 +90,8 @@

Coverage report: diff --git a/tests/gold/html/omit_4/m1_py.html b/tests/gold/html/omit_4/m1_py.html index 94fba21eb..2257fd094 100644 --- a/tests/gold/html/omit_4/m1_py.html +++ b/tests/gold/html/omit_4/m1_py.html @@ -4,6 +4,7 @@ Coverage for m1.py: 100% + @@ -57,8 +58,8 @@

diff --git a/tests/gold/html/omit_4/m3_py.html b/tests/gold/html/omit_4/m3_py.html index d6b4756d1..f9f56f7c8 100644 --- a/tests/gold/html/omit_4/m3_py.html +++ b/tests/gold/html/omit_4/m3_py.html @@ -4,6 +4,7 @@ Coverage for m3.py: 100% + @@ -57,8 +58,8 @@

diff --git a/tests/gold/html/omit_4/main_py.html b/tests/gold/html/omit_4/main_py.html index 5d4781245..5ff014aef 100644 --- a/tests/gold/html/omit_4/main_py.html +++ b/tests/gold/html/omit_4/main_py.html @@ -4,6 +4,7 @@ Coverage for main.py: 100% + @@ -65,8 +66,8 @@

diff --git a/tests/gold/html/omit_5/index.html b/tests/gold/html/omit_5/index.html index 8afbebad5..8c1c95243 100644 --- a/tests/gold/html/omit_5/index.html +++ b/tests/gold/html/omit_5/index.html @@ -3,6 +3,7 @@ Coverage report + @@ -82,8 +83,8 @@

Coverage report: diff --git a/tests/gold/html/omit_5/m1_py.html b/tests/gold/html/omit_5/m1_py.html index 94fba21eb..2257fd094 100644 --- a/tests/gold/html/omit_5/m1_py.html +++ b/tests/gold/html/omit_5/m1_py.html @@ -4,6 +4,7 @@ Coverage for m1.py: 100% + @@ -57,8 +58,8 @@

diff --git a/tests/gold/html/omit_5/main_py.html b/tests/gold/html/omit_5/main_py.html index 5d4781245..5ff014aef 100644 --- a/tests/gold/html/omit_5/main_py.html +++ b/tests/gold/html/omit_5/main_py.html @@ -4,6 +4,7 @@ Coverage for main.py: 100% + @@ -65,8 +66,8 @@

diff --git a/tests/gold/html/other/blah_blah_other_py.html b/tests/gold/html/other/blah_blah_other_py.html index d88e21e56..b286e1e2d 100644 --- a/tests/gold/html/other/blah_blah_other_py.html +++ b/tests/gold/html/other/blah_blah_other_py.html @@ -3,7 +3,8 @@ - Coverage for /private/var/folders/j2/gr3cj3jn63s5q8g3bjvw57hm0000gp/T/coverage_test/tests_test_html_HtmlGoldTests_test_other_08291136/othersrc/other.py: 100% + Coverage for /private/var/folders/j2/gr3cj3jn63s5q8g3bjvw57hm0000gp/T/coverage_test/tests_test_html_HtmlGoldTests_test_other_58265363/othersrc/other.py: 100% + @@ -16,7 +17,7 @@