Skip to content

Comments

Scheduled weekly dependency update for week 08#477

Open
pyup-bot wants to merge 21 commits intomasterfrom
pyup-scheduled-update-2026-02-23
Open

Scheduled weekly dependency update for week 08#477
pyup-bot wants to merge 21 commits intomasterfrom
pyup-scheduled-update-2026-02-23

Conversation

@pyup-bot
Copy link
Collaborator

Update certifi from 2025.4.26 to 2026.1.4.

The bot wasn't able to find a changelog for this release. Got an idea?

Links

Update chardet from 5.2.0 to 6.0.0.post1.

Changelog

6.0.0

Features

- **Unified single-byte charset detection**: Instead of only having trained language models for a handful of languages (Bulgarian, Greek, Hebrew, Hungarian, Russian, Thai, Turkish) and relying on special-case `Latin1Prober` and `MacRomanProber` heuristics for Western encodings, chardet now treats all single-byte charsets the same way: every encoding gets proper language-specific bigram models trained on CulturaX corpus data. This means chardet can now accurately detect both the encoding *and* the language for all supported single-byte encodings.
- **38 new languages**: Arabic, Belarusian, Breton, Croatian, Czech, Danish, Dutch, English, Esperanto, Estonian, Farsi, Finnish, French, German, Icelandic, Indonesian, Irish, Italian, Kazakh, Latvian, Lithuanian, Macedonian, Malay, Maltese, Norwegian, Polish, Portuguese, Romanian, Scottish Gaelic, Serbian, Slovak, Slovene, Spanish, Swedish, Tajik, Ukrainian, Vietnamese, and Welsh. Existing models for Bulgarian, Greek, Hebrew, Hungarian, Russian, Thai, and Turkish were also retrained with the new pipeline.
- **`EncodingEra` filtering**: New `encoding_era` parameter to `detect` allows filtering by an `EncodingEra` flag enum (`MODERN_WEB`, `LEGACY_ISO`, `LEGACY_MAC`, `LEGACY_REGIONAL`, `DOS`, `MAINFRAME`, `ALL`) allows callers to restrict detection to encodings from a specific era. `detect()` and `detect_all()` default to `MODERN_WEB`. The new `MODERN_WEB` default should drastically improve accuracy for users who are not working with legacy data. The tiers are:
- `MODERN_WEB`: UTF-8/16/32, Windows-125x, CP874, CJK multi-byte (widely used on the web)
- `LEGACY_ISO`: ISO-8859-x, KOI8-R/U (legacy but well-known standards)
- `LEGACY_MAC`: Mac-specific encodings (MacRoman, MacCyrillic, etc.)
- `LEGACY_REGIONAL`: Uncommon regional/national encodings (KOI8-T, KZ1048, CP1006, etc.)
- `DOS`: DOS/OEM code pages (CP437, CP850, CP866, etc.)
- `MAINFRAME`: EBCDIC variants (CP037, CP500, etc.)
- **`--encoding-era` CLI flag**: The `chardetect` CLI now accepts `-e`/`--encoding-era` to control which encoding eras are considered during detection.
- **`max_bytes` and `chunk_size` parameters**: `detect()`, `detect_all()`, and `UniversalDetector` now accept `max_bytes` (default 200KB) and `chunk_size` (default 64KB) parameters for controlling how much data is examined. (314, bysiber)
- **Encoding era preference tie-breaking**: When multiple encodings have very close confidence scores, the detector now prefers more modern/Unicode encodings over legacy ones.
- **Charset metadata registry**: New `chardet.metadata.charsets` module provides structured metadata about all supported encodings, including their era classification and language filter.
- **`should_rename_legacy` now defaults intelligently**: When set to `None` (the new default), legacy renaming is automatically enabled when `encoding_era` is `MODERN_WEB`.
- **Direct GB18030 support**: Replaced the redundant GB2312 prober with a proper GB18030 prober.
- **EBCDIC detection**: Added CP037 and CP500 EBCDIC model registrations for mainframe encoding detection.
- **Binary file detection**: Added basic binary file detection to abort analysis earlier on non-text files.
- **Python 3.12, 3.13, and 3.14 support** (283, hugovk; 311)
- **GitHub Codespace support** (312, oxygen-dioxide)

Fixes

- **Fix CP949 state machine**: Corrected the state machine for Korean CP949 encoding detection. (268, nenw)
- **Fix SJIS distribution analysis**: Fixed `SJISDistributionAnalysis` discarding valid second-byte range >= 0x80. (315, bysiber)
- **Fix UTF-16/32 detection for non-ASCII-heavy text**: Improved detection of UTF-16/32 encoded CJK and other non-ASCII text by adding a `MIN_RATIO` threshold alongside the existing `EXPECTED_RATIO`.
- **Fix `get_charset` crash**: Resolved a crash when looking up unknown charset names.
- **Fix GB18030 `char_len_table`**: Corrected the character length table for GB18030 multi-byte sequences.
- **Fix UTF-8 state machine**: Updated to be more spec-compliant.
- **Fix `detect_all()` returning inactive probers**: Results from probers that determined "definitely not this encoding" are now excluded.
- **Fix early cutoff bug**: Resolved an issue where detection could terminate prematurely.
- **Default UTF-8 fallback**: If UTF-8 has not been ruled out and nothing else is above the minimum threshold, UTF-8 is now returned as the default.

Breaking changes

- **Dropped Python 3.7, 3.8, and 3.9 support**: Now requires Python 3.10+. (283, hugovk)
- **Removed `Latin1Prober` and `MacRomanProber`**: These special-case probers have been replaced by the unified model-based approach described above. Latin-1, MacRoman, and all other single-byte encodings are now detected by `SingleByteCharSetProber` with trained language models, giving better accuracy and language identification.
- **Removed EUC-TW support**: EUC-TW encoding detection has been removed as it is extremely rare in practice.
- **`LanguageFilter.NONE` removed**: Use specific language filters or `LanguageFilter.ALL` instead.
- **Enum types changed**: `InputState`, `ProbingState`, `MachineState`, `SequenceLikelihood`, and `CharacterCategory` are now `IntEnum` (previously plain classes or `Enum`). `LanguageFilter` values changed from hardcoded hex to `auto()`.
- **`detect()` default behavior change**: `detect()` now defaults to `encoding_era=EncodingEra.MODERN_WEB` and `should_rename_legacy=None` (auto-enabled for `MODERN_WEB`), whereas previously it defaulted to considering all encodings with no legacy renaming.

Misc changes

- **Switched from Poetry/setuptools to uv + hatchling**: Build system modernized with `hatch-vcs` for version management.
- **License text updated**: Updated LGPLv2.1 license text and FSF notices to use URL instead of mailing address. (304, 307, musicinmybrain)
- **CulturaX-based model training**: The `create_language_model.py` training script was rewritten to use the CulturaX multilingual corpus instead of Wikipedia, producing higher quality bigram frequency models.
- **`Language` class converted to frozen dataclass**: The language metadata class now uses `dataclass(frozen=True)` with `num_training_docs` and `num_training_chars` fields replacing `wiki_start_pages`.
- **Test infrastructure**: Added `pytest-timeout` and `pytest-xdist` for faster parallel test execution. Reorganized test data directories.

Contributors

Thank you to everyone who contributed to this release!

- dan-blanchard (Dan Blanchard)
- bysiber (Kadir Can Ozden)
- musicinmybrain (Ben Beasley)
- hugovk (Hugo van Kemenade)
- oxygen-dioxide
- nenw

And a special thanks to helour, whose earlier Latin-1 prober work from an abandoned PR helped inform the approach taken in this release.
Links

Update idna from 3.10 to 3.11.

Changelog

3.11

- Update to Unicode 16.0.0, including significant changes to UTS46
processing. As a result of Unicode ending support for it, transitional
processing no longer has an effect and returns the same result.
- Add support for Python 3.14, lowest supported version is Python 3.8.
- Various updates to packaging, including PEP 740 support.
Links

Update requests from 2.32.3 to 2.32.5.

Changelog

2.32.5

-------------------

**Bugfixes**

- The SSLContext caching feature originally introduced in 2.32.0 has created
a new class of issues in Requests that have had negative impact across a number
of use cases. The Requests team has decided to revert this feature as long term
maintenance of it is proving to be unsustainable in its current iteration.

**Deprecations**
- Added support for Python 3.14.
- Dropped support for Python 3.8 following its end of support.

2.32.4

-------------------

**Security**
- CVE-2024-47081 Fixed an issue where a maliciously crafted URL and trusted
environment will retrieve credentials for the wrong hostname/machine from a
netrc file.

**Improvements**
- Numerous documentation improvements

**Deprecations**
- Added support for pypy 3.11 for Linux and macOS.
- Dropped support for pypy 3.9 following its end of support.
Links

Update urllib3 from 2.4.0 to 2.6.3.

Changelog

2.6.3

==================

- Fixed a high-severity security issue where decompression-bomb safeguards of
the streaming API were bypassed when HTTP redirects were followed.
(`GHSA-38jv-5279-wg99 <https://github.com/urllib3/urllib3/security/advisories/GHSA-38jv-5279-wg99>`__)
- Started treating ``Retry-After`` times greater than 6 hours as 6 hours by
default. (`3743 <https://github.com/urllib3/urllib3/issues/3743>`__)
- Fixed ``urllib3.connection.VerifiedHTTPSConnection`` on Emscripten.
(`3752 <https://github.com/urllib3/urllib3/issues/3752>`__)

2.6.2

==================

- Fixed ``HTTPResponse.read_chunked()`` to properly handle leftover data in
the decoder's buffer when reading compressed chunked responses.
(`3734 <https://github.com/urllib3/urllib3/issues/3734>`__)

2.6.1

==================

- Restore previously removed ``HTTPResponse.getheaders()`` and
``HTTPResponse.getheader()`` methods.
(`3731 <https://github.com/urllib3/urllib3/issues/3731>`__)

2.6.0

==================

Security
--------

- Fixed a security issue where streaming API could improperly handle highly
compressed HTTP content ("decompression bombs") leading to excessive resource
consumption even when a small amount of data was requested. Reading small
chunks of compressed data is safer and much more efficient now.
(`GHSA-2xpw-w6gg-jr37 <https://github.com/urllib3/urllib3/security/advisories/GHSA-2xpw-w6gg-jr37>`__)
- Fixed a security issue where an attacker could compose an HTTP response with
virtually unlimited links in the ``Content-Encoding`` header, potentially
leading to a denial of service (DoS) attack by exhausting system resources
during decoding. The number of allowed chained encodings is now limited to 5.
(`GHSA-gm62-xv2j-4w53 <https://github.com/urllib3/urllib3/security/advisories/GHSA-gm62-xv2j-4w53>`__)

.. caution::
- If urllib3 is not installed with the optional `urllib3[brotli]` extra, but
 your environment contains a Brotli/brotlicffi/brotlipy package anyway, make
 sure to upgrade it to at least Brotli 1.2.0 or brotlicffi 1.2.0.0 to
 benefit from the security fixes and avoid warnings. Prefer using
 `urllib3[brotli]` to install a compatible Brotli package automatically.

- If you use custom decompressors, please make sure to update them to
 respect the changed API of ``urllib3.response.ContentDecoder``.


Features
--------

- Enabled retrieval, deletion, and membership testing in ``HTTPHeaderDict`` using bytes keys. (`3653 <https://github.com/urllib3/urllib3/issues/3653>`__)
- Added host and port information to string representations of ``HTTPConnection``. (`3666 <https://github.com/urllib3/urllib3/issues/3666>`__)
- Added support for Python 3.14 free-threading builds explicitly. (`3696 <https://github.com/urllib3/urllib3/issues/3696>`__)


Removals
--------

- Removed the ``HTTPResponse.getheaders()`` method in favor of ``HTTPResponse.headers``.
Removed the ``HTTPResponse.getheader(name, default)`` method in favor of ``HTTPResponse.headers.get(name, default)``. (`3622 <https://github.com/urllib3/urllib3/issues/3622>`__)


Bugfixes
--------

- Fixed redirect handling in ``urllib3.PoolManager`` when an integer is passed
for the retries parameter. (`3649 <https://github.com/urllib3/urllib3/issues/3649>`__)
- Fixed ``HTTPConnectionPool`` when used in Emscripten with no explicit port. (`3664 <https://github.com/urllib3/urllib3/issues/3664>`__)
- Fixed handling of ``SSLKEYLOGFILE`` with expandable variables. (`3700 <https://github.com/urllib3/urllib3/issues/3700>`__)


Misc
----

- Changed the ``zstd`` extra to install ``backports.zstd`` instead of ``zstandard`` on Python 3.13 and before. (`3693 <https://github.com/urllib3/urllib3/issues/3693>`__)
- Improved the performance of content decoding by optimizing ``BytesQueueBuffer`` class. (`3710 <https://github.com/urllib3/urllib3/issues/3710>`__)
- Allowed building the urllib3 package with newer setuptools-scm v9.x. (`3652 <https://github.com/urllib3/urllib3/issues/3652>`__)
- Ensured successful urllib3 builds by setting Hatchling requirement to >= 1.27.0. (`3638 <https://github.com/urllib3/urllib3/issues/3638>`__)

2.5.0

==================

Features
--------

- Added support for the ``compression.zstd`` module that is new in Python 3.14.
See `PEP 784 <https://peps.python.org/pep-0784/>`_ for more information. (`#3610 <https://github.com/urllib3/urllib3/issues/3610>`__)
- Added support for version 0.5 of ``hatch-vcs`` (`3612 <https://github.com/urllib3/urllib3/issues/3612>`__)


Bugfixes
--------

- Fixed a security issue where restricting the maximum number of followed
redirects at the ``urllib3.PoolManager`` level via the ``retries`` parameter
did not work.
- Made the Node.js runtime respect redirect parameters such as ``retries``
and ``redirects``.
- Raised exception for ``HTTPResponse.shutdown`` on a connection already released to the pool. (`3581 <https://github.com/urllib3/urllib3/issues/3581>`__)
- Fixed incorrect `CONNECT` statement when using an IPv6 proxy with `connection_from_host`. Previously would not be wrapped in `[]`. (`3615 <https://github.com/urllib3/urllib3/issues/3615>`__)
Links

Update attrs from 25.3.0 to 25.4.0.

The bot wasn't able to find a changelog for this release. Got an idea?

Links

Update coverage from 7.8.0 to 7.13.4.

Changelog

7.13.4

---------------------------

- Fix: the third-party code fix in 7.13.3 required examining the parent
directories where coverage was run. In the unusual situation that one of the
parent directories is unreadable, a PermissionError would occur, as
described in `issue 2129`_. This is now fixed.

