-
-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assert row is not None
triggered in CoverageData._read_db()
when checking schema version
#1522
Comments
The exact same error occurred here. It first appeared 15 hours ago. We used coverage-7.0.1 before, and this error appeared after updating to coverage-7.0.2. Here are the full logs: |
Hmm, this is definitely a part of code changed between 7.0.1 and 7.0.2, but reading the 7.0.1 code, I would have expected it to raise a coverage.DataError: "Data file {!r} doesn't seem to be a coverage data file: {exc}". That error message has been mentioned a few times, but doesn't seem to be a current problem. I'm trying to understand how 7.0.1 manifested this race condition... |
I see: when combining data files, if a file can't be read, we silently skip the file and leave it behind. But that was only a check for CoverageException. 7.0.2 changed this failure case from a DataError (derived from CoverageException) to an AssertionError. |
I've made a small tweak on a branch, can you try it? It should restore the old behavior, but with more information shown when a file can't be combined:
|
Sure thing. I referenced the branch in Chia-Network/chia-blockchain#14261 with the workflow run at https://github.com/Chia-Network/chia-blockchain/actions/runs/3831281612. Though, with it fixed I'm not sure that we'll see anything since this was happening via pytest-cov. All the completed runs so far have passed, so it does seem to be back to previous behavior. To get some data, should we make it fail again explicitly and dump the info you want to a file and I can capture that in a CI artifact? FWIW, every time I deal with pytest-cov I do think about getting rid of it. Hasn't bubbled to the top of my list yet though. |
You have a complex action, so I'm having trouble seeing the difference. Where it had failed with an assert, we should now see a message about not being able to combine a data file. Is that happening? |
It was happening inside the pytest run so I'm guessing that if your diagnostics are going to stdout that pytest is likely consuming them. |
I can certainly just take it on myself to tweak your branch and get that info visible someway too, if you would like. I'm curious about when the db is created and schema info written when using pytest-cov and pytest-xdist. Is that somehow happening at the end of the xdist worker lifetime and the main process is attempting to collect those DB files too soon? |
+1 I am now also getting this error on 7.0.2
|
We started hitting this as well with 7.0.2. Our test suite uses Environment:
Python 3.10.9, running in the I don't know if this is related or not, but under 7.0.1 and earlier we would see the following warnings in the CI logs, but they never caused an issue so we were ignoring them:
|
@johnthagen can you try the branch I mentioned above?
Is anyone seeing this problem without pytest-cov? |
I wouldn't be surprised if it were even specific to pytest-cov with pytest-xdist. I'll try to |
This is fixed in commit 1f34d8b. |
This is now released as part of coverage 7.0.3. |
Thanks for the quick turnaround! But, am I understanding correctly that the underlying event here relates to probably losing some coverage data from some of the xdist processes? Or something similar. I appreciate that the symptom is gone, but it seems like there's an issue for me to explore and address elsewhere. |
I agree that there's a possible problem here. This fix gets us back to where 7.0.1 (and before) were. I don't know if there is data loss, since no one has reported a problem like that. It might be that new empty data files are getting created when they shouldn't be. |
@nedbat Wanted to confirm that 7.0.3 solved our issue and only the warnings listed here are shown, but coverage information is correct and the tests complete successfully: |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [coverage](https://togithub.com/nedbat/coveragepy) | `==6.5.0` -> `==7.1.0` | [![age](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/compatibility-slim/6.5.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/confidence-slim/6.5.0)](https://docs.renovatebot.com/merge-confidence/) | | [mkdocs-material](https://togithub.com/squidfunk/mkdocs-material) | `==8.5.11` -> `==9.0.9` | [![age](https://badges.renovateapi.com/packages/pypi/mkdocs-material/9.0.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/mkdocs-material/9.0.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/mkdocs-material/9.0.9/compatibility-slim/8.5.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/mkdocs-material/9.0.9/confidence-slim/8.5.11)](https://docs.renovatebot.com/merge-confidence/) | | [mock](http://mock.readthedocs.org/en/latest/) ([source](https://togithub.com/testing-cabal/mock)) | `==4.0.3` -> `==5.0.1` | [![age](https://badges.renovateapi.com/packages/pypi/mock/5.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/mock/5.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/mock/5.0.1/compatibility-slim/4.0.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/mock/5.0.1/confidence-slim/4.0.3)](https://docs.renovatebot.com/merge-confidence/) | | [pre-commit](https://togithub.com/pre-commit/pre-commit) | `==2.21.0` -> `==3.0.2` | [![age](https://badges.renovateapi.com/packages/pypi/pre-commit/3.0.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/pre-commit/3.0.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/pre-commit/3.0.2/compatibility-slim/2.21.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/pre-commit/3.0.2/confidence-slim/2.21.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>nedbat/coveragepy</summary> ### [`v7.1.0`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-710--2023-01-24) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.5...7.1.0) - Added: the debug output file can now be specified with `[run] debug_file` in the configuration file. Closes `issue 1319`\_. - Performance: fixed a slowdown with dynamic contexts that's been around since 6.4.3. The fix closes `issue 1538`*. Thankfully this doesn't break the `Cython change`* that fixed `issue 972`\_. Thanks to Mathieu Kniewallner for the deep investigative work and comprehensive issue report. - Typing: all product and test code has type annotations. .. \_Cython change:[https://github.com/nedbat/coveragepy/pull/1347](https://togithub.com/nedbat/coveragepy/pull/1347)7 .. \_issue 972[https://github.com/nedbat/coveragepy/issues/972](https://togithub.com/nedbat/coveragepy/issues/972)72 .. \_issue 131[https://github.com/nedbat/coveragepy/issues/1319](https://togithub.com/nedbat/coveragepy/issues/1319)319 .. \_issue 15[https://github.com/nedbat/coveragepy/issues/1538](https://togithub.com/nedbat/coveragepy/issues/1538)1538 .. \_changes\_7-0-5: ### [`v7.0.5`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-705--2023-01-10) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.4...7.0.5) - Fix: On Python 3.7, a file with type annotations but no `from __future__ import annotations` would be missing statements in the coverage report. This is now fixed, closing `issue 1524`\_. .. \_issue 1524:[https://github.com/nedbat/coveragepy/issues/1524](https://togithub.com/nedbat/coveragepy/issues/1524)4 .. \_changes\_7-0-4: ### [`v7.0.4`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-704--2023-01-07) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.3...7.0.4) - Performance: an internal cache of file names was accidentally disabled, resulting in sometimes drastic reductions in performance. This is now fixed, closing `issue 1527`\_. Thanks to Ivan Ciuvalschii for the reproducible test case. .. \_issue 1527:[https://github.com/nedbat/coveragepy/issues/1527](https://togithub.com/nedbat/coveragepy/issues/1527)7 .. \_changes\_7-0-3: ### [`v7.0.3`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-703--2023-01-03) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.2...7.0.3) - Fix: when using pytest-cov or pytest-xdist, or perhaps both, the combining step could fail with `assert row is not None` using 7.0.2. This was due to a race condition that has always been possible and is still possible. In 7.0.1 and before, the error was silently swallowed by the combining code. Now it will produce a message "Couldn't combine data file" and ignore the data file as it used to do before 7.0.2. Closes `issue 1522`\_. .. \_issue 1522:[https://github.com/nedbat/coveragepy/issues/1522](https://togithub.com/nedbat/coveragepy/issues/1522)2 .. \_changes\_7-0-2: ### [`v7.0.2`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-702--2023-01-02) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.1...7.0.2) - Fix: when using the `[run] relative_files = True` setting, a relative `[paths]` pattern was still being made absolute. This is now fixed, closing `issue 1519`\_. - Fix: if Python doesn't provide tomllib, then TOML configuration files can only be read if coverage.py is installed with the `[toml]` extra. Coverage.py will raise an error if TOML support is not installed when it sees your settings are in a .toml file. But it didn't understand that `[tools.coverage]` was a valid section header, so the error wasn't reported if you used that header, and settings were silently ignored. This is now fixed, closing `issue 1516`\_. - Fix: adjusted how decorators are traced on PyPy 7.3.10, fixing `issue 1515`\_. - Fix: the `coverage lcov` report did not properly implement the `--fail-under=MIN` option. This has been fixed. - Refactor: added many type annotations, including a number of refactorings. This should not affect outward behavior, but they were a bit invasive in some places, so keep your eyes peeled for oddities. - Refactor: removed the vestigial and long untested support for Jython and IronPython. .. \_issue 1515:[https://github.com/nedbat/coveragepy/issues/1515](https://togithub.com/nedbat/coveragepy/issues/1515)5 .. \_issue 1516[https://github.com/nedbat/coveragepy/issues/1516](https://togithub.com/nedbat/coveragepy/issues/1516)16 .. \_issue 151[https://github.com/nedbat/coveragepy/issues/1519](https://togithub.com/nedbat/coveragepy/issues/1519)519 .. \_changes\_7-0-1: ### [`v7.0.1`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-701--2022-12-23) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.0...7.0.1) - When checking if a file mapping resolved to a file that exists, we weren't considering files in .whl files. This is now fixed, closing `issue 1511`\_. - File pattern rules were too strict, forbidding plus signs and curly braces in directory and file names. This is now fixed, closing `issue 1513`\_. - Unusual Unicode or control characters in source files could prevent reporting. This is now fixed, closing `issue 1512`\_. - The PyPy wheel now installs on PyPy 3.7, 3.8, and 3.9, closing `issue 1510`\_. .. \_issue 1510:[https://github.com/nedbat/coveragepy/issues/1510](https://togithub.com/nedbat/coveragepy/issues/1510)0 .. \_issue 1511[https://github.com/nedbat/coveragepy/issues/1511](https://togithub.com/nedbat/coveragepy/issues/1511)11 .. \_issue 151[https://github.com/nedbat/coveragepy/issues/1512](https://togithub.com/nedbat/coveragepy/issues/1512)512 .. \_issue 15[https://github.com/nedbat/coveragepy/issues/1513](https://togithub.com/nedbat/coveragepy/issues/1513)1513 .. \_changes\_7-0-0: ### [`v7.0.0`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-700--2022-12-18) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/6.5.0...7.0.0) Nothing new beyond 7.0.0b1. .. \_changes\_7-0-0b1: </details> <details> <summary>squidfunk/mkdocs-material</summary> ### [`v9.0.9`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.9): mkdocs-material-9.0.9 [Compare Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.8...9.0.9) - Updated Bulgarian translations - Updated Chinese (Simplified) translations - Updated Dutch translations - Updated Hindi translations - Updated Japanese translations - Updated Polish translations ### [`v9.0.8`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.8): mkdocs-material-9.0.8 [Compare Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.7...9.0.8) - Updated Croatian translations - Updated French translations - Updated Hungarian translations - Updated Portuguese (Brasilian) translations - Updated Spanish translations - Updated Ukrainian translations - Updated Urdu translations - Updated Vietnamese translations ### [`v9.0.7`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.7): mkdocs-material-9.0.7 [Compare Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.6...9.0.7) - Improved accessibility of sidebar navigation - Moved all translations into community edition - Updated Polish and Portuguese (Brasilian) translations - Fixed info plugin terminating on subsequent reload when serving - Fixed [#​4910](https://togithub.com/squidfunk/mkdocs-material/issues/4910): Sidebar navigation labels have invalid ARIA roles - Fixed [#​4884](https://togithub.com/squidfunk/mkdocs-material/issues/4884): Search query terms can't be separated by colons ### [`v9.0.6`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.6): mkdocs-material-9.0.6 [Compare Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.5...9.0.6) - Fixed [#​4883](https://togithub.com/squidfunk/mkdocs-material/issues/4883): Automatically disable info plugin when serving - Fixed [#​4885](https://togithub.com/squidfunk/mkdocs-material/issues/4885): Search plugin crashes in some exotic cases (9.0.3 regression) ### [`v9.0.5`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.5): mkdocs-material-9.0.5 [Compare Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.4...9.0.5) - Fixed [#​4842](https://togithub.com/squidfunk/mkdocs-material/issues/4842): Improved accessibility of search result list ### [`v9.0.4`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.4): mkdocs-material-9.0.4 [Compare Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.3...9.0.4) - Fixed [#​4823](https://togithub.com/squidfunk/mkdocs-material/issues/4823): Improved contrast ratio in footer (9.0.2 regression) - Fixed [#​4832](https://togithub.com/squidfunk/mkdocs-material/issues/4832): Set navigation items back to black (9.0.3 regression) - Fixed [#​4843](https://togithub.com/squidfunk/mkdocs-material/issues/4843): Emojis broken due to `maxcdn.com` shutting down - Upgraded Python Markdown Extensions to 9.9.1 ### [`v9.0.3`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.3): mkdocs-material-9.0.3 [Compare Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.2...9.0.3) - Improved discernability of section index pages in navigation - Improved collapsing of adjacent whitespace in search plugin - Updated Indonesian translations - Fixed view source of this page button when edit URL points to blob - Fixed [#​4829](https://togithub.com/squidfunk/mkdocs-material/issues/4829): Search overlay does not close for active anchor result - Fixed [#​4824](https://togithub.com/squidfunk/mkdocs-material/issues/4824): Search plugin crashes for `h[1-6]` contained in other elements - Fixed [#​4804](https://togithub.com/squidfunk/mkdocs-material/issues/4804): Nested navigation items not expandable with keyboard - Fixed [#​4689](https://togithub.com/squidfunk/mkdocs-material/issues/4689): anchor tracking not working for anchors in tables - Upgraded to Mermaid 9.3.0 ### [`v9.0.2`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.2): mkdocs-material-9.0.2 [Compare Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.1...9.0.2) - Fixed [#​4823](https://togithub.com/squidfunk/mkdocs-material/issues/4823): Improved contrast ratio in footer to meet WCAG guidelines - Fixed [#​4819](https://togithub.com/squidfunk/mkdocs-material/issues/4819): Social plugin crashes when card generation is disabled - Fixed [#​4817](https://togithub.com/squidfunk/mkdocs-material/issues/4817): Search plugin crashes on numeric page titles in `nav` ### [`v9.0.1`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.1): mkdocs-material-9.0.1 [Compare Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.0...9.0.1) - Removed `pipdeptree` dependency for built-in info plugin - Fixed appearance of linked tags when hovered (9.0.0 regression) - Fixed [#​4810](https://togithub.com/squidfunk/mkdocs-material/issues/4810): Abbreviations run out of screen on touch devices - Fixed [#​4813](https://togithub.com/squidfunk/mkdocs-material/issues/4813): View source and edit button links are the same ### [`v9.0.0`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.0): mkdocs-material-9.0.0 [Compare Source](https://togithub.com/squidfunk/mkdocs-material/compare/8.5.11...9.0.0) **Additions and improvements** - Added support for rich search previews - Added support for tokenizer lookahead - Added support for better search highlighting - Added support for excluding content from search - Added support for configurable search pipeline - Added support for offline search via offline plugin - Added support for multiple instances of built-in tags plugin - Added support for removing copy-to-clipboard button - Added support for removing footer navigation - Added support for button to view the source of a page - Improved readability of query string for search sharing - Improved stability of search plugin when using `--dirtyreload` - Improved search result group button, now sticky and stable - Updated Norwegian translations - Updated MkDocs to 1.4.2 **Removals** - Removed deprecated alternative admonition qualifiers - Removed `:is()` selectors (in output) for easier overriding - Removed `.title` suffix on translations - Removed legacy method for providing page title in feedback URL - Removed support for indexing only titles in search - Removed support for custom search transforms - Removed support for custom search workers - Removed temporary snow feature (easter egg) **Fixes** - Fixed Norwegian and Korean language code - Fixed detection of composition events in search interface - Fixed search plugin not using title set via front matter - Fixed search highlighting of tags - Fixed search sharing URL using post transformed string - Fixed theme-color meta tag getting out-of-sync with palette toggle - Fixed prev/next page keyboard navigation when footer is not present - Fixed overflowing navigation tabs not being scrollable - Fixed inclusion of code block line numbers from search </details> <details> <summary>testing-cabal/mock</summary> ### [`v5.0.1`](https://togithub.com/testing-cabal/mock/blob/HEAD/CHANGELOG.rst#​501) [Compare Source](https://togithub.com/testing-cabal/mock/compare/5.0.0...5.0.1) - [gh-100740](https://togithub.com/testing-cabal/mock/issues/100740): Fix `unittest.mock.Mock` not respecting the spec for attribute names prefixed with `assert`. - [gh-100690](https://togithub.com/testing-cabal/mock/issues/100690): `Mock` objects which are not unsafe will now raise an `AttributeError` when accessing an attribute that matches the name of an assertion but without the prefix `assert_`, e.g. accessing `called_once` instead of `assert_called_once`. This is in addition to this already happening for accessing attributes with prefixes `assert`, `assret`, `asert`, `aseert`, and `assrt`. - [gh-96127](https://togithub.com/testing-cabal/mock/issues/96127): `inspect.signature` was raising `TypeError` on call with mock objects. Now it correctly returns `(*args, **kwargs)` as infered signature. ### [`v5.0.0`](https://togithub.com/testing-cabal/mock/blob/HEAD/CHANGELOG.rst#​500) [Compare Source](https://togithub.com/testing-cabal/mock/compare/4.0.3...5.0.0) - [gh-98624](https://togithub.com/testing-cabal/mock/issues/98624): Add a mutex to unittest.mock.NonCallableMock to protect concurrent access to mock attributes. - bpo-43478: Mocks can no longer be used as the specs for other Mocks. As a result, an already-mocked object cannot have an attribute mocked using `autospec=True` or be the subject of a `create_autospec(...)` call. This can uncover bugs in tests since these Mock-derived Mocks will always pass certain tests (e.g. isinstance) and builtin assert functions (e.g. assert_called_once_with) will unconditionally pass. - bpo-45156: Fixes infinite loop on :func:`unittest.mock.seal` of mocks created by :func:`~unittest.create_autospec`. - bpo-41403: Make :meth:`mock.patch` raise a :exc:`TypeError` with a relevant error message on invalid arg. Previously it allowed a cryptic :exc:`AttributeError` to escape. - [gh-91803](https://togithub.com/testing-cabal/mock/issues/91803): Fix an error when using a method of objects mocked with :func:`unittest.mock.create_autospec` after it was sealed with :func:`unittest.mock.seal` function. - bpo-41877: AttributeError for suspected misspellings of assertions on mocks are now pointing out that the cause are misspelled assertions and also what to do if the misspelling is actually an intended attribute name. The unittest.mock document is also updated to reflect the current set of recognised misspellings. - bpo-43478: Mocks can no longer be provided as the specs for other Mocks. As a result, an already-mocked object cannot be passed to `mock.Mock()`. This can uncover bugs in tests since these Mock-derived Mocks will always pass certain tests (e.g. isinstance) and builtin assert functions (e.g. assert_called_once_with) will unconditionally pass. - bpo-45010: Remove support of special method `__div__` in :mod:`unittest.mock`. It is not used in Python 3. - [gh-84753](https://togithub.com/testing-cabal/mock/issues/84753): :func:`inspect.iscoroutinefunction` now properly returns `True` when an instance of :class:`unittest.mock.AsyncMock` is passed to it. This makes it consistent with behavior of :func:`asyncio.iscoroutinefunction`. Patch by Mehdi ABAAKOUK. - bpo-46852: Remove the undocumented private `float.__set_format__()` method, previously known as `float.__setformat__()` in Python 3.7. Its docstring said: "You probably don't want to use this function. It exists mainly to be used in Python's test suite." Patch by Victor Stinner. - [gh-98086](https://togithub.com/testing-cabal/mock/issues/98086): Make sure `patch.dict()` can be applied on async functions. - [gh-100287](https://togithub.com/testing-cabal/mock/issues/100287): Fix the interaction of :func:`unittest.mock.seal` with :class:`unittest.mock.AsyncMock`. - [gh-83076](https://togithub.com/testing-cabal/mock/issues/83076): Instantiation of `Mock()` and `AsyncMock()` is now 3.8x faster. - bpo-41877: A check is added against misspellings of autospect, auto_spec and set_spec being passed as arguments to patch, patch.object and create_autospec. </details> <details> <summary>pre-commit/pre-commit</summary> ### [`v3.0.2`](https://togithub.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#​302---2023-01-29) [Compare Source](https://togithub.com/pre-commit/pre-commit/compare/v3.0.1...v3.0.2) \================== ##### Fixes - Prevent local `Gemfile` from interfering with hook execution. - [#​2727](https://togithub.com/pre-commit/pre-commit/issues/2727) PR by [@​asottile](https://togithub.com/asottile). - Fix `language: r`, `repo: local` hooks - [pre-commit-ci/issues#​107](https://togithub.com/pre-commit-ci/issues/issues/107) by [@​lorenzwalthert](https://togithub.com/lorenzwalthert). - [#​2728](https://togithub.com/pre-commit/pre-commit/issues/2728) PR by [@​asottile](https://togithub.com/asottile). ### [`v3.0.1`](https://togithub.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#​301---2023-01-26) [Compare Source](https://togithub.com/pre-commit/pre-commit/compare/v3.0.0...v3.0.1) \================== ##### Fixes - Ensure coursier hooks are available offline after install. - [#​2723](https://togithub.com/pre-commit/pre-commit/issues/2723) PR by [@​asottile](https://togithub.com/asottile). ### [`v3.0.0`](https://togithub.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#​300---2023-01-23) [Compare Source](https://togithub.com/pre-commit/pre-commit/compare/v2.21.0...v3.0.0) \================== ##### Features - Make `language: golang` bootstrap `go` if not present. - [#​2651](https://togithub.com/pre-commit/pre-commit/issues/2651) PR by [@​taoufik07](https://togithub.com/taoufik07). - [#​2649](https://togithub.com/pre-commit/pre-commit/issues/2649) issue by [@​taoufik07](https://togithub.com/taoufik07). - `language: coursier` now supports `additional_dependencies` and `repo: local` - [#​2702](https://togithub.com/pre-commit/pre-commit/issues/2702) PR by [@​asottile](https://togithub.com/asottile). - Upgrade `ruby-build` to `20221225`. - [#​2718](https://togithub.com/pre-commit/pre-commit/issues/2718) PR by [@​jalessio](https://togithub.com/jalessio). ##### Fixes - Improve error message for invalid yaml for `pre-commit autoupdate`. - [#​2686](https://togithub.com/pre-commit/pre-commit/issues/2686) PR by [@​asottile](https://togithub.com/asottile). - [#​2685](https://togithub.com/pre-commit/pre-commit/issues/2685) issue by [@​CarstenGrohmann](https://togithub.com/CarstenGrohmann). - `repo: local` no longer provisions an empty `git` repo. - [#​2699](https://togithub.com/pre-commit/pre-commit/issues/2699) PR by [@​asottile](https://togithub.com/asottile). ##### Updating - Drop support for python<3.8 - [#​2655](https://togithub.com/pre-commit/pre-commit/issues/2655) PR by [@​asottile](https://togithub.com/asottile). - Drop support for top-level list, use `pre-commit migrate-config` to update. - [#​2656](https://togithub.com/pre-commit/pre-commit/issues/2656) PR by [@​asottile](https://togithub.com/asottile). - Drop support for `sha` to specify revision, use `pre-commit migrate-config` to update. - [#​2657](https://togithub.com/pre-commit/pre-commit/issues/2657) PR by [@​asottile](https://togithub.com/asottile). - Remove `pre-commit-validate-config` and `pre-commit-validate-manifest`, use `pre-commit validate-config` and `pre-commit validate-manifest` instead. - [#​2658](https://togithub.com/pre-commit/pre-commit/issues/2658) PR by [@​asottile](https://togithub.com/asottile). - `language: golang` hooks must use `go.mod` to specify dependencies - [#​2672](https://togithub.com/pre-commit/pre-commit/issues/2672) PR by [@​taoufik07](https://togithub.com/taoufik07). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/RobertCraigie/prisma-client-py). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC42Mi4xIiwidXBkYXRlZEluVmVyIjoiMzQuMTE5LjAifQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Robert Craigie <[email protected]>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [coverage](https://togithub.com/nedbat/coveragepy) | `==6.4.2` -> `==7.1.0` | [![age](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/compatibility-slim/6.4.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/confidence-slim/6.4.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>nedbat/coveragepy</summary> ### [`v7.1.0`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-710--2023-01-24) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.5...7.1.0) - Added: the debug output file can now be specified with `[run] debug_file` in the configuration file. Closes `issue 1319`\_. - Performance: fixed a slowdown with dynamic contexts that's been around since 6.4.3. The fix closes `issue 1538`*. Thankfully this doesn't break the `Cython change`* that fixed `issue 972`\_. Thanks to Mathieu Kniewallner for the deep investigative work and comprehensive issue report. - Typing: all product and test code has type annotations. .. \_Cython change:[https://github.com/nedbat/coveragepy/pull/1347](https://togithub.com/nedbat/coveragepy/pull/1347)7 .. \_issue 972[https://github.com/nedbat/coveragepy/issues/972](https://togithub.com/nedbat/coveragepy/issues/972)72 .. \_issue 131[https://github.com/nedbat/coveragepy/issues/1319](https://togithub.com/nedbat/coveragepy/issues/1319)319 .. \_issue 15[https://github.com/nedbat/coveragepy/issues/1538](https://togithub.com/nedbat/coveragepy/issues/1538)1538 .. \_changes\_7-0-5: ### [`v7.0.5`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-705--2023-01-10) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.4...7.0.5) - Fix: On Python 3.7, a file with type annotations but no `from __future__ import annotations` would be missing statements in the coverage report. This is now fixed, closing `issue 1524`\_. .. \_issue 1524:[https://github.com/nedbat/coveragepy/issues/1524](https://togithub.com/nedbat/coveragepy/issues/1524)4 .. \_changes\_7-0-4: ### [`v7.0.4`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-704--2023-01-07) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.3...7.0.4) - Performance: an internal cache of file names was accidentally disabled, resulting in sometimes drastic reductions in performance. This is now fixed, closing `issue 1527`\_. Thanks to Ivan Ciuvalschii for the reproducible test case. .. \_issue 1527:[https://github.com/nedbat/coveragepy/issues/1527](https://togithub.com/nedbat/coveragepy/issues/1527)7 .. \_changes\_7-0-3: ### [`v7.0.3`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-703--2023-01-03) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.2...7.0.3) - Fix: when using pytest-cov or pytest-xdist, or perhaps both, the combining step could fail with `assert row is not None` using 7.0.2. This was due to a race condition that has always been possible and is still possible. In 7.0.1 and before, the error was silently swallowed by the combining code. Now it will produce a message "Couldn't combine data file" and ignore the data file as it used to do before 7.0.2. Closes `issue 1522`\_. .. \_issue 1522:[https://github.com/nedbat/coveragepy/issues/1522](https://togithub.com/nedbat/coveragepy/issues/1522)2 .. \_changes\_7-0-2: ### [`v7.0.2`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-702--2023-01-02) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.1...7.0.2) - Fix: when using the `[run] relative_files = True` setting, a relative `[paths]` pattern was still being made absolute. This is now fixed, closing `issue 1519`\_. - Fix: if Python doesn't provide tomllib, then TOML configuration files can only be read if coverage.py is installed with the `[toml]` extra. Coverage.py will raise an error if TOML support is not installed when it sees your settings are in a .toml file. But it didn't understand that `[tools.coverage]` was a valid section header, so the error wasn't reported if you used that header, and settings were silently ignored. This is now fixed, closing `issue 1516`\_. - Fix: adjusted how decorators are traced on PyPy 7.3.10, fixing `issue 1515`\_. - Fix: the `coverage lcov` report did not properly implement the `--fail-under=MIN` option. This has been fixed. - Refactor: added many type annotations, including a number of refactorings. This should not affect outward behavior, but they were a bit invasive in some places, so keep your eyes peeled for oddities. - Refactor: removed the vestigial and long untested support for Jython and IronPython. .. \_issue 1515:[https://github.com/nedbat/coveragepy/issues/1515](https://togithub.com/nedbat/coveragepy/issues/1515)5 .. \_issue 1516[https://github.com/nedbat/coveragepy/issues/1516](https://togithub.com/nedbat/coveragepy/issues/1516)16 .. \_issue 151[https://github.com/nedbat/coveragepy/issues/1519](https://togithub.com/nedbat/coveragepy/issues/1519)519 .. \_changes\_7-0-1: ### [`v7.0.1`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-701--2022-12-23) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.0...7.0.1) - When checking if a file mapping resolved to a file that exists, we weren't considering files in .whl files. This is now fixed, closing `issue 1511`\_. - File pattern rules were too strict, forbidding plus signs and curly braces in directory and file names. This is now fixed, closing `issue 1513`\_. - Unusual Unicode or control characters in source files could prevent reporting. This is now fixed, closing `issue 1512`\_. - The PyPy wheel now installs on PyPy 3.7, 3.8, and 3.9, closing `issue 1510`\_. .. \_issue 1510:[https://github.com/nedbat/coveragepy/issues/1510](https://togithub.com/nedbat/coveragepy/issues/1510)0 .. \_issue 1511[https://github.com/nedbat/coveragepy/issues/1511](https://togithub.com/nedbat/coveragepy/issues/1511)11 .. \_issue 151[https://github.com/nedbat/coveragepy/issues/1512](https://togithub.com/nedbat/coveragepy/issues/1512)512 .. \_issue 15[https://github.com/nedbat/coveragepy/issues/1513](https://togithub.com/nedbat/coveragepy/issues/1513)1513 .. \_changes\_7-0-0: ### [`v7.0.0`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-700--2022-12-18) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/6.5.0...7.0.0) Nothing new beyond 7.0.0b1. .. \_changes\_7-0-0b1: ### [`v6.5.0`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-650--2022-09-29) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/6.4.4...6.5.0) - The JSON report now includes details of which branches were taken, and which are missing for each file. Thanks, `Christoph Blessing <pull 1438_>`*. Closes `issue 1425`*. - Starting with coverage.py 6.2, `class` statements were marked as a branch. This wasn't right, and has been reverted, fixing `issue 1449`\_. Note this will very slightly reduce your coverage total if you are measuring branch coverage. - Packaging is now compliant with `PEP 517`*, closing `issue 1395`*. - A new debug option `--debug=pathmap` shows details of the remapping of paths that happens during combine due to the `[paths]` setting. - Fix an internal problem with caching of invalid Python parsing. Found by OSS-Fuzz, fixing their `bug 50381`\_. .. \_bug 50381: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50381 .. \_PEP 517: https://peps.python.org/pep-0517/ .. \_issue 139[https://github.com/nedbat/coveragepy/issues/1395](https://togithub.com/nedbat/coveragepy/issues/1395)395 .. \_issue 14[https://github.com/nedbat/coveragepy/issues/1425](https://togithub.com/nedbat/coveragepy/issues/1425)1425 .. \_issue 1[https://github.com/nedbat/coveragepy/issues/1449](https://togithub.com/nedbat/coveragepy/issues/1449)/1449 .. \_pull [https://github.com/nedbat/coveragepy/pull/1438](https://togithub.com/nedbat/coveragepy/pull/1438)l/1438 .. \_changes\_6-4-4: ### [`v6.4.4`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-644--2022-08-16) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/6.4.3...6.4.4) - Wheels are now provided for Python 3.11. .. \_changes\_6-4-3: ### [`v6.4.3`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-643--2022-08-06) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/6.4.2...6.4.3) - Fix a failure when combining data files if the file names contained glob-like patterns. Thanks, `Michael Krebs and Benjamin Schubert <pull 1405_>`\_. - Fix a messaging failure when combining Windows data files on a different drive than the current directory, closing `issue 1428`*. Thanks, `Lorenzo Micò <pull 1430_>`*. - Fix path calculations when running in the root directory, as you might do in a Docker container. Thanks `Arthur Rio <pull 1403_>`\_. - Filtering in the HTML report wouldn't work when reloading the index page. This is now fixed. Thanks, `Marc Legendre <pull 1413_>`\_. - Fix a problem with Cython code measurement, closing `issue 972`*. Thanks, `Matus Valo <pull 1347_>`*. .. \_issue 972:[https://github.com/nedbat/coveragepy/issues/972](https://togithub.com/nedbat/coveragepy/issues/972)2 .. \_issue 1428[https://github.com/nedbat/coveragepy/issues/1428](https://togithub.com/nedbat/coveragepy/issues/1428)28 .. \_pull 134[https://github.com/nedbat/coveragepy/pull/1347](https://togithub.com/nedbat/coveragepy/pull/1347)347 .. \_pull 14[https://github.com/nedbat/coveragepy/issues/1403](https://togithub.com/nedbat/coveragepy/issues/1403)1403 .. \_pull 1[https://github.com/nedbat/coveragepy/issues/1405](https://togithub.com/nedbat/coveragepy/issues/1405)/1405 .. \_pull [https://github.com/nedbat/coveragepy/issues/1413](https://togithub.com/nedbat/coveragepy/issues/1413)s/1413 .. \_pull[https://github.com/nedbat/coveragepy/pull/1430](https://togithub.com/nedbat/coveragepy/pull/1430)ll/1430 .. \_changes\_6-4-2: </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/allenporter/flux-local). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMjQuMiIsInVwZGF0ZWRJblZlciI6IjM0LjEyNC4yIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Version 7.2.5 — 2023-04-30 -------------------------- - Fix: ``html_report()`` could fail with an AttributeError on ``isatty`` if run in an unusual environment where sys.stdout had been replaced. This is now fixed. Version 7.2.4 — 2023-04-28 -------------------------- PyCon 2023 sprint fixes! - Fix: with ``relative_files = true``, specifying a specific file to include or omit wouldn't work correctly (`issue 1604`_). This is now fixed, with testing help by `Marc Gibbons <pull 1608_>`_. - Fix: the XML report would have an incorrect ``<source>`` element when using relative files and the source option ended with a slash (`issue 1541`_). This is now fixed, thanks to `Kevin Brown-Silva <pull 1608_>`_. - When the HTML report location is printed to the terminal, it's now a terminal-compatible URL, so that you can click the location to open the HTML file in your browser. Finishes `issue 1523`_ thanks to `Ricardo Newbery <pull 1613_>`_. - Docs: a new :ref:`Migrating page <migrating>` with details about how to migrate between major versions of coverage.py. It currently covers the wildcard changes in 7.x. Thanks, `Brian Grohe <pull 1610_>`_. .. _issue 1523: nedbat/coveragepy#1523 .. _issue 1541: nedbat/coveragepy#1541 .. _issue 1604: nedbat/coveragepy#1604 .. _pull 1608: nedbat/coveragepy#1608 .. _pull 1609: nedbat/coveragepy#1609 .. _pull 1610: nedbat/coveragepy#1610 .. _pull 1613: nedbat/coveragepy#1613 Version 7.2.3 — 2023-04-06 -------------------------- - Fix: the :ref:`config_run_sigterm` setting was meant to capture data if a process was terminated with a SIGTERM signal, but it didn't always. This was fixed thanks to `Lewis Gaul <pull 1600_>`_, closing `issue 1599`_. - Performance: HTML reports with context information are now much more compact. File sizes are typically as small as one-third the previous size, but can be dramatically smaller. This closes `issue 1584`_ thanks to `Oleh Krehel <pull 1587_>`_. - Development dependencies no longer use hashed pins, closing `issue 1592`_. .. _issue 1584: nedbat/coveragepy#1584 .. _pull 1587: nedbat/coveragepy#1587 .. _issue 1592: nedbat/coveragepy#1592 .. _issue 1599: nedbat/coveragepy#1599 .. _pull 1600: nedbat/coveragepy#1600 Version 7.2.2 — 2023-03-16 -------------------------- - Fix: if a virtualenv was created inside a source directory, and a sourced package was installed inside the virtualenv, then all of the third-party packages inside the virtualenv would be measured. This was incorrect, but has now been fixed: only the specified packages will be measured, thanks to `Manuel Jacob <pull 1560_>`_. - Fix: the ``coverage lcov`` command could create a .lcov file with incorrect LF (lines found) and LH (lines hit) totals. This is now fixed, thanks to `Ian Moore <pull 1583_>`_. - Fix: the ``coverage xml`` command on Windows could create a .xml file with duplicate ``<package>`` elements. This is now fixed, thanks to `Benjamin Parzella <pull 1574_>`_, closing `issue 1573`_. .. _pull 1560: nedbat/coveragepy#1560 .. _issue 1573: nedbat/coveragepy#1573 .. _pull 1574: nedbat/coveragepy#1574 .. _pull 1583: nedbat/coveragepy#1583 Version 7.2.1 — 2023-02-26 -------------------------- - Fix: the PyPI page had broken links to documentation pages, but no longer does, closing `issue 1566`_. - Fix: public members of the coverage module are now properly indicated so that mypy will find them, fixing `issue 1564`_. .. _issue 1564: nedbat/coveragepy#1564 .. _issue 1566: nedbat/coveragepy#1566 Version 7.2.0 — 2023-02-22 -------------------------- - Added a new setting ``[report] exclude_also`` to let you add more exclusions without overwriting the defaults. Thanks, `Alpha Chen <pull 1557_>`_, closing `issue 1391`_. - Added a :meth:`.CoverageData.purge_files` method to remove recorded data for a particular file. Contributed by `Stephan Deibel <pull 1547_>`_. - Fix: when reporting commands fail, they will no longer congratulate themselves with messages like "Wrote XML report to file.xml" before spewing a traceback about their failure. - Fix: arguments in the public API that name file paths now accept pathlib.Path objects. This includes the ``data_file`` and ``config_file`` arguments to the Coverage constructor and the ``basename`` argument to CoverageData. Closes `issue 1552`_. - Fix: In some embedded environments, an IndexError could occur on stop() when the originating thread exits before completion. This is now fixed, thanks to `Russell Keith-Magee <pull 1543_>`_, closing `issue 1542`_. - Added a ``py.typed`` file to announce our type-hintedness. Thanks, `KotlinIsland <pull 1550_>`_. .. _issue 1391: nedbat/coveragepy#1391 .. _issue 1542: nedbat/coveragepy#1542 .. _pull 1543: nedbat/coveragepy#1543 .. _pull 1547: nedbat/coveragepy#1547 .. _pull 1550: nedbat/coveragepy#1550 .. _issue 1552: nedbat/coveragepy#1552 .. _pull 1557: nedbat/coveragepy#1557 Version 7.1.0 — 2023-01-24 -------------------------- - Added: the debug output file can now be specified with ``[run] debug_file`` in the configuration file. Closes `issue 1319`_. - Performance: fixed a slowdown with dynamic contexts that's been around since 6.4.3. The fix closes `issue 1538`_. Thankfully this doesn't break the `Cython change`_ that fixed `issue 972`_. Thanks to Mathieu Kniewallner for the deep investigative work and comprehensive issue report. - Typing: all product and test code has type annotations. .. _Cython change: nedbat/coveragepy#1347 .. _issue 972: nedbat/coveragepy#972 .. _issue 1319: nedbat/coveragepy#1319 .. _issue 1538: nedbat/coveragepy#1538 Version 7.0.5 — 2023-01-10 -------------------------- - Fix: On Python 3.7, a file with type annotations but no ``from __future__ import annotations`` would be missing statements in the coverage report. This is now fixed, closing `issue 1524`_. .. _issue 1524: nedbat/coveragepy#1524 Version 7.0.4 — 2023-01-07 -------------------------- - Performance: an internal cache of file names was accidentally disabled, resulting in sometimes drastic reductions in performance. This is now fixed, closing `issue 1527`_. Thanks to Ivan Ciuvalschii for the reproducible test case. .. _issue 1527: nedbat/coveragepy#1527 Version 7.0.3 — 2023-01-03 -------------------------- - Fix: when using pytest-cov or pytest-xdist, or perhaps both, the combining step could fail with ``assert row is not None`` using 7.0.2. This was due to a race condition that has always been possible and is still possible. In 7.0.1 and before, the error was silently swallowed by the combining code. Now it will produce a message "Couldn't combine data file" and ignore the data file as it used to do before 7.0.2. Closes `issue 1522`_. .. _issue 1522: nedbat/coveragepy#1522 Version 7.0.2 — 2023-01-02 -------------------------- - Fix: when using the ``[run] relative_files = True`` setting, a relative ``[paths]`` pattern was still being made absolute. This is now fixed, closing `issue 1519`_. - Fix: if Python doesn't provide tomllib, then TOML configuration files can only be read if coverage.py is installed with the ``[toml]`` extra. Coverage.py will raise an error if TOML support is not installed when it sees your settings are in a .toml file. But it didn't understand that ``[tools.coverage]`` was a valid section header, so the error wasn't reported if you used that header, and settings were silently ignored. This is now fixed, closing `issue 1516`_. - Fix: adjusted how decorators are traced on PyPy 7.3.10, fixing `issue 1515`_. - Fix: the ``coverage lcov`` report did not properly implement the ``--fail-under=MIN`` option. This has been fixed. - Refactor: added many type annotations, including a number of refactorings. This should not affect outward behavior, but they were a bit invasive in some places, so keep your eyes peeled for oddities. - Refactor: removed the vestigial and long untested support for Jython and IronPython. .. _issue 1515: nedbat/coveragepy#1515 .. _issue 1516: nedbat/coveragepy#1516 .. _issue 1519: nedbat/coveragepy#1519 Version 7.0.1 — 2022-12-23 -------------------------- - When checking if a file mapping resolved to a file that exists, we weren't considering files in .whl files. This is now fixed, closing `issue 1511`_. - File pattern rules were too strict, forbidding plus signs and curly braces in directory and file names. This is now fixed, closing `issue 1513`_. - Unusual Unicode or control characters in source files could prevent reporting. This is now fixed, closing `issue 1512`_. - The PyPy wheel now installs on PyPy 3.7, 3.8, and 3.9, closing `issue 1510`_. .. _issue 1510: nedbat/coveragepy#1510 .. _issue 1511: nedbat/coveragepy#1511 .. _issue 1512: nedbat/coveragepy#1512 .. _issue 1513: nedbat/coveragepy#1513 Version 7.0.0 — 2022-12-18 -------------------------- Nothing new beyond 7.0.0b1. Version 7.0.0b1 — 2022-12-03 ---------------------------- A number of changes have been made to file path handling, including pattern matching and path remapping with the ``[paths]`` setting (see :ref:`config_paths`). These changes might affect you, and require you to update your settings. (This release includes the changes from `6.6.0b1 <changes_6-6-0b1_>`_, since 6.6.0 was never released.) - Changes to file pattern matching, which might require updating your configuration: - Previously, ``*`` would incorrectly match directory separators, making precise matching difficult. This is now fixed, closing `issue 1407`_. - Now ``**`` matches any number of nested directories, including none. - Improvements to combining data files when using the :ref:`config_run_relative_files` setting, which might require updating your configuration: - During ``coverage combine``, relative file paths are implicitly combined without needing a ``[paths]`` configuration setting. This also fixed `issue 991`_. - A ``[paths]`` setting like ``*/foo`` will now match ``foo/bar.py`` so that relative file paths can be combined more easily. - The :ref:`config_run_relative_files` setting is properly interpreted in more places, fixing `issue 1280`_. - When remapping file paths with ``[paths]``, a path will be remapped only if the resulting path exists. The documentation has long said the prefix had to exist, but it was never enforced. This fixes `issue 608`_, improves `issue 649`_, and closes `issue 757`_. - Reporting operations now implicitly use the ``[paths]`` setting to remap file paths within a single data file. Combining multiple files still requires the ``coverage combine`` step, but this simplifies some single-file situations. Closes `issue 1212`_ and `issue 713`_. - The ``coverage report`` command now has a ``--format=`` option. The original style is now ``--format=text``, and is the default. - Using ``--format=markdown`` will write the table in Markdown format, thanks to `Steve Oswald <pull 1479_>`_, closing `issue 1418`_. - Using ``--format=total`` will write a single total number to the output. This can be useful for making badges or writing status updates. - Combining data files with ``coverage combine`` now hashes the data files to skip files that add no new information. This can reduce the time needed. Many details affect the speed-up, but for coverage.py's own test suite, combining is about 40% faster. Closes `issue 1483`_. - When searching for completely un-executed files, coverage.py uses the presence of ``__init__.py`` files to determine which directories have source that could have been imported. However, `implicit namespace packages`_ don't require ``__init__.py``. A new setting ``[report] include_namespace_packages`` tells coverage.py to consider these directories during reporting. Thanks to `Felix Horvat <pull 1387_>`_ for the contribution. Closes `issue 1383`_ and `issue 1024`_. - Fixed environment variable expansion in pyproject.toml files. It was overly broad, causing errors outside of coverage.py settings, as described in `issue 1481`_ and `issue 1345`_. This is now fixed, but in rare cases will require changing your pyproject.toml to quote non-string values that use environment substitution. - An empty file has a coverage total of 100%, but used to fail with ``--fail-under``. This has been fixed, closing `issue 1470`_. - The text report table no longer writes out two separator lines if there are no files listed in the table. One is plenty. - Fixed a mis-measurement of a strange use of wildcard alternatives in match/case statements, closing `issue 1421`_. - Fixed internal logic that prevented coverage.py from running on implementations other than CPython or PyPy (`issue 1474`_). - The deprecated ``[run] note`` setting has been completely removed. .. _implicit namespace packages: https://peps.python.org/pep-0420/ .. _issue 608: nedbat/coveragepy#608 .. _issue 649: nedbat/coveragepy#649 .. _issue 713: nedbat/coveragepy#713 .. _issue 757: nedbat/coveragepy#757 .. _issue 991: nedbat/coveragepy#991 .. _issue 1024: nedbat/coveragepy#1024 .. _issue 1212: nedbat/coveragepy#1212 .. _issue 1280: nedbat/coveragepy#1280 .. _issue 1345: nedbat/coveragepy#1345 .. _issue 1383: nedbat/coveragepy#1383 .. _issue 1407: nedbat/coveragepy#1407 .. _issue 1418: nedbat/coveragepy#1418 .. _issue 1421: nedbat/coveragepy#1421 .. _issue 1470: nedbat/coveragepy#1470 .. _issue 1474: nedbat/coveragepy#1474 .. _issue 1481: nedbat/coveragepy#1481 .. _issue 1483: nedbat/coveragepy#1483 .. _pull 1387: nedbat/coveragepy#1387 .. _pull 1479: nedbat/coveragepy#1479 Version 6.6.0b1 — 2022-10-31 ---------------------------- (Note: 6.6.0 final was never released. These changes are part of `7.0.0b1 <changes_7-0-0b1_>`_.) - Changes to file pattern matching, which might require updating your configuration: - Previously, ``*`` would incorrectly match directory separators, making precise matching difficult. This is now fixed, closing `issue 1407`_. - Now ``**`` matches any number of nested directories, including none. - Improvements to combining data files when using the :ref:`config_run_relative_files` setting: - During ``coverage combine``, relative file paths are implicitly combined without needing a ``[paths]`` configuration setting. This also fixed `issue 991`_. - A ``[paths]`` setting like ``*/foo`` will now match ``foo/bar.py`` so that relative file paths can be combined more easily. - The setting is properly interpreted in more places, fixing `issue 1280`_. - Fixed environment variable expansion in pyproject.toml files. It was overly broad, causing errors outside of coverage.py settings, as described in `issue 1481`_ and `issue 1345`_. This is now fixed, but in rare cases will require changing your pyproject.toml to quote non-string values that use environment substitution. - Fixed internal logic that prevented coverage.py from running on implementations other than CPython or PyPy (`issue 1474`_). .. _issue 991: nedbat/coveragepy#991 .. _issue 1280: nedbat/coveragepy#1280 .. _issue 1345: nedbat/coveragepy#1345 .. _issue 1407: nedbat/coveragepy#1407 .. _issue 1474: nedbat/coveragepy#1474 .. _issue 1481: nedbat/coveragepy#1481
Describe the bug
In some of our jobs with 7.0.2, and not with 7.0.1, we commonly, but not always, get this traceback at the end. I expect it is indicative of another issue related to pytest-cov and pytest-xdist... but, none the less, it is a change in a patch release of coverage that may interest you.
https://github.com/Chia-Network/chia-blockchain/actions/runs/3825220672/jobs/6508036405#step:16:558
To Reproduce
How can we reproduce the problem? Please be specific. Don't link to a failing CI job. Answer the questions below:
coverage debug sys
is helpful.pip freeze
is helpful.Successfully installed Jinja2-3.1.2 MarkupSafe-2.1.1 PyYAML-6.0 Pygments-2.14.0 SecretStorage-3.3.3 aiofiles-22.1.0 aiohttp-3.8.3 aiohttp-cors-0.7.0 aiosignal-1.3.1 aiosqlite-0.17.0 altgraph-0.17.3 anyio-3.6.2 argon2-cffi-bindings-21.2.0 argon2_cffi-21.3.0 astroid-2.12.13 asttokens-2.2.1 async-timeout-4.0.2 attrs-22.2.0 backcall-0.2.0 bencode.py-4.0.0 bitstring-3.1.9 black-22.10.0 bleach-5.0.1 blspy-1.0.16 build-0.9.0 certifi-2022.12.7 cffi-1.15.1 cfgv-3.3.1 chardet-5.1.0 charset-normalizer-2.1.1 chia-blockchain-1.7.0b5.dev18 chia-rs-0.1.16 chiabip158-1.1 chiapos-1.0.11 chiavdf-1.0.8 click-8.1.3 clvm-0.9.7 clvm-tools-0.4.6 clvm-tools-rs-0.1.25 colorama-0.4.5 colorlog-6.7.0 commonmark-0.9.1 concurrent-log-handler-0.9.20 coverage-7.0.2 cryptography-38.0.3 decorator-5.1.1 diff-cover-7.3.0 dill-0.3.6 distlib-0.3.6 dnslib-0.9.23 dnspython-2.2.1 docutils-0.19 exceptiongroup-1.1.0 execnet-1.9.0 executing-1.2.0 filelock-3.8.0 flake8-6.0.0 frozenlist-1.3.3 identify-2.5.11 idna-3.4 importlib-metadata-6.0.0 iniconfig-1.1.1 ipython-8.7.0 isort-5.11.4 jaraco.classes-3.2.3 jedi-0.18.2 jeepney-0.8.0 keyring-23.9.3 keyrings.cryptfile-1.3.9 lazy-object-proxy-1.8.0 matplotlib-inline-0.1.6 mccabe-0.7.0 memory-profiler-0.61.0 more-itertools-9.0.0 multidict-6.0.4 mypy-0.991 mypy-extensions-0.4.3 nodeenv-1.7.0 packaging-21.3 parso-0.8.3 pathspec-0.10.3 pep517-0.13.0 pexpect-4.8.0 pickleshare-0.7.5 pkginfo-1.9.2 platformdirs-2.6.2 pluggy-1.0.0 portalocker-2.6.0 pre-commit-2.21.0 prompt-toolkit-3.0.36 psutil-5.9.1 ptyprocess-0.7.0 pure-eval-0.2.2 py3createtorrent-1.1.0 pycodestyle-2.10.0 pycparser-2.21 pycryptodome-3.16.0 pyflakes-3.0.1 pyinstaller-5.6.2 pyinstaller-hooks-contrib-2022.14 pylint-2.15.9 pyparsing-3.0.9 pytest-7.2.0 pytest-asyncio-0.20.3 pytest-cov-4.0.0 pytest-monitor-1.6.5 pytest-xdist-3.1.0 readme-renderer-37.3 requests-2.28.1 requests-toolbelt-0.10.1 rfc3986-2.0.0 rich-13.0.0 setproctitle-1.2.3 six-1.16.0 sniffio-1.3.0 sortedcontainers-2.4.0 stack-data-0.6.2 tomli-2.0.1 tomlkit-0.11.6 traitlets-5.8.0 twine-4.0.2 types-aiofiles-22.1.0.4 types-cryptography-3.3.23.2 types-pkg-resources-0.1.3 types-pyyaml-6.0.12.2 types-setuptools-65.6.0.2 typing-extensions-4.4.0 urllib3-1.26.13 virtualenv-20.17.1 watchdog-2.1.9 wcwidth-0.2.5 webencodings-0.5.1 wrapt-1.14.1 yarl-1.8.2 zipp-3.11.0 zstd-1.5.2.6
pytest --cov=chia --cov=tests --cov-config=.coveragerc --cov-report= --durations=10 -n 4 -m "not benchmark" tests/core/util/test_cached_bls.py tests/core/util/test_config.py tests/core/util/test_file_keyring_synchronization.py tests/core/util/test_files.py tests/core/util/test_jsonify.py tests/core/util/test_keychain.py tests/core/util/test_keyring_wrapper.py tests/core/util/test_lockfile.py tests/core/util/test_lru_cache.py tests/core/util/test_significant_bits.py tests/core/util/test_streamable.py
Expected behavior
No tracebacks as is the case with 7.0.1. Unless... it is deemed that this is an indication of a "real" problem as I expressed concern about above.
Additional context
Chia-Network/chia-blockchain#14255 is where I am reverting to 7.0.1 for now and includes links to a couple other PRs and CI runs where I setup our CI to run the problematic jobs 60 times over to provide a clear "statistical" comparison of the zero failures with 7.0.1 vs., well, many with 7.0.2.
I looked at the refactor of
CoverageData._read_db()
at https://github.com/nedbat/coveragepy/compare/7.0.1..7.0.2#diff-e5185ca855df54af4f94c983f99b52cfad9ddc17386353d09acdfa994dd72a33R287 (you have to expand theLoad diff
message forcoverage/sqldata.py
since GitHub doesn't do it for you) and noticed that while this exception would have previously been caught by theexcept Exception as exc:
clause the unpacking has been moved such that it is no longer mis-detected as a missing table.Side note, this gave me a good chuckle.
https://github.com/nedbat/coveragepy/blob/7.0.2/CHANGES.rst#version-702--2023-01-02
The text was updated successfully, but these errors were encountered: