diff --git a/CHANGES.rst b/CHANGES.rst
index dffac6521..5ccf2160e 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -22,6 +22,17 @@ upgrading your version of coverage.py.
.. start-releases
+.. _changes_7-6-6:
+
+Version 7.6.6 — 2024-11-15
+--------------------------
+
+- One of the new asserts from 7.6.5 caused problems in real projects, as
+ reported in `issue 1891`_. The assert has been removed.
+
+.. _issue 1891: https://github.com/nedbat/coveragepy/issues/1891
+
+
.. _changes_7-6-5:
Version 7.6.5 — 2024-11-14
diff --git a/Makefile b/Makefile
index e17d0fe92..ad8018b51 100644
--- a/Makefile
+++ b/Makefile
@@ -176,12 +176,15 @@ sample_html_beta: _sample_cog_html ## Generate sample HTML report for a beta rel
##@ Kitting: making releases
-.PHONY: edit_for_release cheats relbranch relcommit1 relcommit2
+.PHONY: release_version edit_for_release cheats relbranch relcommit1 relcommit2
.PHONY: kit pypi_upload test_upload kit_local build_kits
.PHONY: tag bump_version
REPO_OWNER = nedbat/coveragepy
+release_version: #: Update the version for a release.
+ python igor.py release_version
+
edit_for_release: #: Edit sources to insert release facts (see howto.txt).
python igor.py edit_for_release
diff --git a/coverage/parser.py b/coverage/parser.py
index 51dc6afe4..e458b39c3 100644
--- a/coverage/parser.py
+++ b/coverage/parser.py
@@ -437,14 +437,14 @@ def _line_numbers(self) -> Iterable[TLineNo]:
byte_num = 0
for byte_incr, line_incr in zip(byte_increments, line_increments):
if byte_incr:
- assert line_num != last_line_num, f"Oops, {byte_incr = }, {line_incr = }"
- yield line_num
- last_line_num = line_num
+ if line_num != last_line_num:
+ yield line_num
+ last_line_num = line_num
byte_num += byte_incr
if line_incr >= 0x80:
line_incr -= 0x100
line_num += line_incr
- assert line_num != last_line_num
+ assert line_num != last_line_num, f"Oops: {self.code.co_name}@{line_num}"
yield line_num
def _find_statements(self) -> Iterable[TLineNo]:
diff --git a/coverage/version.py b/coverage/version.py
index e5988d017..f1a6a4ebe 100644
--- a/coverage/version.py
+++ b/coverage/version.py
@@ -8,7 +8,7 @@
# version_info: same semantics as sys.version_info.
# _dev: the .devN suffix if any.
-version_info = (7, 6, 5, "final", 0)
+version_info = (7, 6, 6, "final", 0)
_dev = 0
diff --git a/doc/conf.py b/doc/conf.py
index b8f7f5e6d..b31828c29 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -67,11 +67,11 @@
# @@@ editable
copyright = "2009–2024, Ned Batchelder" # pylint: disable=redefined-builtin
# The short X.Y.Z version.
-version = "7.6.5"
+version = "7.6.6"
# The full version, including alpha/beta/rc tags.
-release = "7.6.5"
+release = "7.6.6"
# The date of release, in "monthname day, year" format.
-release_date = "November 14, 2024"
+release_date = "November 15, 2024"
# @@@ end
rst_epilog = f"""
diff --git a/doc/sample_html/class_index.html b/doc/sample_html/class_index.html
index 03c869229..dda3987e7 100644
--- a/doc/sample_html/class_index.html
+++ b/doc/sample_html/class_index.html
@@ -56,8 +56,8 @@
- coverage.py v7.6.5,
- created at 2024-11-14 11:44 -0500
+ coverage.py v7.6.6,
+ created at 2024-11-15 07:39 -0500
@@ -537,8 +537,8 @@
diff --git a/doc/sample_html/z_7b071bdc2a35fa80_makefiles_py.html b/doc/sample_html/z_7b071bdc2a35fa80_makefiles_py.html
index 255c83ea0..5ece429d6 100644
--- a/doc/sample_html/z_7b071bdc2a35fa80_makefiles_py.html
+++ b/doc/sample_html/z_7b071bdc2a35fa80_makefiles_py.html
@@ -66,8 +66,8 @@
^ index
» next
- coverage.py v7.6.5,
- created at 2024-11-14 11:44 -0500
+ coverage.py v7.6.6,
+ created at 2024-11-15 07:39 -0500
@@ -127,8 +127,8 @@
^ index
» next
- coverage.py v7.6.5,
- created at 2024-11-14 11:44 -0500
+ coverage.py v7.6.6,
+ created at 2024-11-15 07:39 -0500
diff --git a/doc/sample_html/z_7b071bdc2a35fa80_test_cogapp_py.html b/doc/sample_html/z_7b071bdc2a35fa80_test_cogapp_py.html
index 599ce6e55..2036fc410 100644
--- a/doc/sample_html/z_7b071bdc2a35fa80_test_cogapp_py.html
+++ b/doc/sample_html/z_7b071bdc2a35fa80_test_cogapp_py.html
@@ -66,8 +66,8 @@
^ index
» next
- coverage.py v7.6.5,
- created at 2024-11-14 11:44 -0500
+ coverage.py v7.6.6,
+ created at 2024-11-15 07:39 -0500
@@ -2737,8 +2737,8 @@
^ index
» next
- coverage.py v7.6.5,
- created at 2024-11-14 11:44 -0500
+ coverage.py v7.6.6,
+ created at 2024-11-15 07:39 -0500
diff --git a/doc/sample_html/z_7b071bdc2a35fa80_test_makefiles_py.html b/doc/sample_html/z_7b071bdc2a35fa80_test_makefiles_py.html
index d7b510cd8..d0edfe304 100644
--- a/doc/sample_html/z_7b071bdc2a35fa80_test_makefiles_py.html
+++ b/doc/sample_html/z_7b071bdc2a35fa80_test_makefiles_py.html
@@ -66,8 +66,8 @@
^ index
» next
- coverage.py v7.6.5,
- created at 2024-11-14 11:44 -0500
+ coverage.py v7.6.6,
+ created at 2024-11-15 07:39 -0500
@@ -205,8 +205,8 @@
^ index
» next
- coverage.py v7.6.5,
- created at 2024-11-14 11:44 -0500
+ coverage.py v7.6.6,
+ created at 2024-11-15 07:39 -0500
diff --git a/doc/sample_html/z_7b071bdc2a35fa80_test_whiteutils_py.html b/doc/sample_html/z_7b071bdc2a35fa80_test_whiteutils_py.html
index 8da3add52..88aabcc4c 100644
--- a/doc/sample_html/z_7b071bdc2a35fa80_test_whiteutils_py.html
+++ b/doc/sample_html/z_7b071bdc2a35fa80_test_whiteutils_py.html
@@ -66,8 +66,8 @@
^ index
» next
- coverage.py v7.6.5,
- created at 2024-11-14 11:44 -0500
+ coverage.py v7.6.6,
+ created at 2024-11-15 07:39 -0500
@@ -186,8 +186,8 @@
^ index
» next
- coverage.py v7.6.5,
- created at 2024-11-14 11:44 -0500
+ coverage.py v7.6.6,
+ created at 2024-11-15 07:39 -0500
diff --git a/doc/sample_html/z_7b071bdc2a35fa80_utils_py.html b/doc/sample_html/z_7b071bdc2a35fa80_utils_py.html
index ba85d4115..f37278242 100644
--- a/doc/sample_html/z_7b071bdc2a35fa80_utils_py.html
+++ b/doc/sample_html/z_7b071bdc2a35fa80_utils_py.html
@@ -66,8 +66,8 @@
^ index
» next
- coverage.py v7.6.5,
- created at 2024-11-14 11:44 -0500
+ coverage.py v7.6.6,
+ created at 2024-11-15 07:39 -0500
@@ -159,8 +159,8 @@
^ index
» next
- coverage.py v7.6.5,
- created at 2024-11-14 11:44 -0500
+ coverage.py v7.6.6,
+ created at 2024-11-15 07:39 -0500
diff --git a/doc/sample_html/z_7b071bdc2a35fa80_whiteutils_py.html b/doc/sample_html/z_7b071bdc2a35fa80_whiteutils_py.html
index 71fb935ac..e0d09a2f9 100644
--- a/doc/sample_html/z_7b071bdc2a35fa80_whiteutils_py.html
+++ b/doc/sample_html/z_7b071bdc2a35fa80_whiteutils_py.html
@@ -66,8 +66,8 @@
^ index
» next
- coverage.py v7.6.5,
- created at 2024-11-14 11:44 -0500
+ coverage.py v7.6.6,
+ created at 2024-11-15 07:39 -0500
@@ -159,8 +159,8 @@
^ index
» next
- coverage.py v7.6.5,
- created at 2024-11-14 11:44 -0500
+ coverage.py v7.6.6,
+ created at 2024-11-15 07:39 -0500
diff --git a/howto.txt b/howto.txt
index d871e991b..1c7b114fc 100644
--- a/howto.txt
+++ b/howto.txt
@@ -3,16 +3,19 @@
- Check that the current virtualenv matches the current coverage branch.
- start branch for release work
$ make relbranch
-- Edit version number in coverage/version.py
+- check version number in coverage/version.py
+ - IF PRE-RELEASE:
+ - edit to look like one of these:
version_info = (4, 0, 2, "alpha", 1)
version_info = (4, 0, 2, "beta", 1)
version_info = (4, 0, 2, "candidate", 1)
version_info = (4, 0, 2, "final", 0)
- - make sure: _dev = 0
-- Edit supported Python version numbers. Search for "PYVERSIONS".
- - Especially README.rst and doc/index.rst
+ - IF NOT PRE-RELEASE:
+ $ make release_version
- Update source files with release facts, and get useful snippets:
$ make edit_for_release cheats
+- Edit supported Python version numbers. Search for "PYVERSIONS".
+ - Especially README.rst and doc/index.rst
- Look over CHANGES.rst
- Update README.rst
- "New in x.y:"
diff --git a/igor.py b/igor.py
index 5564f52cf..e313d941e 100644
--- a/igor.py
+++ b/igor.py
@@ -419,6 +419,15 @@ def do_edit_for_release():
)
update_file("doc/conf.py", r"(?s)# @@@ editable\n.*# @@@ end\n", new_conf)
+def do_release_version():
+ """Set the version to 'final' for a release."""
+ facts = get_release_facts()
+ rel_vi = facts.vi[:3] + ("final", 0)
+ rel_version = f"version_info = {rel_vi}\n_dev = 0".replace("'", '"')
+ update_file(
+ "coverage/version.py", r"(?m)^version_info = .*\n_dev = \d+$", rel_version,
+ )
+
def do_bump_version():
"""Edit a few files right after a release to bump the version."""
diff --git a/tests/test_parser.py b/tests/test_parser.py
index 1b956151f..467f9cfc7 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -197,6 +197,16 @@ def test_fuzzed_double_parse(self) -> None:
with pytest.raises(NotPython, match=msg):
self.parse_text("]")
+ def test_bug_1891(self) -> None:
+ # This code exercises a code path I thought was impossible.
+ parser = self.parse_text("""\
+ res = siblings(
+ 'configure',
+ **ca,
+ )
+ """)
+ assert parser.exit_counts() == { 1:1 }
+
class ExclusionParserTest(PythonParserTestBase):
"""Tests for the exclusion code in PythonParser."""