- Fix: in test suites that change sys.path, coverage.py could fail with
"RuntimeError: Set changed size during iteration" as described and fixed in
`pull 2130`_. Thanks, Noah Fatsi.

- We now publish ppc64le wheels, thanks to `Pankhudi Jain <pull 2121_>`_.

.. _pull 2121: https://github.com/coveragepy/coveragepy/pull/2121
.. _issue 2129: https://github.com/coveragepy/coveragepy/issues/2129
.. _pull 2130: https://github.com/coveragepy/coveragepy/pull/2130


.. _changes_7-13-3:

7.13.3

---------------------------

- Fix: in some situations, third-party code was measured when it shouldn't have
been, slowing down test execution. This happened with layered virtual
environments such as uv sometimes makes. The problem is fixed, closing `issue
2082`_. Now any directory on sys.path that is inside a virtualenv is
considered third-party code.

.. _issue 2082: https://github.com/coveragepy/coveragepy/issues/2082


.. _changes_7-13-2:

7.13.2

---------------------------

- Fix: when Python is installed via symlinks, for example with Homebrew, the
standard library files could be incorrectly included in coverage reports.
This is now fixed, closing `issue 2115`_.

- Fix: if a data file is created with no read permissions, the combine step
would fail completely. Now a warning is issued and the file is skipped.
Closes `issue 2117`_.

.. _issue 2115: https://github.com/coveragepy/coveragepy/issues/2115
.. _issue 2117: https://github.com/coveragepy/coveragepy/issues/2117


.. _changes_7-13-1:

7.13.1

---------------------------

- Added: the JSON report now includes a ``"start_line"`` key for function and
class regions, indicating the first line of the region in the source. Closes
`issue 2110`_.

- Added: The ``debug data`` command now takes file names as arguments on the
command line, so you can inspect specific data files without needing to set
the ``COVERAGE_FILE`` environment variable.

- Fix: the JSON report used to report module docstrings as executed lines,
which no other report did, as described in `issue 2105`_. This is now fixed,
thanks to Jianrong Zhao.

- Fix: coverage.py uses a more disciplined approach to detecting where
third-party code is installed, and avoids measuring it. This shouldn't change
any behavior. If you find that it does, please get in touch.

- Performance: data files that will be combined now record their hash as part
of the file name. This lets us skip duplicate data more quickly, speeding the
combining step.

- Docs: added a section explaining more about what is considered a missing
branch and how it is reported: :ref:`branch_explain`, as requested in `issue
1597`_. Thanks to `Ayisha Mohammed <pull 2092_>`_.

