Skip to content
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

Performance regression in 6.4.3 when using dynamic_context #1538

Closed
mkniewallner opened this issue Jan 19, 2023 · 6 comments
Closed

Performance regression in 6.4.3 when using dynamic_context #1538

mkniewallner opened this issue Jan 19, 2023 · 6 comments
Labels
bug Something isn't working fixed performance Something is too slow

Comments

@mkniewallner
Copy link

Describe the bug
While trying to bump the version of coverage to 6.4.3+ on a project using dynamic_context = test_function, I've noticed an important duration increase when running the tests through coverage, as the CI job went from ~15 minutes to ~30 minutes.

To Reproduce
The bug was reproduced using Python 3.10.9, and the problem seems to appear in all versions of coverage above 6.4.3.

I managed to reproduce the issue on django project, by forking the repository and creating https://github.com/mkniewallner/django/pull/2/files to add dynamic_context = test_function and run the tests through coverage with the following 3 versions (multiple times, to avoid a possible randomness):

I've also created a minimal project to more easily debug the issue: https://github.com/mkniewallner/showcase-coverage-dynamic-context-perf/.

It's important to note that I was only able to reproduce the performance regression when dynamic_context is set to test_function. If disabled, the performance between the 3 versions is about the same.

Output of coverage debug sys
-- sys -------------------------------------------------------
               coverage_version: 6.4.3
                coverage_module: <REDACTED>/.pyenv/versions/3.10.9/envs/showcase-dynamic-context-perf/lib/python3.10/site-packages/coverage/__init__.py
                         tracer: -none-
                        CTracer: available
           plugins.file_tracers: -none-
            plugins.configurers: -none-
      plugins.context_switchers: -none-
              configs_attempted: .coveragerc
                   configs_read: <REDACTED>/showcase_dynamic_context_perf/.coveragerc
                    config_file: <REDACTED>/showcase_dynamic_context_perf/.coveragerc
                config_contents: b'[run]\nsource = a_project\ndynamic_context = test_function\nrelative_files = True\nbranch = True\n'
                      data_file: -none-
                         python: 3.10.9 (main, Dec 13 2022, 10:47:28) [Clang 14.0.0 (clang-1400.0.29.202)]
                       platform: macOS-13.0.1-arm64-arm-64bit
                 implementation: CPython
                     executable: <REDACTED>/.pyenv/versions/3.10.9/envs/showcase-dynamic-context-perf/bin/python3.10
                   def_encoding: utf-8
                    fs_encoding: utf-8
                            pid: 15007
                            cwd: <REDACTED>/showcase_dynamic_context_perf
                           path: <REDACTED>/.pyenv/versions/3.10.9/envs/showcase-dynamic-context-perf/bin
                                 <REDACTED>/.pyenv/versions/3.10.9/lib/python310.zip
                                 <REDACTED>/.pyenv/versions/3.10.9/lib/python3.10
                                 <REDACTED>/.pyenv/versions/3.10.9/lib/python3.10/lib-dynload
                                 <REDACTED>/.pyenv/versions/3.10.9/envs/showcase-dynamic-context-perf/lib/python3.10/site-packages
                    environment: HOME = <REDACTED>
                                 PYENV_ACTIVATE_SHELL = 1
                                 PYENV_DIR = <REDACTED>/showcase_dynamic_context_perf
                                 PYENV_HOOK_PATH = <REDACTED>/.pyenv/pyenv.d:/opt/homebrew/Cellar/pyenv/2.3.11/pyenv.d:/opt/homebrew/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks
                                 PYENV_ROOT = <REDACTED>/.pyenv
                                 PYENV_SHELL = fish
                                 PYENV_VERSION = showcase-dynamic-context-perf
                                 PYENV_VIRTUAL_ENV = <REDACTED>/.pyenv/versions/3.10.9/envs/showcase-dynamic-context-perf
                   command_line: <REDACTED>/.pyenv/versions/showcase-dynamic-context-perf/bin/coverage debug sys
                sqlite3_version: 2.6.0
         sqlite3_sqlite_version: 3.39.4
             sqlite3_temp_store: 0
        sqlite3_compile_options: ATOMIC_INTRINSICS=1, BUG_COMPATIBLE_20160819, CCCRYPT256,
                                 COMPILER=clang-14.0.0, DEFAULT_AUTOVACUUM, DEFAULT_CACHE_SIZE=2000,
                                 DEFAULT_CKPTFULLFSYNC, DEFAULT_FILE_FORMAT=4,
                                 DEFAULT_JOURNAL_SIZE_LIMIT=32768, DEFAULT_LOOKASIDE=1200,102,
                                 DEFAULT_MEMSTATUS=0, DEFAULT_MMAP_SIZE=0, DEFAULT_PAGE_SIZE=4096,
                                 DEFAULT_PCACHE_INITSZ=20, DEFAULT_RECURSIVE_TRIGGERS,
                                 DEFAULT_SECTOR_SIZE=4096, DEFAULT_SYNCHRONOUS=2,
                                 DEFAULT_WAL_AUTOCHECKPOINT=1000, DEFAULT_WAL_SYNCHRONOUS=1,
                                 DEFAULT_WORKER_THREADS=0, ENABLE_API_ARMOR, ENABLE_BYTECODE_VTAB,
                                 ENABLE_COLUMN_METADATA, ENABLE_DBSTAT_VTAB, ENABLE_FTS3,
                                 ENABLE_FTS3_PARENTHESIS, ENABLE_FTS3_TOKENIZER, ENABLE_FTS4, ENABLE_FTS5,
                                 ENABLE_LOCKING_STYLE=1, ENABLE_NORMALIZE, ENABLE_PREUPDATE_HOOK,
                                 ENABLE_RTREE, ENABLE_SESSION, ENABLE_SNAPSHOT, ENABLE_SQLLOG,
                                 ENABLE_STMT_SCANSTATUS, ENABLE_UNKNOWN_SQL_FUNCTION,
                                 ENABLE_UPDATE_DELETE_LIMIT, HAS_CODEC_RESTRICTED, HAVE_ISNAN,
                                 MALLOC_SOFT_LIMIT=1024, MAX_ATTACHED=10, MAX_COLUMN=2000,
                                 MAX_COMPOUND_SELECT=500, MAX_DEFAULT_PAGE_SIZE=8192, MAX_EXPR_DEPTH=1000,
                                 MAX_FUNCTION_ARG=127, MAX_LENGTH=2147483645, MAX_LIKE_PATTERN_LENGTH=50000,
                                 MAX_MMAP_SIZE=1073741824, MAX_PAGE_COUNT=1073741823, MAX_PAGE_SIZE=65536,
                                 MAX_SQL_LENGTH=1000000000, MAX_TRIGGER_DEPTH=1000,
                                 MAX_VARIABLE_NUMBER=500000, MAX_VDBE_OP=250000000, MAX_WORKER_THREADS=8,
                                 MUTEX_UNFAIR, OMIT_AUTORESET, OMIT_LOAD_EXTENSION, STMTJRNL_SPILL=131072,
                                 SYSTEM_MALLOC, TEMP_STORE=1, THREADSAFE=2, USE_URI
