Fix: coverage used to fail when measuring code using :func:runpy.run_path <python:runpy.run_path> with a :class:Path <python:pathlib.Path> argument.
This is now fixed, thanks to Ask Hjorth Larsen <pull 1819_>_.
Fix: backslashes preceding a multi-line backslashed string could confuse the
HTML report. This is now fixed, thanks to LiuYinCarl <pull 1828_>_.
Now we publish wheels for Python 3.13, both regular and free-threaded.
Exclusion patterns can now be multi-line, thanks to Daniel Diniz <pull 1807_>. This enables many interesting exclusion use-cases, including those
requested in issues 118 <issue 118_> (entire files), 996 <issue 996_>_ (multiple lines only when appearing together), 1741 <issue 1741_>_ (remainder of a function), and 1803 <issue 1803_>_
(arbitrary sequence of marked lines). See the :ref:multi_line_exclude
section of the docs for more details and examples.
The JSON report now includes per-function and per-class coverage information.
Thanks to Daniel Diniz <pull 1809_>_ for getting the work started. This
closes issue 1793_ and issue 1532_.
Fixed an incorrect calculation of "(no class)" lines in the HTML classes
report.
This library adheres to Semantic Versioning 2.0 <http://semver.org/>_.
1.2.2
Removed an assert in exceptiongroup._formatting that caused compatibility
issues with Sentry ([#123](https://github.com/agronholm/exceptiongroup/issues/123) <https://github.com/agronholm/exceptiongroup/issues/123>_)
1.2.1
Updated the copying of __notes__ to match CPython behavior (PR by CF Bolz-Tereick)
Corrected the type annotation of the exception handler callback to accept a
BaseExceptionGroup instead of BaseException
Fixed type errors on Python < 3.10 and the type annotation of suppress()
(PR by John Litborn)
1.2.0
Added special monkeypatching if Apport <https://github.com/canonical/apport>_ has
overridden sys.excepthook so it will format exception groups correctly
(PR by John Litborn)
Added a backport of contextlib.suppress() from Python 3.12.1 which also handles
suppressing exceptions inside exception groups
Fixed bare raise in a handler reraising the original naked exception rather than
an exception group which is what is raised when you do a raise in an except*
handler
1.1.3
catch() now raises a TypeError if passed an async exception handler instead of
just giving a RuntimeWarning about the coroutine never being awaited. (#66, PR by
John Litborn)
Fixed plain raise statement in an exception handler callback to work like a
raise in an except* block
Fixed new exception group not being chained to the original exception when raising an
exception group from exceptions raised in handler callbacks
Fixed type annotations of the derive(), subgroup() and split() methods to
match the ones in typeshed
1.1.2
Changed handling of exceptions in exception group handler callbacks to not wrap a
single exception in an exception group, as per
CPython issue 103590 <https://github.com/python/cpython/issues/103590>_
We’ve just uploaded mypy 1.11 to the Python Package Index (PyPI). Mypy is a static type checker for Python. This release includes new features, performance improvements and bug fixes. You can install it as follows:
python3 -m pip install -U mypy
You can read the full documentation for this release on Read the Docs.
Support Python 3.12 Syntax for Generics (PEP 695)
Mypy now supports the new type parameter syntax introduced in Python 3.12 (PEP 695).
This feature is still experimental and must be enabled with the --enable-incomplete-feature=NewGenericSyntax flag, or with enable_incomplete_feature = NewGenericSyntax in the mypy configuration file.
We plan to enable this by default in the next mypy feature release.
This example demonstrates the new syntax:
# Generic function
def f[T](https://github.com/python/mypy/blob/master/x: T) -> T: ...
reveal_type(f(1)) # Revealed type is 'int'
Generic class
class C[T]:
def init(self, x: T) -> None:
self.x = x
c = C('a')
reveal_type(c.x) # Revealed type is 'str'
Type alias
type A[T] = C[list[T]]
This feature was contributed by Jukka Lehtosalo.
Support for functools.partial
Mypy now type checks uses of functools.partial. Previously mypy would accept arbitrary arguments.
This is a fairly large update. Mostly an accumulation of small fixes and enhancements. Nothing qualifies as a *breaking change (for some definition), but there may be some subtly changes to output. Check below for anything that might affect you!
[13.8.0] - 2024-08-26
Fixed
Fixed Table rendering of box elements so "footer" elements truly appear at bottom of table, "mid" elements in main table body.
[flake8-simplify] Extend open-file-with-context-handler to work with dbm.sqlite3 (SIM115) (#13104)
[pycodestyle] Disable E741 in stub files (.pyi) (#13119)
[pydoclint] Avoid DOC201 on explicit returns in functions that only return None (#13064)
Rule changes
[flake8-async] Disable check for asyncio before Python 3.11 (ASYNC109) (#13023)
Bug fixes
[FastAPI] Avoid introducing invalid syntax in fix for fast-api-non-annotated-dependency (FAST002) (#13133)
[flake8-implicit-str-concat] Normalize octals before merging concatenated strings in single-line-implicit-string-concatenation (ISC001) (#13118)
[flake8-pytest-style] Improve help message for pytest-incorrect-mark-parentheses-style (PT023) (#13092)
[pylint] Avoid autofix for calls that aren't min or max as starred expression (PLW3301) (#13089)
[ruff] Add datetime.time, datetime.tzinfo, and datetime.timezone as immutable function calls (RUF009) (#13109)
[ruff] Extend comment deletion for RUF100 to include trailing text from noqa directives while preserving any following comments on the same line, if any (#13105)
Fix dark theme on initial page load for the Ruff playground (#13077)
[flake8-simplify] Extend open-file-with-context-handler to work with dbm.sqlite3 (SIM115) (#13104)
[pycodestyle] Disable E741 in stub files (.pyi) (#13119)
[pydoclint] Avoid DOC201 on explicit returns in functions that only return None (#13064)
Rule changes
[flake8-async] Disable check for asyncio before Python 3.11 (ASYNC109) (#13023)
Bug fixes
[FastAPI] Avoid introducing invalid syntax in fix for fast-api-non-annotated-dependency (FAST002) (#13133)
[flake8-implicit-str-concat] Normalize octals before merging concatenated strings in single-line-implicit-string-concatenation (ISC001) (#13118)
[flake8-pytest-style] Improve help message for pytest-incorrect-mark-parentheses-style (PT023) (#13092)
[pylint] Avoid autofix for calls that aren't min or max as starred expression (PLW3301) (#13089)
[ruff] Add datetime.time, datetime.tzinfo, and datetime.timezone as immutable function calls (RUF009) (#13109)
[ruff] Extend comment deletion for RUF100 to include trailing text from noqa directives while preserving any following comments on the same line, if any (#13105)
Fix dark theme on initial page load for the Ruff playground (#13077)
0.6.2
Preview features
[flake8-simplify] Extend open-file-with-context-handler to work with other standard-library IO modules (SIM115) (#12959)
[ruff] Avoid unused-async for functions with FastAPI route decorator (RUF029) (#12938)
[ruff] Ignore fstring-missing-syntax (RUF027) for fastAPI paths (#12939)
[ruff] Implement check for Decimal called with a float literal (RUF032) (#12909)
Rule changes
[flake8-bugbear] Update diagnostic message when expression is at the end of function (B015) (#12944)
[flake8-pyi] Skip type annotations in string-or-bytes-too-long (PYI053) (#13002)
[flake8-type-checking] Always recognise relative imports as first-party (#12994)
[flake8-unused-arguments] Ignore unused arguments on stub functions (ARG001) (#12966)
[pylint] Ignore augmented assignment for self-cls-assignment (PLW0642) (#12957)
[pep8-naming] Don't flag from imports following conventional import names (N817) (#12946)
[pylint] - Allow __new__ methods to have cls as their first argument even if decorated with @staticmethod for bad-staticmethod-argument (PLW0211) (#12958)
Bumps the python-packages group with 11 updates:
7.5.3
7.6.1
24.4.2
24.8.0
2024.6.2
2024.8.30
1.2.1
1.2.2
0.27.0
0.27.2
3.7
3.8
5.2.2
5.3.0
1.10.0
1.11.2
13.7.1
13.8.0
0.4.9
0.6.3
0.12.5
0.13.2
Updates
coverage
from 7.5.3 to 7.6.1Changelog
Sourced from coverage's changelog.
... (truncated)
Commits
29f5898
docs: sample HTML for 7.6.19b829f1
docs: prep for 7.6.1ebbb6a2
build: wheels for 3.13rc13872525
chore: make upgrade7a27f40
test: fix a test on free-threading, use abiflags to get site-packages path co...2b53664
build: include gil/nogil in the version bannerda1682f
docs: changelog and contributor for #1828dc819ff
test: two tests for #18289aaa404
fix: properly handle backslash before multi-line string (#1828)9c50270
chore: make upgradeUpdates
black
from 24.4.2 to 24.8.0Release notes
Sourced from black's releases.
Changelog
Sourced from black's changelog.
Commits
b965c2a
Prepare release 24.8.0 (#4426)9ccf279
Documentfind_project_root
ignoringpyproject.toml
without[tool.black]
...14b6e61
fix: Enhace black efficiently to skip directories listed in .gitignore (#4415)b1c4dd9
fix: respect braces better in f-string parsing (#4422)4b4ae43
Fix incorrect linenos on fstring tokens with escaped newlines (#4423)7fa1faf
docs: fix the installation command of extra for blackd (#4413)8827acc
Bump sphinx from 7.3.7 to 7.4.0 in /docs (#4404)b0da11d
Bump furo from 2024.5.6 to 2024.7.18 in /docs (#4409)721dff5
fix: avoid formatting backslash strings inside f-strings (#4401)7e2afc9
Updateactions/checkout
to v4 to stop node deprecation warnings (#4379)Updates
certifi
from 2024.6.2 to 2024.8.30Commits
325c2fd
2024.08.30 (#304)d66bf5f
Bump actions/upload-artifact from 4.3.5 to 4.3.6 (#302)2150f23
Bump actions/upload-artifact from 4.3.4 to 4.3.5 (#301)fc9b771
Bump actions/setup-python from 5.1.0 to 5.1.1 (#300)965b239
Bump actions/download-artifact from 4.1.7 to 4.1.8 (#297)c1f50cc
Bump actions/upload-artifact from 4.3.3 to 4.3.4 (#296)bd81538
2024.07.04 (#295)06a2cbf
Bump peter-evans/create-pull-request from 6.0.5 to 6.1.0 (#294)13bba02
Bump actions/checkout from 4.1.6 to 4.1.7 (#293)e8abcd0
Bump pypa/gh-action-pypi-publish from 1.8.14 to 1.9.0 (#292)Updates
exceptiongroup
from 1.2.1 to 1.2.2Release notes
Sourced from exceptiongroup's releases.
Changelog
Sourced from exceptiongroup's changelog.
... (truncated)
Commits
2399d54
Added the release versionbec9651
Removed problematic assert that caused compatibility issuesf3f0ff6
Updated Ruff configurationbb43ee0
Fixed formatting tests failing on Python 3.13eb8fbbc
[pre-commit.ci] pre-commit autoupdate (#129)6ff8300
[pre-commit.ci] pre-commit autoupdate (#128)761933f
[pre-commit.ci] pre-commit autoupdate (#127)1b43294
[pre-commit.ci] pre-commit autoupdate (#125)dd87018
[pre-commit.ci] pre-commit autoupdate (#124)54d8b8d
[pre-commit.ci] pre-commit autoupdate (#121)Updates
httpx
from 0.27.0 to 0.27.2Release notes
Sourced from httpx's releases.
Changelog
Sourced from httpx's changelog.
Commits
609df7e
ReintroduceURLTypes
. (#3288)1d6b663
Update CHANGELOG for 0.27.1 release date. (#3285)1bf1ba5
Version 0.27.1 (#3275)7c0cda1
Improve InvalidURL error message. (#3250)beb501f
Bump the python-packages group across 1 directory with 8 updates (#3247)359f77d
Clean up URL signature. (#3245)b351a44
Update requirements.txt (#3246)db9072f
Add URL parsing tests from WHATWG (#3188)92e9dfb
Update asgi.py docstring (#3210)e186ecc
Bump the python-packages group with 8 updates (#3213)Updates
idna
from 3.7 to 3.8Release notes
Sourced from idna's releases.
Changelog
Sourced from idna's changelog.
Commits
784c6f4
Release v3.828c7c9e
Typo fixa2b41c3
Pin remainder of Github Actions flagged in code scanning1f613c5
More Github Action dependency pinninga87e2b6
Update OSSF scorecard to latest version12d4dd1
Merge pull request #182 from kjd/github-pypi-actionse1a1541
Pin Github Actions dependenciesc109d3a
Merge branch 'master' into github-pypi-actionsf8a8de4
Do not try to build/send packages to TestPyPI for now613bdde
Update regexp to move global flag to start of expressionUpdates
lxml
from 5.2.2 to 5.3.0Changelog
Sourced from lxml's changelog.
Commits
475f4ab
Update release date.e356a1e
Build: Add some debug output.8345680
Build: Retry library downloads on failures.2fe6c90
CI: Test oldest officially supported library versions again (the slightly new...00335a1
Build: Improve download regexes.f3da47d
Prepare release of lxml 5.3.0.3119703
Add missing global name to "all" in lxml.etree.9de6180
Build: Upgrade cibuildwheel version also for the matrix setup.54e36cb
Build: Upgrade libxslt to latest (1.1.42).d4f56ee
Build: Slightly increase the oldest libxslt version that we test against to w...Updates
mypy
from 1.10.0 to 1.11.2Changelog
Sourced from mypy's changelog.
... (truncated)
Commits
789f02c
Bump version to 1.11.2917cc75
An alternative fix for a union-like literal string (#17639)7d805b3
Unwrap TypedDict item types before storing (#17640)32675dd
Revert "Fix Literal strings containing pipe characters" (#17638)778542b
Revert "FixRawExpressionType.accept
crash with--cache-fine-grained
" (#1...14ab742
Bump version to 1.11.2+dev570b90a
Bump version to 1.11b3a102e
FixRawExpressionType.accept
crash with--cache-fine-grained
(#17588)aec04c7
Fix PEP 604 isinstance caching (#17563)cb44e4d
Fixtyping.TypeAliasType
being undefined on python < 3.12 (#17558)Updates
rich
from 13.7.1 to 13.8.0Release notes
Sourced from rich's releases.
Changelog
Sourced from rich's changelog.
Commits
9ec4191
Merge pull request #3473 from Textualize/bump13809c74f03
bump to v13.8.0dc7a195
Merge pull request #3472 from Textualize/fix-bad-dataclassc938830
changelog6055e2d
fix for missing field in dataclassb6f2f7a
Merge pull request #3454 from subrat-lima/masterb1397be
Merge pull request #3455 from jjhelmus/dataclasses_3.13035f3ea
Merge pull request #3452 from sbraz/typos_examplesd6abebd
Merge branch 'master' into dataclasses_3.131b2dada
Merge pull request #3471 from Textualize/fix-append-tokensUpdates
ruff
from 0.4.9 to 0.6.3Release notes
Sourced from ruff's releases.
... (truncated)
Changelog
Sourced from ruff's changelog.
... (truncated)
Commits
ee258ca
Bump version to 0.6.3 (#13152)b4d9d26
Update faq.md to highlight changes to src (#13145)a998320
[ruff
] - extend comment deletions for unused-noqa (RUF100
) (#13105)770ef2a
[red-knot] support deferred evaluation of type expressions (#13131)c6023c0
[red-knot] Add docs on usingRAYON_NUM_THREADS
for better logging (#13140)df694ca
[FastAPI
] Avoid introducing invalid syntax in fix for `fast-api-non-annotat...2e75cfb
FormatPYI
examples in docs as.pyi
-file snippets (#13116)cfafaa7
[red-knot] Remove very noisy tracing call when resolvingImportFrom
stateme...3e9c7ad
Replace crates by dependi for VS Code Dev Container (#13125)81cd438
red-knot: infer and display ellipsis type (#13124)Updates
tomlkit
from 0.12.5 to 0.13.2Release notes
Sourced from tomlkit's releases.
Changelog
Sourced from