- Tests: the test suite misunderstood what core was being tested if
``COVERAGE_CORE`` wasn't set on 3.14+. This is now fixed, closing `issue
2109`_.

.. _issue 1597: https://github.com/coveragepy/coveragepy/issues/1597
.. _pull 2092: https://github.com/coveragepy/coveragepy/pull/2092
.. _issue 2105: https://github.com/coveragepy/coveragepy/issues/2105
.. _issue 2109: https://github.com/coveragepy/coveragepy/issues/2109
.. _issue 2110: https://github.com/coveragepy/coveragepy/issues/2110


.. _changes_7-13-0:

7.13.0

---------------------------

- Feature: coverage.py now supports :file:`.coveragerc.toml` configuration
files. These files use TOML syntax and take priority over
:file:`pyproject.toml` but lower priority than :file:`.coveragerc` files.
Closes `issue 1643`_ thanks to `Olena Yefymenko <pull 1952_>`_.

- Fix: we now include a permanent .pth file which is installed with the code,
fixing `issue 2084`_.  In 7.12.1b1 this was done incorrectly: it didn't work
when using the source wheel (``py3-none-any``).  This is now fixed. Thanks,
`Henry Schreiner <pull 2100_>`_.

- Deprecated: when coverage.py is installed, it creates three command entry
points: ``coverage``, ``coverage3``, and ``coverage-3.10`` (if installed for
Python 3.10). The second and third of these are not needed and will
eventually be removed. They still work for now, but print a message about
their deprecation.

.. _issue 1643: https://github.com/coveragepy/coveragepy/issues/1643
.. _pull 1952: https://github.com/coveragepy/coveragepy/pull/1952
.. _pull 2100: https://github.com/coveragepy/coveragepy/pull/2100


.. _changes_7-12-1b1:

7.12.1b1

-----------------------------

- Fix: coverage.py now includes a permanent .pth file in the distribution which
is installed with the code. This fixes `issue 2084`_: failure to patch for
subprocess measurement when site-packages is not writable.

.. _issue 2084: https://github.com/coveragepy/coveragepy/issues/2084


.. _changes_7-12-0:

7.12.0

---------------------------

- The HTML report now shows separate coverage totals for statements and
branches, as well as the usual combined coverage percentage. Thanks to Ryuta
Otsuka for the `discussion <issue 2081_>`_ and the `implementation
<pull 2085_>`_.

- The JSON report now includes separate coverage totals for statements and
branches, thanks to `Ryuta Otsuka <pull 2090_>`_.

- Fix: ``except*`` clauses were not handled properly under the "sysmon"
measurement core, causing KeyError exceptions as described in `issue 2086`_.
This is now fixed.

- Fix: we now defend against aggressive mocking of ``open()`` that could cause
errors inside coverage.py.  An example of a failure is in `issue 2083`_.

- Fix: in unusual cases where a test suite intentionally exhausts the system's
file descriptors to test handling errors in ``open()``, coverage.py would
fail when trying to open source files, as described in `issue 2091`_.  This
is now fixed.

- A small tweak to the HTML report: file paths now use thin spaces around
slashes to make them easier to read.

.. _issue 2081: https://github.com/coveragepy/coveragepy/issues/2081
.. _issue 2083: https://github.com/coveragepy/coveragepy/issues/2083
.. _pull 2085: https://github.com/coveragepy/coveragepy/pull/2085
.. _issue 2086: https://github.com/coveragepy/coveragepy/issues/2086
.. _pull 2090: https://github.com/coveragepy/coveragepy/pull/2090
.. _issue 2091: https://github.com/coveragepy/coveragepy/issues/2091


.. _changes_7-11-3:

7.11.3

---------------------------

- Fix: the 7.11.1 changes meant that conflicts between a requested measurement
core and other settings would raise an error. This was a breaking change from
previous behavior, as reported in `issue 2076`_ and `issue 2078`_.

The previous behavior has been restored: when the requested core conflicts
with other settings, another core is used instead, and a warning is issued.

- For contributors: the repo has moved from Ned's `nedbat GitHub account`_ to
the `coveragepy GitHub organization`_. The default branch has changed from
master to main.

.. _issue 2076: https://github.com/coveragepy/coveragepy/issues/2076
.. _issue 2078: https://github.com/coveragepy/coveragepy/issues/2078
.. _nedbat GitHub account: https://github.com/nedbat
.. _coveragepy GitHub organization: https://github.com/coveragepy


.. _changes_7-11-2:

7.11.2

---------------------------

- Fix: using the "sysmon" measurement core in 7.11.1, if Python code was
claimed to come from a non-Python file, a ``NotPython`` exception could be
raised. This could happen for example with Jinja templates compiled to
Python, as reported in `issue 2077`_. This is now fixed.

- Doc: corrected the first entry in the 7.11.1 changelog.

.. _issue 2077: https://github.com/coveragepy/coveragepy/issues/2077


.. _changes_7-11-1:

7.11.1

---------------------------

- Fix: some chanages to details of how the measurement core is chosen, and how
conflicting settings are handled. The "sysmon" core cannot be used with some
conurrency settings, with dynamic context, and in Python 3.12/3.13, with
branch measurement.

- If the core is not specified and defaults to "sysmon" (Python 3.14+), but
 other settings conflict with sysmon, then the "ctrace" core will be used
 instead with no warning. For concurrency conflicts, this used to produce an
 error, as described in `issue 2064`_.

- If the "sysmon" core is explicitly requested in your configuration, but
 other settings conflict, an error is now raised. This used to produce a
 warning.

- Fix: some multi-line case clauses or for loops (and probably other
constructs) could cause incorrect claims of missing branches with the
sys.monitoring core, as described in `issue 2070`_. This is now fixed.

- Fix: when running in pytest under coverage, a ``breakpoint()`` would stop in
the wrong frame, one level down from where it should, as described in `issue
1420`_. This was due to a coverage change in v6.4.1 that seemed to give a
slight performance improvement, but I couldn't reproduce the performance
gain, so it's been reverted, fixing the debugger problem.

- A new debug option ``--debug=core`` shows which core is in use and why.

- Split ``sqlite`` debugging information out of the ``sys`` :ref:`coverage
debug <cmd_debug>` and :ref:`cmd_run_debug` options since it's bulky and not
very useful.

- Updated the :ref:`howitworks` page to better describe the three different
measurement cores.

.. _issue 1420: https://github.com/coveragepy/coveragepy/issues/1420
.. _issue 2064: https://github.com/coveragepy/coveragepy/issues/2064
.. _issue 2070: https://github.com/coveragepy/coveragepy/issues/2070


.. _changes_7-11-0:

7.11.0

---------------------------

- Dropped support for Python 3.9, declared support for Python 3.15 alpha.


.. _changes_7-10-7:

7.10.7

---------------------------

- Performance: with branch coverage in large files, generating HTML, JSON, or
LCOV reports could take far too long due to some quadratic behavior when
creating the function and class index pages.  This is now fixed, closing
`issue 2048`_.  Thanks to Daniel Diniz for help diagnosing the problem.

- Most warnings and a few errors now have links to a page in the docs
explaining the specific message.  Closes `issue 1921`_.

.. _issue 1921: https://github.com/coveragepy/coveragepy/issues/1921
.. _issue 2048: https://github.com/coveragepy/coveragepy/issues/2048


.. _changes_7-10-6:

7.10.6

---------------------------

- Fix: ``source`` directories were not properly communicated to subprocesses
that ran in different directories, as reported in `issue 1499`_.  This is now
fixed.

- Performance: `Alex Gaynor continues fine-tuning <pull 2038_>`_ the speed of
combination, especially with many contexts.

.. _issue 1499: https://github.com/coveragepy/coveragepy/issues/1499
.. _pull 2038: https://github.com/coveragepy/coveragepy/pull/2038


.. _changes_7-10-5:

7.10.5

---------------------------

- Big speed improvements for ``coverage combine``: it's now about twice as
fast! Huge thanks to Alex Gaynor for pull requests `2032 <pull 2032_>`_,
`2033 <pull 2033_>`_, and `2034 <pull 2034_>`_.

.. _pull 2032: https://github.com/coveragepy/coveragepy/pull/2032
.. _pull 2033: https://github.com/coveragepy/coveragepy/pull/2033
.. _pull 2034: https://github.com/coveragepy/coveragepy/pull/2034


.. _changes_7-10-4:

7.10.4

---------------------------

- Added ``patch = fork`` for times when the built-in forking support is
insufficient.

- Fix: ``patch = execv`` also inherits the entire coverage configuration now.


.. _changes_7-10-3:

7.10.3

---------------------------

- Fixes for ``patch = subprocess``:

- If subprocesses spawned yet more subprocesses simultaneously, some coverage
 could be missed.  This is now fixed, closing `issue 2024`_.

- If subprocesses were created in other directories, their data files were
 stranded there and not combined into the totals, as described in `issue
 2025`_.  This is now fixed.

- On Windows (or maybe only some Windows?) the patch would fail with a
 ``ModuleNotFound`` error trying to import coverage.  This is now fixed,
 closing `issue 2022`_.

- Originally only options set in the coverage configuration file would apply
 to subprocesses.  Options set on the ``coverage run`` command line (such as
 ``--branch``) wouldn't be communicated to the subprocesses.  This could
 lead to combining failures, as described in `issue 2021`_. Now the entire
 configuration is used in subprocesses, regardless of its origin.

- Added ``debug=patch`` to help diagnose problems.

- Fix: really close all SQLite databases, even in-memory ones. Closes `issue
2017`_.

.. _issue 2017: https://github.com/coveragepy/coveragepy/issues/2017
.. _issue 2021: https://github.com/coveragepy/coveragepy/issues/2021
.. _issue 2022: https://github.com/coveragepy/coveragepy/issues/2022
.. _issue 2024: https://github.com/coveragepy/coveragepy/issues/2024
.. _issue 2025: https://github.com/coveragepy/coveragepy/issues/2025


.. _changes_7-10-2:

7.10.2

---------------------------

- Fix: some code with NOP bytecodes could report missing branches that are
actually executed. This is now fixed, closing `issue 1999`_. Python 3.9
still shows the problem.

.. _issue 1999: https://github.com/coveragepy/coveragepy/issues/1999


.. _changes_7-10-1:

7.10.1

---------------------------

- Fix: the exclusion for ``if TYPE_CHECKING:`` was wrong: it marked the branch
as partial, but it should have been a line exclusion so the entire clause
would be excluded. Improves `issue 831`_.

- Fix: changed where .pth files are written for ``patch = subprocess``, closing
`issue 2006`_.

.. _issue 2006: https://github.com/coveragepy/coveragepy/issues/2006


.. _changes_7-10-0:

7.10.0

---------------------------

- A new configuration option: ":ref:`config_run_patch`" specifies named patches
to work around some limitations in coverage measurement.  These patches are
available:

- ``patch = _exit`` lets coverage save its data even when :func:`os._exit()
 <python:os._exit>` is used to abruptly end the process.  This closes
 long-standing `issue 310`_ as well as its duplicates: `issue 312`_, `issue
 1673`_, `issue 1845`_, and `issue 1941`_.

- ``patch = subprocess`` measures coverage in Python subprocesses created
 with :mod:`subprocess`, :func:`os.system`, or one of the :func:`execv
 <python:os.execl>` or :func:`spawnv <python:os.spawnl>` family of
 functions. Closes old `issue 367`_, its duplicate `issue 378`_ and old
 `issue 689`_.

- ``patch = execv`` adjusts the :func:`execv <python:os.execl>` family of
 functions to save coverage data before ending the current program and
 starting the next. Not available on Windows. Closes `issue 43`_ after 15
 years!

- The HTML report now dimly colors subsequent lines in multi-line statements.
They used to have no color.  This gives a better indication of the amount of
code missing in the report.  Closes `issue 1308`_.

- Two new exclusion patterns are part of the defaults: ``...`` is automatically
excluded as a line and ``if TYPE_CHECKING:`` is excluded as a branch.  Closes
`issue 831`_.

- A new command-line option: ``--save-signal=USR1`` specifies a signal that
coverage.py will listen for.  When the signal is sent, the coverage data will
be saved.  This makes it possible to save data from within long-running
processes.  Thanks, `Arkady Gilinsky <pull 1998_>`_.

- A new configuration option: ":ref:`config_report_partial_also`" is a list of
regexes to add as pragmas for partial branches.  This parallels the
":ref:`config_report_exclude_also`" setting for adding line exclusion
patterns.

- A few file path configuration settings didn't allow for tilde expansion:
:ref:`config_json_output`, :ref:`config_lcov_output` and
:ref:`config_run_debug_file`.  This is now fixed.

- Wheels are included for 3.14 now that 3.14 rc1 is available.

- We no longer ship a PyPy-specific wheel. PyPy will install the pure-Python
wheel.  Closes `issue 2001`_.

- In the very unusual situation of not having a current frame, coverage no
longer crashes when using the sysmon core, fixing `issue 2005`_.

.. _issue 43: https://github.com/coveragepy/coveragepy/issues/43
.. _issue 310: https://github.com/coveragepy/coveragepy/issues/310
.. _issue 312: https://github.com/coveragepy/coveragepy/issues/312
.. _issue 367: https://github.com/coveragepy/coveragepy/issues/367
.. _issue 378: https://github.com/coveragepy/coveragepy/issues/378
.. _issue 689: https://github.com/coveragepy/coveragepy/issues/689
.. _issue 831: https://github.com/coveragepy/coveragepy/issues/831
.. _issue 1308: https://github.com/coveragepy/coveragepy/issues/1308
.. _issue 1673: https://github.com/coveragepy/coveragepy/issues/1673
.. _issue 1845: https://github.com/coveragepy/coveragepy/issues/1845
.. _issue 1941: https://github.com/coveragepy/coveragepy/issues/1941
.. _pull 1998: https://github.com/coveragepy/coveragepy/pull/1998
.. _issue 2001: https://github.com/coveragepy/coveragepy/issues/2001
.. _issue 2005: https://github.com/coveragepy/coveragepy/issues/2005

.. _changes_7-9-2:

7.9.2

--------------------------

- Fix: complex conditionals within a line might cause a KeyError when using
sys.monitoring, as reported in `issue 1991`_.  This is now fixed.

- Fix: we can now measure coverage for code in Python archive (.par) files.
Thanks, `Itamer Oren <pull 1984_>`_.

.. _pull 1984: https://github.com/coveragepy/coveragepy/pull/1984
.. _issue 1991: https://github.com/coveragepy/coveragepy/issues/1991


.. _changes_7-9-1:

7.9.1

--------------------------

- The "no-ctracer" warning is not issued for Python pre-release versions.
Coverage doesn't ship compiled wheels for those versions, so this was far too
noisy.

- On Python 3.14+, the "sysmon" core is now the default if it's supported for
your configuration.  Plugins and dynamic contexts are still not supported
with it.


.. _changes_7-9-0:

7.9.0

--------------------------

- Added a ``[run] core`` configuration setting to specify the measurement core,
which was previously only available through the COVERAGE_CORE environment
variable. Finishes `issue 1746`_.

- Fixed incorrect rendering of f-strings with doubled braces, closing `issue
1980`_.

- If the C tracer core can't be imported, a warning ("no-ctracer") is issued
with the reason.

- The C tracer core extension module now conforms to `PEP 489`_, closing `issue
1977`_.  Thanks, `Adam Turner <pull 1978_>`_.

- Fixed a "ValueError: min() arg is an empty sequence" error caused by strange
empty modules, found by `oss-fuzz`_.

.. _issue 1746: https://github.com/coveragepy/coveragepy/issues/1746
.. _issue 1977: https://github.com/coveragepy/coveragepy/issues/1977
.. _pull 1978: https://github.com/coveragepy/coveragepy/pull/1978
.. _issue 1980: https://github.com/coveragepy/coveragepy/issues/1980
.. _PEP 489: https://peps.python.org/pep-0489
.. _oss-fuzz: https://google.github.io/oss-fuzz/


.. _changes_7-8-2:

7.8.2

--------------------------

- Wheels are provided for Windows ARM64 on Python 3.11, 3.12, and 3.13.
Thanks, `Finn Womack <pull 1972_>`_.

.. _issue 1971: https://github.com/coveragepy/coveragepy/pull/1971
.. _pull 1972: https://github.com/coveragepy/coveragepy/pull/1972

.. _changes_7-8-1:

7.8.1

--------------------------

- A number of EncodingWarnings were fixed that could appear if you've enabled
PYTHONWARNDEFAULTENCODING, fixing `issue 1966`_.  Thanks, `Henry Schreiner
<pull 1967_>`_.

- Fixed a race condition when using sys.monitoring with free-threading Python,
closing `issue 1970`_.

.. _issue 1966: https://github.com/coveragepy/coveragepy/issues/1966
.. _pull 1967: https://github.com/coveragepy/coveragepy/pull/1967
.. _issue 1970: https://github.com/coveragepy/coveragepy/issues/1970

.. _changes_7-8-0:
Links

Update exceptiongroup from 1.2.2 to 1.3.1.

Changelog

1.3.1

- Fixed ``AttributeError: 'TracebackException' object has no attribute 'exceptions'``
when formatting unpickled TBEs from another Python process which did not apply the
``exceptiongroup`` patches
(`144 <https://github.com/agronholm/exceptiongroup/issues/144>`_)