Output of pip freeze
coverage==6.4.3

I've run coverage on the project with the following command:

coverage run --debug sql -m unittest discover

and noticed that the output was different between 6.4.2 and 6.4.3/7.0.5.

Output for 6.4.2
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select version from coverage_schema'
EXCEPTION from execute: no such table: coverage_schema
Executing script with 1995 chars: 'CREATE TABLE coverage_schema (\n    -- One row,...foreign key (file_id) references file (id)\n);\n'
Executing 'insert into coverage_schema (version) values (?)' with (7,)
Executing many 'insert or ignore into meta (key, value) values (?, ?)' with 3 rows
Executing "select value from meta where key = 'has_arcs'"
Executing 'select id, path from file'
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'insert or ignore into meta (key, value) values (?, ?)' with ('has_arcs', '1')
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('',)
Executing 'insert into context (context) values (?)' with ('',)
Executing 'insert or replace into file (path) values (?)' with ('a_project/__init__.py',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 2 rows
Executing 'insert or replace into file (path) values (?)' with ('a_project/foo.py',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 2 rows
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('tests.test_foo.FooTestCase.test_foo',)
Executing 'insert into context (context) values (?)' with ('tests.test_foo.FooTestCase.test_foo',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 2 rows
.
----------------------------------------------------------------------
Ran 1 test in 0.005s

OK
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select * from file limit 1'
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Output for 6.4.3/7.0.5
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select version from coverage_schema'
EXCEPTION from execute: no such table: coverage_schema
Executing script with 1995 chars: 'CREATE TABLE coverage_schema (\n    -- One row,...foreign key (file_id) references file (id)\n);\n'
Executing 'insert into coverage_schema (version) values (?)' with (7,)
Executing many 'insert or ignore into meta (key, value) values (?, ?)' with 3 rows
Executing "select value from meta where key = 'has_arcs'"
Executing 'select id, path from file'
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'insert or ignore into meta (key, value) values (?, ?)' with ('has_arcs', '1')
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('',)
Executing 'insert into context (context) values (?)' with ('',)
Executing 'insert or replace into file (path) values (?)' with ('a_project/__init__.py',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 2 rows
Executing 'insert or replace into file (path) values (?)' with ('a_project/foo.py',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 2 rows
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('unittest.case._Outcome.testPartExecutor',)
Executing 'insert into context (context) values (?)' with ('unittest.case._Outcome.testPartExecutor',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('unittest.case._Outcome.testPartExecutor',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('unittest.case._Outcome.testPartExecutor',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('tests.test_foo.FooTestCase.test_foo',)
Executing 'insert into context (context) values (?)' with ('tests.test_foo.FooTestCase.test_foo',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 2 rows
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('unittest.case._Outcome.testPartExecutor',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('unittest.case._Outcome.testPartExecutor',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('unittest.case._Outcome.testPartExecutor',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
.
----------------------------------------------------------------------
Ran 1 test in 0.007s

OK
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select id from context where context = ?' with ('',)
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Executing many 'insert or ignore into arc (file_id, context_id, fromno, tono) values (?, ?, ?, ?)' with 0 rows
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
Executing 'select * from file limit 1'
Connecting to '<REDACTED>/showcase_dynamic_context_perf/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'

We can notice a lot more SQL queries (both selects and inserts attempts with 0 rows) in 6.4.3, that we don't have on 6.4.2.

Looking through the changes between 6.4.3 and 6.4.2, I managed to track down that this is probably caused by f54428f from #1347.

To reproduce:

git clone git@github.com:mkniewallner/showcase-coverage-dynamic-context-perf.git
cd showcase-coverage-dynamic-context-perf

# Create a virtual environment first.

# https://github.com/nedbat/coveragepy/commit/f54428fb8dfe98aacecc0b66e3c1ca2071ce1834
pip install git+https://github.com/nedbat/coveragepy@f54428fb8dfe98aacecc0b66e3c1ca2071ce1834 --force-reinstall
coverage run --debug sql -m unittest discover

# https://github.com/nedbat/coveragepy/commit/6ffb2c331d19d42580bfdaf0c44f5441b9ceb419, previous commit from the one above.
pip install git+https://github.com/nedbat/coveragepy@6ffb2c331d19d42580bfdaf0c44f5441b9ceb419 --force-reinstall
coverage run --debug sql -m unittest discover

Running the coverage command with the first commit gives the same output as the one above with 6.4.3, while running it with the second commit gives the same one as 6.4.2.

Doing the same on the project where the duration increase was originally noticed also shows that the duration is back to normal with the second commit, while it takes 2x more time with the first commit.

Expected behavior
No performance regression between 6.4.2 and 6.4.3.

Additional context
I'd be happy to add additional information if what is provided is not enough.

@mkniewallner mkniewallner added bug Something isn't working needs triage labels Jan 19, 2023
@nedbat
Copy link
Owner

nedbat commented Jan 19, 2023

... if what is provided is not enough.

LOL, this is the most complete bug report I've ever received! You've done plenty, thanks. Now I have to try to understand why it's a good thing for Cython, and what to do about it.

nedbat added a commit that referenced this issue Jan 25, 2023
If the set of arcs is empty, skip the SQL operations.  We also need to
allow setting a file tracer for an unmeasured file, to avoid the Cython
problem whose fix caused the performance issue in the first place.

TBH, I don't know why we had to prevent file tracers on unmeasured
files.  Perhaps pytest-cov has changed to avoid the behavior that caused
problems.
@nedbat
Copy link
Owner

nedbat commented Jan 25, 2023

This is fixed in commit 4cc3292.

@nedbat nedbat closed this as completed Jan 25, 2023
@nedbat nedbat added performance Something is too slow fixed and removed needs triage labels Jan 25, 2023
@nedbat
Copy link
Owner

nedbat commented Jan 25, 2023

This is now released as part of coverage 7.1.0.

RobertCraigie referenced this issue in RobertCraigie/prisma-client-py Feb 1, 2023
[![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://github.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://github.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://github.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://github.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://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-710--2023-01-24)

[Compare
Source](https://github.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://github.com/nedbat/coveragepy/pull/1347)7
.. \_issue
972[https://github.com/nedbat/coveragepy/issues/972](https://github.com/nedbat/coveragepy/issues/972)72
.. \_issue
131[https://github.com/nedbat/coveragepy/issues/1319](https://github.com/nedbat/coveragepy/issues/1319)319
.. \_issue
15[https://github.com/nedbat/coveragepy/issues/1538](https://github.com/nedbat/coveragepy/issues/1538)1538

.. \_changes\_7-0-5:

###
[`v7.0.5`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-705--2023-01-10)

[Compare
Source](https://github.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://github.com/nedbat/coveragepy/issues/1524)4

.. \_changes\_7-0-4:

###
[`v7.0.4`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-704--2023-01-07)

[Compare
Source](https://github.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://github.com/nedbat/coveragepy/issues/1527)7

.. \_changes\_7-0-3:

###
[`v7.0.3`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-703--2023-01-03)

[Compare
Source](https://github.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://github.com/nedbat/coveragepy/issues/1522)2

.. \_changes\_7-0-2:

###
[`v7.0.2`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-702--2023-01-02)

[Compare
Source](https://github.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://github.com/nedbat/coveragepy/issues/1515)5
.. \_issue
1516[https://github.com/nedbat/coveragepy/issues/1516](https://github.com/nedbat/coveragepy/issues/1516)16
.. \_issue
151[https://github.com/nedbat/coveragepy/issues/1519](https://github.com/nedbat/coveragepy/issues/1519)519

.. \_changes\_7-0-1:

###
[`v7.0.1`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-701--2022-12-23)

[Compare
Source](https://github.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://github.com/nedbat/coveragepy/issues/1510)0
.. \_issue
1511[https://github.com/nedbat/coveragepy/issues/1511](https://github.com/nedbat/coveragepy/issues/1511)11
.. \_issue
151[https://github.com/nedbat/coveragepy/issues/1512](https://github.com/nedbat/coveragepy/issues/1512)512
.. \_issue
15[https://github.com/nedbat/coveragepy/issues/1513](https://github.com/nedbat/coveragepy/issues/1513)1513

.. \_changes\_7-0-0:

###
[`v7.0.0`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-700--2022-12-18)

[Compare
Source](https://github.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://github.com/squidfunk/mkdocs-material/releases/tag/9.0.9):
mkdocs-material-9.0.9

[Compare
Source](https://github.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://github.com/squidfunk/mkdocs-material/releases/tag/9.0.8):
mkdocs-material-9.0.8

[Compare
Source](https://github.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://github.com/squidfunk/mkdocs-material/releases/tag/9.0.7):
mkdocs-material-9.0.7

[Compare
Source](https://github.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
[#&#8203;4910](https://github.com/squidfunk/mkdocs-material/issues/4910):
Sidebar navigation labels have invalid ARIA roles
- Fixed
[#&#8203;4884](https://github.com/squidfunk/mkdocs-material/issues/4884):
Search query terms can't be separated by colons

###
[`v9.0.6`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.0.6):
mkdocs-material-9.0.6

[Compare
Source](https://github.com/squidfunk/mkdocs-material/compare/9.0.5...9.0.6)

- Fixed
[#&#8203;4883](https://github.com/squidfunk/mkdocs-material/issues/4883):
Automatically disable info plugin when serving
- Fixed
[#&#8203;4885](https://github.com/squidfunk/mkdocs-material/issues/4885):
Search plugin crashes in some exotic cases (9.0.3 regression)

###
[`v9.0.5`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.0.5):
mkdocs-material-9.0.5

[Compare
Source](https://github.com/squidfunk/mkdocs-material/compare/9.0.4...9.0.5)

- Fixed
[#&#8203;4842](https://github.com/squidfunk/mkdocs-material/issues/4842):
Improved accessibility of search result list

###
[`v9.0.4`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.0.4):
mkdocs-material-9.0.4

[Compare
Source](https://github.com/squidfunk/mkdocs-material/compare/9.0.3...9.0.4)

- Fixed
[#&#8203;4823](https://github.com/squidfunk/mkdocs-material/issues/4823):
Improved contrast ratio in footer (9.0.2 regression)
- Fixed
[#&#8203;4832](https://github.com/squidfunk/mkdocs-material/issues/4832):
Set navigation items back to black (9.0.3 regression)
- Fixed
[#&#8203;4843](https://github.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://github.com/squidfunk/mkdocs-material/releases/tag/9.0.3):
mkdocs-material-9.0.3

[Compare
Source](https://github.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
[#&#8203;4829](https://github.com/squidfunk/mkdocs-material/issues/4829):
Search overlay does not close for active anchor result
- Fixed
[#&#8203;4824](https://github.com/squidfunk/mkdocs-material/issues/4824):
Search plugin crashes for `h[1-6]` contained in other elements
- Fixed
[#&#8203;4804](https://github.com/squidfunk/mkdocs-material/issues/4804):
Nested navigation items not expandable with keyboard
- Fixed
[#&#8203;4689](https://github.com/squidfunk/mkdocs-material/issues/4689):
anchor tracking not working for anchors in tables
-   Upgraded to Mermaid 9.3.0

###
[`v9.0.2`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.0.2):
mkdocs-material-9.0.2

[Compare
Source](https://github.com/squidfunk/mkdocs-material/compare/9.0.1...9.0.2)

- Fixed
[#&#8203;4823](https://github.com/squidfunk/mkdocs-material/issues/4823):
Improved contrast ratio in footer to meet WCAG guidelines
- Fixed
[#&#8203;4819](https://github.com/squidfunk/mkdocs-material/issues/4819):
Social plugin crashes when card generation is disabled
- Fixed
[#&#8203;4817](https://github.com/squidfunk/mkdocs-material/issues/4817):
Search plugin crashes on numeric page titles in `nav`

###
[`v9.0.1`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.0.1):
mkdocs-material-9.0.1

[Compare
Source](https://github.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
[#&#8203;4810](https://github.com/squidfunk/mkdocs-material/issues/4810):
Abbreviations run out of screen on touch devices
- Fixed
[#&#8203;4813](https://github.com/squidfunk/mkdocs-material/issues/4813):
View source and edit button links are the same

###
[`v9.0.0`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.0.0):
mkdocs-material-9.0.0

[Compare
Source](https://github.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://github.com/testing-cabal/mock/blob/HEAD/CHANGELOG.rst#&#8203;501)

[Compare
Source](https://github.com/testing-cabal/mock/compare/5.0.0...5.0.1)

- [gh-100740](https://github.com/testing-cabal/mock/issues/100740):
Fix `unittest.mock.Mock` not respecting the spec for
    attribute names prefixed with `assert`.

- [gh-100690](https://github.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://github.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://github.com/testing-cabal/mock/blob/HEAD/CHANGELOG.rst#&#8203;500)

[Compare
Source](https://github.com/testing-cabal/mock/compare/4.0.3...5.0.0)

- [gh-98624](https://github.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://github.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://github.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://github.com/testing-cabal/mock/issues/98086): Make
sure `patch.dict()` can be applied on async functions.

- [gh-100287](https://github.com/testing-cabal/mock/issues/100287):
Fix the interaction of :func:`unittest.mock.seal` with
    :class:`unittest.mock.AsyncMock`.

- [gh-83076](https://github.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://github.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#&#8203;302---2023-01-29)

[Compare
Source](https://github.com/pre-commit/pre-commit/compare/v3.0.1...v3.0.2)

\==================

##### Fixes

-   Prevent local `Gemfile` from interfering with hook execution.
- [#&#8203;2727](https://github.com/pre-commit/pre-commit/issues/2727)
PR by [@&#8203;asottile](https://github.com/asottile).
-   Fix `language: r`, `repo: local` hooks
-
[pre-commit-ci/issues#&#8203;107](https://github.com/pre-commit-ci/issues/issues/107)
by [@&#8203;lorenzwalthert](https://github.com/lorenzwalthert).
- [#&#8203;2728](https://github.com/pre-commit/pre-commit/issues/2728)
PR by [@&#8203;asottile](https://github.com/asottile).

###
[`v3.0.1`](https://github.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#&#8203;301---2023-01-26)

[Compare
Source](https://github.com/pre-commit/pre-commit/compare/v3.0.0...v3.0.1)

\==================

##### Fixes

-   Ensure coursier hooks are available offline after install.
- [#&#8203;2723](https://github.com/pre-commit/pre-commit/issues/2723)
PR by [@&#8203;asottile](https://github.com/asottile).

###
[`v3.0.0`](https://github.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#&#8203;300---2023-01-23)

[Compare
Source](https://github.com/pre-commit/pre-commit/compare/v2.21.0...v3.0.0)

\==================

##### Features

-   Make `language: golang` bootstrap `go` if not present.
- [#&#8203;2651](https://github.com/pre-commit/pre-commit/issues/2651)
PR by [@&#8203;taoufik07](https://github.com/taoufik07).
- [#&#8203;2649](https://github.com/pre-commit/pre-commit/issues/2649)
issue by [@&#8203;taoufik07](https://github.com/taoufik07).
- `language: coursier` now supports `additional_dependencies` and `repo:
local`
- [#&#8203;2702](https://github.com/pre-commit/pre-commit/issues/2702)
PR by [@&#8203;asottile](https://github.com/asottile).
-   Upgrade `ruby-build` to `20221225`.
- [#&#8203;2718](https://github.com/pre-commit/pre-commit/issues/2718)
PR by [@&#8203;jalessio](https://github.com/jalessio).

##### Fixes

-   Improve error message for invalid yaml for `pre-commit autoupdate`.
- [#&#8203;2686](https://github.com/pre-commit/pre-commit/issues/2686)
PR by [@&#8203;asottile](https://github.com/asottile).
- [#&#8203;2685](https://github.com/pre-commit/pre-commit/issues/2685)
issue by
[@&#8203;CarstenGrohmann](https://github.com/CarstenGrohmann).
-   `repo: local` no longer provisions an empty `git` repo.
- [#&#8203;2699](https://github.com/pre-commit/pre-commit/issues/2699)
PR by [@&#8203;asottile](https://github.com/asottile).

##### Updating

-   Drop support for python<3.8
- [#&#8203;2655](https://github.com/pre-commit/pre-commit/issues/2655)
PR by [@&#8203;asottile](https://github.com/asottile).
- Drop support for top-level list, use `pre-commit migrate-config` to
update.
- [#&#8203;2656](https://github.com/pre-commit/pre-commit/issues/2656)
PR by [@&#8203;asottile](https://github.com/asottile).
- Drop support for `sha` to specify revision, use `pre-commit
migrate-config`
    to update.
- [#&#8203;2657](https://github.com/pre-commit/pre-commit/issues/2657)
PR by [@&#8203;asottile](https://github.com/asottile).
- Remove `pre-commit-validate-config` and
`pre-commit-validate-manifest`, use
`pre-commit validate-config` and `pre-commit validate-manifest` instead.
- [#&#8203;2658](https://github.com/pre-commit/pre-commit/issues/2658)
PR by [@&#8203;asottile](https://github.com/asottile).
-   `language: golang` hooks must use `go.mod` to specify dependencies
- [#&#8203;2672](https://github.com/pre-commit/pre-commit/issues/2672)
PR by [@&#8203;taoufik07](https://github.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://github.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 <robert@craigie.dev>
allenporter referenced this issue in allenporter/flux-local Feb 6, 2023
[![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://github.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://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-710--2023-01-24)

[Compare
Source](https://github.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://github.com/nedbat/coveragepy/pull/1347)7
.. \_issue
972[https://github.com/nedbat/coveragepy/issues/972](https://github.com/nedbat/coveragepy/issues/972)72
.. \_issue
131[https://github.com/nedbat/coveragepy/issues/1319](https://github.com/nedbat/coveragepy/issues/1319)319
.. \_issue
15[https://github.com/nedbat/coveragepy/issues/1538](https://github.com/nedbat/coveragepy/issues/1538)1538

.. \_changes\_7-0-5:

###
[`v7.0.5`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-705--2023-01-10)

[Compare
Source](https://github.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://github.com/nedbat/coveragepy/issues/1524)4

.. \_changes\_7-0-4:

###
[`v7.0.4`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-704--2023-01-07)

[Compare
Source](https://github.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://github.com/nedbat/coveragepy/issues/1527)7

.. \_changes\_7-0-3:

###
[`v7.0.3`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-703--2023-01-03)

[Compare
Source](https://github.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://github.com/nedbat/coveragepy/issues/1522)2

.. \_changes\_7-0-2:

###
[`v7.0.2`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-702--2023-01-02)

[Compare
Source](https://github.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://github.com/nedbat/coveragepy/issues/1515)5
.. \_issue
1516[https://github.com/nedbat/coveragepy/issues/1516](https://github.com/nedbat/coveragepy/issues/1516)16
.. \_issue
151[https://github.com/nedbat/coveragepy/issues/1519](https://github.com/nedbat/coveragepy/issues/1519)519

.. \_changes\_7-0-1:

###
[`v7.0.1`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-701--2022-12-23)

[Compare
Source](https://github.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://github.com/nedbat/coveragepy/issues/1510)0
.. \_issue
1511[https://github.com/nedbat/coveragepy/issues/1511](https://github.com/nedbat/coveragepy/issues/1511)11
.. \_issue
151[https://github.com/nedbat/coveragepy/issues/1512](https://github.com/nedbat/coveragepy/issues/1512)512
.. \_issue
15[https://github.com/nedbat/coveragepy/issues/1513](https://github.com/nedbat/coveragepy/issues/1513)1513

.. \_changes\_7-0-0:

###
[`v7.0.0`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-700--2022-12-18)

[Compare
Source](https://github.com/nedbat/coveragepy/compare/6.5.0...7.0.0)

Nothing new beyond 7.0.0b1.

.. \_changes\_7-0-0b1:

###
[`v6.5.0`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-650--2022-09-29)

[Compare
Source](https://github.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://github.com/nedbat/coveragepy/issues/1395)395
.. \_issue
14[https://github.com/nedbat/coveragepy/issues/1425](https://github.com/nedbat/coveragepy/issues/1425)1425
.. \_issue
1[https://github.com/nedbat/coveragepy/issues/1449](https://github.com/nedbat/coveragepy/issues/1449)/1449
.. \_pull
[https://github.com/nedbat/coveragepy/pull/1438](https://github.com/nedbat/coveragepy/pull/1438)l/1438

.. \_changes\_6-4-4:

###
[`v6.4.4`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-644--2022-08-16)

[Compare
Source](https://github.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://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-643--2022-08-06)

[Compare
Source](https://github.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://github.com/nedbat/coveragepy/issues/972)2
.. \_issue
1428[https://github.com/nedbat/coveragepy/issues/1428](https://github.com/nedbat/coveragepy/issues/1428)28
.. \_pull
134[https://github.com/nedbat/coveragepy/pull/1347](https://github.com/nedbat/coveragepy/pull/1347)347
.. \_pull
14[https://github.com/nedbat/coveragepy/issues/1403](https://github.com/nedbat/coveragepy/issues/1403)1403
.. \_pull
1[https://github.com/nedbat/coveragepy/issues/1405](https://github.com/nedbat/coveragepy/issues/1405)/1405
.. \_pull
[https://github.com/nedbat/coveragepy/issues/1413](https://github.com/nedbat/coveragepy/issues/1413)s/1413
..
\_pull[https://github.com/nedbat/coveragepy/pull/1430](https://github.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>
@abo-abo
Copy link
Contributor

abo-abo commented Apr 24, 2023

Hi @nedbat,

We're having the same performance issue as the requester: the CI run has increased from ~5min to
~10min when we use coverage>=6.4.3. I've bisected it (just like the requester) to
f54428f. When I revert this commit on top of 7.2.3, the run times return to normal.

Should we reopen this issue? @mkniewallner was your performance problem resolved?

@nedbat
Copy link
Owner

nedbat commented Apr 24, 2023

#1586 seems related.

@abo-abo
Copy link
Contributor

abo-abo commented Apr 24, 2023

@nedbat Good catch! It's totally related. We went from 9.2M .coverage file to a 121M .coverage file. This is just for 1/8 runners. We later combine the 8 runs, so the final file would be really huge.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue May 5, 2023
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
andersk added a commit to andersk/coveragepy that referenced this issue May 23, 2023
This reverts commit f54428f (nedbat#1347),
which was a big regression in performance and file sizes when using
dynamic_context, and is no longer needed for nedbat#972 as of
4cc3292 (nedbat#1538).

Fixes nedbat#1586.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
nedbat pushed a commit to andersk/coveragepy that referenced this issue May 29, 2023
This reverts commit f54428f (nedbat#1347),
which was a big regression in performance and file sizes when using
dynamic_context, and is no longer needed for nedbat#972 as of
4cc3292 (nedbat#1538).

Fixes nedbat#1586.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
nedbat added a commit that referenced this issue May 29, 2023
* Revert "Map also empty dictionaries to file"

This reverts commit f54428f (#1347),
which was a big regression in performance and file sizes when using
dynamic_context, and is no longer needed for #972 as of
4cc3292 (#1538).

Fixes #1586.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

* docs: details of the fix in pull #1629, fixing #1586.

---------

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed performance Something is too slow
Projects
None yet
Development

No branches or pull requests

3 participants