1.3.0

- Added ``**kwargs`` to function and method signatures as appropriate to match the
signatures in the standard library
- In line with the stdlib typings in typeshed, updated ``(Base)ExceptionGroup`` generic
types to define defaults for their generic arguments (defaulting to
``BaseExceptionGroup[BaseException]`` and ``ExceptionGroup[Exception]``)
(PR by mikenerone)
- Changed ``BaseExceptionGroup.__init__()`` to directly call
``BaseException.__init__()`` instead of the superclass ``__init__()`` in order to
emulate the CPython behavior (broken or not) (PR by cfbolz)
- Changed the ``exceptions`` attribute to always return the same tuple of exceptions,
created from the original exceptions sequence passed to ``BaseExceptionGroup`` to
match CPython behavior
(`143 <https://github.com/agronholm/exceptiongroup/issues/143>`_)
Links

Update flake8 from 7.2.0 to 7.3.0.

The bot wasn't able to find a changelog for this release. Got an idea?

Links

Update importlib-metadata from 8.7.0 to 8.7.1.

The bot wasn't able to find a changelog for this release. Got an idea?

Links

Update packaging from 25.0 to 26.0.

Changelog

26.0

~~~~~~~~~~~~~~~~~

Features:

* PEP 751: support pylock (:pull:`900`)
* PEP 794: import name metadata (:pull:`948`)
* Support for writing metadata to a file (:pull:`846`)
* Support ``__replace__`` on Version (:pull:`1003`)
* Support positional pattern matching for ``Version`` and ``SpecifierSet`` (:pull:`1004`)

Behavior adaptations:

* PEP 440 handling of prereleases for ``Specifier.contains``, ``SpecifierSet.contains``, and ``SpecifierSet.filter`` (:pull:`897`)
* Handle PEP 440 edge case in ``SpecifierSet.filter`` (:pull:`942`)
* Adjust arbitrary equality intersection preservation in ``SpecifierSet`` (:pull:`951`)
* Return ``False`` instead of raising for ``.contains`` with invalid version (:pull:`932`)
* Support arbitrary equality on arbitrary strings for ``Specifier`` and ``SpecifierSet``'s ``filter`` and ``contains`` method. (:pull:`954`)
* Only try to parse as ``Version`` on certain marker keys, return ``False`` on unequal ordered comparisons (:pull:`939`)

Fixes:

* Update ``_hash`` when unpickling ``Tag()`` (:pull:`860`)
* Correct comment and simplify implicit prerelease handling in ``Specifier.prereleases`` (:pull:`896`)
* Use explicit ``_GLibCVersion`` ``NamedTuple`` in ``_manylinux`` (:pull:`868`)
* Detect invalid license expressions containing ``()`` (:pull:`879`)
* Correct regex for metadata ``'name'`` format (:pull:`925`)
* Improve the message around expecting a semicolon (:pull:`833`)
* Support nested parens in license expressions (:pull:`931`)
* Add space before at symbol in ``Requirements`` string (:pull:`953`)
* A root logger use found, use a ``packaging`` logger instead (:pull:`965`)
* Better support for subclassing ``Marker`` and ``Requirement`` (:pull:`1022`)
* Normalize all extras, not just if it comes first (:pull:`1024`)
* Don't produce a broken repr if ``Marker`` fails to construct (:pull:`1033`)

Performance:

* Avoid recompiling regexes in the tokenizer for a 3x speedup (:pull:`1019`)
* Improve performance in ``_manylinux.py`` (:pull:`869`)
* Minor cleanups to ``Version`` (:pull:`913`)
* Skip redundant creation of ``Version``'s in specifier comparison (:pull:`986`)
* Cache the ``Specifier``'s ``Version`` (:pull:`985`)
* Make ``Version`` a little faster (:pull:`987`)
* Minor ``Version`` regex cleanup (:pull:`990`)
* Faster regex on Python 3.11.5+ for ``Version`` (:pull:`988`, :pull:`1055`)
* Lazily calculate ``_key`` in ``Version`` (:pull:`989`, :pull:`1048`)
* Faster ``canonicalize_version`` (:pull:`993`)
* Use ``re.fullmatch`` in a couple more places (:pull:`992`, :pull:`1029`)
* Use ``map`` instead of generator (:pull:`996`)
* Deprecate ``._version`` (``_Version``, a ``NamedTuple``) (:pull:`995`, :pull:`1062`)
* Avoid duplicate ``Version`` creation in ``canonicalize_version`` (:pull:`994`)
* Add ``__slots__`` to core classes  (:pull:`1001`, :pull:`1002`, :pull:`1032`)
* Use ``Version.__replace__`` in specifier comparison (:pull:`999`)
* Use ``_get_spec_version`` in more places in ``Specifier`` (:pull:`1005`)
* Pull ``set`` construction out of function (:pull:`1012`)
* Letter normalization dict for prereleases and the like (:pull:`1014`)
* Use ``str.partition`` in ``_parse_project_urls`` (:pull:`1013`)
* Avoid normalizing extras again when comparing (:pull:`1028`)
* Speed up ``Version.__str__`` by about 10% (:pull:`997`)
* Much faster ``canonicalize_name`` by avoiding a regex (:pull:`1030`, :pull:`1047`, :pull:`1064`)
* Faster zero stripping (:pull:`1058`)

Type annotations:

* Fix a type annotation (:pull:`907`)
* Fix type hint of function used with ``contextlib.contextmanager`` (:pull:`1046`)
* Fix tags return type in ``parse_wheel_filename`` docs (:pull:`973`)
* Add type hint for ``_version`` in ``.version.Version`` (:pull:`927`)
* Changed static type annotations in prereleases setter method in ``specifier.py`` (:pull:`930`)
* Statically type our test suite (:pull:`982`)

Internal:

* Test and declare support for Python 3.14 (:pull:`901`)
* Change our license metadata to use an SPDX license expression (:pull:`881`, :pull:`924`)
* Expand the Ruff checks run on our codebase (:pull:`835`, :pull:`957`, :pull:`959`,
:pull:`963`, :pull:`956`, :pull:`961`, :pull:`964`, :pull:`958`, :pull:`960`, :pull:`968`,
:pull:`967`, :pull:`966`, :pull:`969`, :pull:`980`, :pull:`979`, :pull:`962`, :pull:`984`,
:pull:`972`)
* Add spell checking (:pull:`904`, :pull:`910`, :pull:`1015`)
* Improve links back to source in the documentation (:pull:`991`)
* Add case insensitivity tests for arbitrary equality (:pull:`975`)
* Fix incorrectly implicitly concatenated string in specifiers test (:pull:`946`)
* Simpler else instead of assert in a check (:pull:`1027`, :pull:`1031`)
* Synchronize documentation and code for markers (:pull:`1008`)
* Use the GitHub Actions slim runner for the all pass check (:pull:`1021`)
* Use ``actionlint`` to check CI workflows (:pull:`1052`)
* Use Trusted Publishing (:pull:`893`, :pull:`1043`, :pull:`1045`, :pull:`1051`)
* Use zizmor to check CI (:pull:`1035`)
* Test on first public release of CPython 3.11 and newer (:pull:`1056`)


Since the final release candidate: Faster ``canonicalize_name``, especially on
Python 3.12 and 3.13, where performance regressed previously (:pull:`1064`),
and reintroduce (deprecated) support for ``Version._.version`` (:pull:`1062`).

26.0rc3

~~~~~~~~~~~~~~~~~~~~

Third release candidate for 26.0. Avoid bug in CPython 3.11.0-3.11.4 and older
PyPy 3.11 (:pull:`1055`).

26.0rc2

~~~~~~~~~~~~~~~~~~~~

Second release candidate for 26.0. Fixed a regression in (private)
``Version._key`` for ``packaging_legacy`` (:pull:`1048`), and speed up
stripping zeros a little more (:pull:`1058`).

26.0rc1

~~~~~~~~~~~~~~~~~~~~

First release candidate for 26.0.
Links

Update pluggy from 1.5.0 to 1.6.0.

Changelog

1.6.0

=========================

Deprecations and Removals
-------------------------

- `556 <https://github.com/pytest-dev/pluggy/issues/556>`_: Python 3.8 is no longer supported.



Bug Fixes
---------

- `504 <https://github.com/pytest-dev/pluggy/issues/504>`_: Fix a regression in pluggy 1.1.0 where using :func:`result.get_result() <pluggy.Result.get_result>` on the same failed :class:`~pluggy.Result` causes the exception's traceback to get longer and longer.


- `544 <https://github.com/pytest-dev/pluggy/issues/544>`_: Correctly pass :class:`StopIteration` through hook wrappers.

Raising a :class:`StopIteration` in a generator triggers a :class:`RuntimeError`.

If the :class:`RuntimeError` of a generator has the passed in :class:`StopIteration` as cause
resume with that :class:`StopIteration` as normal exception instead of failing with the :class:`RuntimeError`.


- `573 <https://github.com/pytest-dev/pluggy/issues/573>`_: Fix python 3.14 SyntaxError by rearranging code.
Links

Update pycodestyle from 2.13.0 to 2.14.0.

Changelog

2.14.0

-------------------

Changes:

* Add support for python 3.14.  PR 1283.
* Fix false positive for TypeVar defaults with more than one argument.
PR 1286.
Links

Update pyflakes from 3.3.2 to 3.4.0.

Changelog

3.4.0

- Add support for python 3.14
- Add "t-string is missing placeholders" error
- Fix annotation erroneously causing a name to be defined with
``from __future__ import annotations``
- Add support for always-deferred annotations (PEP 749)
Links

Update pyparsing from 3.2.3 to 3.3.2.

Changelog

3.3.2

-----------------------------
- Defined pyparsing-specific warning classes so that they can be selectively enabled
or disabled without affecting warnings raised by other libraries in the same Python
app:
- `PyparsingWarning` - base warning for all pyparsing-specific warnings (inherits
 from `UserWarning`)
- `PyparsingDeprecationWarning` - warning for using deprecated features (inherits
 from `PyparsingWarning` and `DeprecationWarning`)
- `PyparsingDiagnosticWarning` - warning raised when pyparsing diagnostics are
 enabled and a diagnostic feature is used (inherits from `PyparsingWarning`)

- Added `as_datetime` parse action to `pyparsing.common` - a more generalized
version of the `convert_to_datetime` parse action (supports any expression that extracts
date/time fields into "year", "month", "day", etc. results names), and validates
that the parsed fields represent a valid date and time.

- Added `iso8601_date_validated` and `iso8601_datetime_validated` expressions to
`pyparsing.common`, which return a Python `datetime.datetime`

- Various performance improvements in `ParseResults` class and core functions, with
10-20% performance overall.

- Added `regex_inverter` web page (using PyScript) to demonstrate using the `inv_regex.py`
example.

- Expanded regex forms handled by the `examples/inv_regex.py` example:
- named capturing groups (`?P<name>`)
- partial repetition (`{m,}` and `{,n}`)
- negated character classes (`[^...]`)

- Added `SPy` (Simplified Python) parser to examples.

3.3.1

------------------------------
- Added license info to metadata, following PEP-639. Thanks to Gedalia Pasternak and
Marc Mueller for submitted issue and PR. Fixes 626.

3.3.0

------------------------------
===========================================================================================
The version 3.3.0 release will begin emitting `DeprecationWarnings` for pyparsing methods
that have been renamed to PEP8-compliant names (introduced in pyparsing 3.0.0, in August,
2021, with legacy names retained as aliases). In preparation, I added in pyparsing
3.2.2 a utility for finding and replacing the legacy method names with the new names.
This utility is located at `pyparsing/tools/cvt_pep8_names.py`. This script will scan all
Python files specified on the command line, and if the `-u` option is selected, will
replace all occurrences of the old method names with the new PEP8-compliant names,
updating the files in place.

Here is an example that converts all the files in the pyparsing `/examples` directory:

   python -m pyparsing.tools.cvt_pyparsing_pep8_names -u examples/*.py

The new names are compatible with pyparsing versions 3.0.0 and later.
===========================================================================================

- Deprecated `indentedBlock`, when converted using the `cvt_pyparsing_pep8_names`
utility, will emit `UserWarnings` that additional code changes will be required.
This is because the new `IndentedBlock` class no longer requires the calling code
to supply an indent stack, while adding support for nested indentation levels
and grouping.

- Deprecated `locatedExpr`, when converted using the `cvt_pyparsing_pep8_names`
utility, will emit `UserWarnings` that additional code changes may be required.
The new `Located` class removes the extra grouping level of the parsed values.
(If the original `locatedExpr` parser was defined with a results name, then
the extra grouping is retained, so that the results name nesting works properly;
in this case, no code changes would be required.)

- Updated all examples and test cases to use PEP8 names (unless the test case is specifically
designed to test behavior of a legacy method). Added railroad diagrams for some examples.

- Added exception handling when calling `formatted_message()`, so that `str(exception)`
always returns at least _something_.

- All unit tests pass with Python 3.14, including 3.14t. This does _not_ necessarily
mean that pyparsing is now thread-safe, just that when run in the free-threaded
interpreter, there were no errors. None of the unit tests try to do any parsing
with multiple threads - they test the basic functionality of the library, under various
versions of packrat and left-recursive parsing.

- Added AI instructions so that AI agents can be prompted with best practices
for generating parsers using pyparsing code. These instructions are in the
`ai/best_practices.md` file, and can be accessed programmatically by calling
`pyparsing.show_best_practices()` or running `python -m pyparsing.ai.show_best_practices`
from the command line, after installing the `pyparsing` package.

- Implemented a TINY language parser/interpreter using pyparsing, in the `examples/tiny`
directory. This is a little tutorial language that I used to demonstrate how to use pyparsing to
build a simple interpreter, following a recommended parser+AST+engine+run structure.
The `docs` sub-directory also includes transcripts of the AI session used to create the
parser and the interpreter. The `samples` sub-directory includes a few sample TINY programs.

- Fixed minor formatting bugs in `pyparsing.testing.with_line_numbers`, found during development
of the TINY language example.

- Added test in `DelimitedList` and `nested_expr` which auto-suppress delimiting commas to
avoid wrapping in a `Suppress` if delimiter is already a `Suppress`.

- Added performance benchmarking tools and documentation:
- `tests/perf_pyparsing.py` runs a series of benchmark parsing tests, exercising different
 aspects of the pyparsing package. For cross-version analysis, this script can export
 results as CSV and append to a consolidated data file.
- Runner scripts `run_perf_all_tags.bat` (Windows) and `run_perf_all_tags.sh` (Ubuntu/bash)
 execute the benchmark across multiple Python versions (3.9–3.14) and pyparsing versions
 (3.1.1 through 3.3.0), aggregating results into `perf_pyparsing.csv` at the repo root.
- See `tests/README.md` for usage instructions.

- Used performance benchmarking to identify and revert an inefficient utility method used in
`transform_string` (introduced in pyparsing 3.2.0b2).

3.2.5

-------------------------------
- JINX! Well, 3.2.4 had a bug for `Word` expressions that include a space
character, if that expression was then copied, either directly with .copy() or
by adding a results name, or included in another construct (like `DelimitedList`)
that makes a copy internally. Issue 618, reported by mstinberg, among others -
thanks, and sorry for the inconvenience.

3.2.4

-------------------------------
- Barring any catastrophic bugs in this release, this will be the last release in
the 3.2.x line. The next release, 3.3.0, will begin emitting `DeprecationWarnings`
when the pre-PEP8 methods are used (see header notes above for more information,
including available automation for converting any existing code using
pyparsing with the old names).

- Fixed bug when using a copy of a `Word` expression (either by using the explicit
`copy()` method, or attaching a results name), and setting a new expression name,
a raised `ParseException` still used the original expression name. Also affected
`Regex` expressions with `as_match` or `as_group_list` = True. Reported by
Waqas Ilyas, in Issue 612 - good catch!

- Fixed type annotation for `replace_with`, to accept `Any` type. Fixes Issue 602,
reported by esquonk.

- Added locking around potential race condition in `ParserElement.reset_cache`, as
well as other cache-related methods. Fixes Issue 604, reported by CarlosDescalziIM.

- Substantial update to docstrings and doc generation in preparation for 3.3.0,
great effort by FeRD, thanks!

- Notable addition by FeRD to convert docstring examples to work with doctest! This
was long overdue, thanks so much!
Links

Update pytest from 8.3.5 to 9.0.2.

Changelog

9.0.2

=========================

Bug fixes
---------

- `13896 <https://github.com/pytest-dev/pytest/issues/13896>`_: The terminal progress feature added in pytest 9.0.0 has been disabled by default, except on Windows, due to compatibility issues with some terminal emulators.

You may enable it again by passing ``-p terminalprogress``. We may enable it by default again once compatibility improves in the future.

Additionally, when the environment variable ``TERM`` is ``dumb``, the escape codes are no longer emitted, even if the plugin is enabled.


- `13904 <https://github.com/pytest-dev/pytest/issues/13904>`_: Fixed the TOML type of the :confval:`tmp_path_retention_count` settings in the API reference from number to string.


- `13946 <https://github.com/pytest-dev/pytest/issues/13946>`_: The private ``config.inicfg`` attribute was changed in a breaking manner in pytest 9.0.0.
Due to its usage in the ecosystem, it is now restored to working order using a compatibility shim.
It will be deprecated in pytest 9.1 and removed in pytest 10.


- `13965 <https://github.com/pytest-dev/pytest/issues/13965>`_: Fixed quadratic-time behavior when handling ``unittest`` subtests in Python 3.10.



Improved documentation
----------------------

- `4492 <https://github.com/pytest-dev/pytest/issues/4492>`_: The API Reference now contains cross-reference-able documentation of :ref:`pytest's command-line flags <command-line-flags>`.

9.0.1

=========================

Bug fixes
---------

- `13895 <https://github.com/pytest-dev/pytest/issues/13895>`_: Restore support for skipping tests via ``raise unittest.SkipTest``.


- `13896 <https://github.com/pytest-dev/pytest/issues/13896>`_: The terminal progress plugin added in pytest 9.0 is now automatically disabled when iTerm2 is detected, it generated desktop notifications instead of the desired functionality.


- `13904 <https://github.com/pytest-dev/pytest/issues/13904>`_: Fixed the TOML type of the verbosity settings in the API reference from number to string.


- `13910 <https://github.com/pytest-dev/pytest/issues/13910>`_: Fixed `UserWarning: Do not expect file_or_dir` on some earlier Python 3.12 and 3.13 point versions.



Packaging updates and notes for downstreams
-------------------------------------------

- `13933 <https://github.com/pytest-dev/pytest/issues/13933>`_: The tox configuration has been adjusted to make sure the desired
version string can be passed into its :ref:`package_env` through
the ``SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST`` environment
variable as a part of the release process -- by :user:`webknjaz`.



Contributor-facing changes
--------------------------

- `13891 <https://github.com/pytest-dev/pytest/issues/13891>`_, `#13942 <https://github.com/pytest-dev/pytest/issues/13942>`_: The CI/CD part of the release automation is now capable of
creating GitHub Releases without having a Git checkout on
disk -- by :user:`bluetech` and :user:`webknjaz`.


- `13933 <https://github.com/pytest-dev/pytest/issues/13933>`_: The tox configuration has been adjusted to make sure the desired
version string can be passed into its :ref:`package_env` through
the ``SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST`` environment
variable as a part of the release process -- by :user:`webknjaz`.

9.0.0

=========================

New features
------------


- `1367 <https://github.com/pytest-dev/pytest/issues/1367>`_: **Support for subtests** has been added.

:ref:`subtests <subtests>` are an alternative to parametrization, useful in situations where the parametrization values are not all known at collection time.

Example:

.. code-block:: python

   def contains_docstring(p: Path) -> bool:
       """Return True if the given Python file contains a top-level docstring."""
       ...


   def test_py_files_contain_docstring(subtests: pytest.Subtests) -> None:
       for path in Path.cwd().glob("*.py"):
           with subtests.test(path=str(path)):
               assert contains_docstring(path)


Each assert failure or error is caught by the context manager and reported individually, giving a clear picture of all files that are missing a docstring.

In addition, :meth:`unittest.TestCase.subTest` is now also supported.

This feature was originally implemented as a separate plugin in `pytest-subtests <https://github.com/pytest-dev/pytest-subtests>`__, but since then has been merged into the core.

.. note::

   This feature is experimental and will likely evolve in future releases. By that we mean that we might change how subtests are reported on failure, but the functionality and how to use it are stable.


- `13743 <https://github.com/pytest-dev/pytest/issues/13743>`_: Added support for **native TOML configuration files**.

While pytest, since version 6, supports configuration in ``pyproject.toml`` files under ``[tool.pytest.ini_options]``,
it does so in an "INI compatibility mode", where all configuration values are treated as strings or list of strings.
Now, pytest supports the native TOML data model.

In ``pyproject.toml``, the native TOML configuration is under the ``[tool.pytest]`` table.

.. code-block:: toml

    pyproject.toml
   [tool.pytest]
   minversion = "9.0"
   addopts = ["-ra", "-q"]
   testpaths = [
       "tests",
       "integration",
   ]

The ``[tool.pytest.ini_options]`` table remains supported, but both tables cannot be used at the same time.

If you prefer to use a separate configuration file, or don't use ``pyproject.toml``, you can use ``pytest.toml`` or ``.pytest.toml``:

.. code-block:: toml

    pytest.toml or .pytest.toml
   [pytest]
   minversion = "9.0"
   addopts = ["-ra", "-q"]
   testpaths = [
       "tests",
       "integration",
   ]

The documentation now (sometimes) shows configuration snippets in both TOML and INI formats, in a tabbed interface.

See :ref:`config file formats` for full details.


- `13823 <https://github.com/pytest-dev/pytest/issues/13823>`_: Added a **"strict mode"** enabled by the :confval:`strict` configuration option.

When set to ``true``, the :confval:`strict` option currently enables

* :confval:`strict_config`
* :confval:`strict_markers`
* :confval:`strict_parametrization_ids`
* :confval:`strict_xfail`

The individual strictness options can be explicitly set to override the global :confval:`strict` setting.

The previously-deprecated ``--strict`` command-line flag now enables strict mode.

If pytest adds new strictness options in the future, they will also be enabled in strict mode.
Therefore, you should only enable strict mode if you use a pinned/locked version of pytest,
or if you want to proactively adopt new strictness options as they are added.

See :ref:`strict mode` for more details.


- `13737 <https://github.com/pytest-dev/pytest/issues/13737>`_: Added the :confval:`strict_parametrization_ids` configuration option.

When set, pytest emits an error if it detects non-unique parameter set IDs,
rather than automatically making the IDs unique by adding `0`, `1`, ... to them.
This can be particularly useful for catching unintended duplicates.


- `13072 <https://github.com/pytest-dev/pytest/issues/13072>`_: Added support for displaying test session **progress in the terminal tab** using the `OSC 9;4; <https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC>`_ ANSI sequence.

**Note**: *This feature has been disabled by default in version 9.0.2, except on Windows, due to compatibility issues with some terminal emulators.
You may enable it again by passing* ``-p terminalprogress``. *We may enable it by default again once compatibility improves in the future.*

When pytest runs in a supported terminal emulator like ConEmu, Gnome Terminal, Ptyxis, Windows Terminal, Kitty or Ghostty,
you'll see the progress in the terminal tab or window,
allowing you to monitor pytest's progress at a glance.

This feature is automatically enabled when running in a TTY. It is implemented as an internal plugin. If needed, it can be disabled as follows:
- On a user level, using ``-p no:terminalprogress`` on the command line or via an environment variable ``PYTEST_ADDO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant