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.
#11412: Emit warnings on using a deprecated Python-specific index entry type
(namely, module, keyword, operator, object, exception,
statement, and builtin) in the :rst:dir:index directive, and
set the removal version to Sphinx 9. Patch by Adam Turner.
Features added
#11415: Add a checksum to JavaScript and CSS asset URIs included within
generated HTML, using the CRC32 algorithm.
:meth:~sphinx.application.Sphinx.require_sphinx now allows the version
requirement to be specified as (major, minor).
#11011: Allow configuring a line-length limit for object signatures, via
:confval:maximum_signature_line_length and the domain-specific variants.
If the length of the signature (in characters) is greater than the configured
limit, each parameter in the signature will be split to its own logical line.
This behaviour may also be controlled by options on object description
directives, for example :rst:dir:py:function:single-line-parameter-list.
#12652: Resolve regression [conda]{.title-ref} environments where no longer being automatically detected.
-- by RonnyPfannschmidt{.interpreted-text role="user"}
8.3.1
pytest 8.3.1 (2024-07-20)
The 8.3.0 release failed to include the change notes and docs for the release. This patch release remedies this. There are no other changes.
8.3.0
pytest 8.3.0 (2024-07-20)
New features
#12231: Added [--xfail-tb]{.title-ref} flag, which turns on traceback output for XFAIL results.
If the [--xfail-tb]{.title-ref} flag is not given, tracebacks for XFAIL results are NOT shown.
The style of traceback for XFAIL is set with [--tb]{.title-ref}, and can be [auto|long|short|line|native|no]{.title-ref}.
Note: Even if you have [--xfail-tb]{.title-ref} set, you won't see them if [--tb=no]{.title-ref}.
Some history:
With pytest 8.0, [-rx]{.title-ref} or [-ra]{.title-ref} would not only turn on summary reports for xfail, but also report the tracebacks for xfail results. This caused issues with some projects that utilize xfail, but don't want to see all of the xfail tracebacks.
This change detaches xfail tracebacks from [-rx]{.title-ref}, and now we turn on xfail tracebacks with [--xfail-tb]{.title-ref}. With this, the default [-rx]{.title-ref}/ [-ra]{.title-ref} behavior is identical to pre-8.0 with respect to xfail tracebacks. While this is a behavior change, it brings default behavior back to pre-8.0.0 behavior, which ultimately was considered the better course of action.
#12281: Added support for keyword matching in marker expressions.
Now tests can be selected by marker keyword arguments.
Supported values are int{.interpreted-text role="class"}, (unescaped) str{.interpreted-text role="class"}, bool{.interpreted-text role="class"} & None{.interpreted-text role="data"}.
See marker examples <marker_keyword_expression_example>{.interpreted-text role="ref"} for more information.
-- by lovetheguitar{.interpreted-text role="user"}
#12567: Added --no-fold-skipped command line option.
If this option is set, then skipped tests in short summary are no longer grouped
by reason but all tests are printed individually with their nodeid in the same
way as other statuses.
The library provides useful fixtures for creation test aiohttp server and client.
Installation
.. code-block:: console
$ pip install pytest-aiohttp
Add asyncio_mode = auto line to pytest configuration <https://docs.pytest.org/en/latest/customize.html>_ (see pytest-asyncio modes <https://github.com/pytest-dev/pytest-asyncio#modes>_ for details). The plugin works
with strict mode also.
Usage
Write tests in pytest-asyncio <https://github.com/pytest-dev/pytest-asyncio>_ style
using provided fixtures for aiohttp test server and client creation. The plugin provides
resources cleanup out-of-the-box.
Fixes a bug that caused duplicate markers in async tests #813
Known issues
As of v0.23, pytest-asyncio attaches an asyncio event loop to each item of the test suite (i.e. session, packages, modules, classes, functions) and allows tests to be run in those loops when marked accordingly. Pytest-asyncio currently assumes that async fixture scope is correlated with the new event loop scope. This prevents fixtures from being evaluated independently from the event loop scope and breaks some existing test suites (see #706). For example, a test suite may require all fixtures and tests to run in the same event loop, but have async fixtures that are set up and torn down for each module. If you're affected by this issue, please continue using the v0.21 release, until it is resolved.
pytest-asyncio 0.23.7
0.23.7 (2024-05-19)
Silence deprecation warnings about unclosed event loops that occurred with certain CPython patch releases #817
Known issues
As of v0.23, pytest-asyncio attaches an asyncio event loop to each item of the test suite (i.e. session, packages, modules, classes, functions) and allows tests to be run in those loops when marked accordingly. Pytest-asyncio currently assumes that async fixture scope is correlated with the new event loop scope. This prevents fixtures from being evaluated independently from the event loop scope and breaks some existing test suites (see #706). For example, a test suite may require all fixtures and tests to run in the same event loop, but have async fixtures that are set up and torn down for each module. If you're affected by this issue, please continue using the v0.21 release, until it is resolved.
As of v0.23, pytest-asyncio attaches an asyncio event loop to each item of the test suite (i.e. session, packages, modules, classes, functions) and allows tests to be run in those loops when marked accordingly. Pytest-asyncio currently assumes that async fixture scope is correlated with the new event loop scope. This prevents fixtures from being evaluated independently from the event loop scope and breaks some existing test suites (see #706). For example, a test suite may require all fixtures and tests to run in the same event loop, but have async fixtures that are set up and torn down for each module. If you're affected by this issue, please continue using the v0.21 release, until it is resolved.
Fix typing errors with recent versions of mypy #769
Prevent DeprecationWarning about internal use of asyncio.get_event_loop() from affecting test cases #757
Known issues
As of v0.23, pytest-asyncio attaches an asyncio event loop to each item of the test suite (i.e. session, packages, modules, classes, functions) and allows tests to be run in those loops when marked accordingly. Pytest-asyncio currently assumes that async fixture scope is correlated with the new event loop scope. This prevents fixtures from being evaluated independently from the event loop scope and breaks some existing test suites (see #706). For example, a test suite may require all fixtures and tests to run in the same event loop, but have async fixtures that are set up and torn down for each module. If you're affected by this issue, please continue using the v0.21 release, until it is resolved.
Fix typing errors with recent versions of mypy #769
Prevent DeprecationWarning about internal use of asyncio.get_event_loop() from affecting test cases #757
Known issues
As of v0.23, pytest-asyncio attaches an asyncio event loop to each item of the test suite (i.e. session, packages, modules, classes, functions) and allows tests to be run in those loops when marked accordingly. Pytest-asyncio currently assumes that async fixture scope is correlated with the new event loop scope. This prevents fixtures from being evaluated independently from the event loop scope and breaks some existing test suites (see #706). For example, a test suite may require all fixtures and tests to run in the same event loop, but have async fixtures that are set up and torn down for each module. If you're affected by this issue, please continue using the v0.21 release, until it is resolved.
Fix typing errors with recent versions of mypy #769
Known issues
As of v0.23, pytest-asyncio attaches an asyncio event loop to each item of the test suite (i.e. session, packages, modules, classes, functions) and allows tests to be run in those loops when marked accordingly. Pytest-asyncio currently assumes that async fixture scope is correlated with the new event loop scope. This prevents fixtures from being evaluated independently from the event loop scope and breaks some existing test suites (see #706). For example, a test suite may require all fixtures and tests to run in the same event loop, but have async fixtures that are set up and torn down for each module. If you're affected by this issue, please continue using the v0.21 release, until it is resolved.
Removed support for xdist rsync (now deprecated).
Contributed by Matthias Reichenbach in [#623](https://github.com/pytest-dev/pytest-cov/issues/623) <https://github.com/pytest-dev/pytest-cov/pull/623>_.
Switched docs theme to Furo.
Various legacy Python cleanup and CI improvements.
Contributed by Christian Clauss and Hugo van Kemenade in
[#630](https://github.com/pytest-dev/pytest-cov/issues/630) <https://github.com/pytest-dev/pytest-cov/pull/630>,
[#631](https://github.com/pytest-dev/pytest-cov/issues/631) <https://github.com/pytest-dev/pytest-cov/pull/631>,
[#632](https://github.com/pytest-dev/pytest-cov/issues/632) <https://github.com/pytest-dev/pytest-cov/pull/632>_ and
[#633](https://github.com/pytest-dev/pytest-cov/issues/633) <https://github.com/pytest-dev/pytest-cov/pull/633>_.
Added a pyproject.toml example in the docs.
Contributed by Dawn James in [#626](https://github.com/pytest-dev/pytest-cov/issues/626) <https://github.com/pytest-dev/pytest-cov/pull/626>_.
Modernized project's pre-commit hooks to use ruff. Initial POC contributed by
Christian Clauss in [#584](https://github.com/pytest-dev/pytest-cov/issues/584) <https://github.com/pytest-dev/pytest-cov/pull/584>_.
Most Recent Ignore Conditions Applied to This Pull Request
| Dependency Name | Ignore Conditions |
| --- | --- |
| sphinx | [>= 4.2.a, < 4.3] |
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Bumps the dev-dependencies group with 11 updates:
1.3.0
1.11.1
6.0.12.10
6.0.12.20240808
4.5.5.2
4.6.0.20240806
5.3.0
7.1.2
1.23.0
2.0.1
2.2.3
3.0.0
7.3.1
8.3.2
1.0.4
1.0.5
0.21.0
0.23.8
4.1.0
5.0.0
4.5.5
5.0.8
Updates
mypy
from 1.3.0 to 1.11.1Changelog
Sourced from mypy's changelog.
... (truncated)
Commits
570b90a
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)6cf9180
Fix types.GenericAlias lookup crash (#17543)64c1ebf
Bump version to 1.11.1+devdbd5f5c
Remove +dev from version for 1.11 releasef0a8c69
Update CHANGELOG for mypy 1.11 (#17540)371f780
CHANGELOG.md update for 1.11 (#17539)2563da0
Fix daemon crash on invalid type in TypedDict (#17495)Updates
types-pyyaml
from 6.0.12.10 to 6.0.12.20240808Commits
Updates
types-redis
from 4.5.5.2 to 4.6.0.20240806Commits
Updates
sphinx
from 5.3.0 to 7.1.2Release notes
Sourced from sphinx's releases.
Changelog
Sourced from sphinx's changelog.
... (truncated)
Commits
320d0b6
Bump to 7.1.2 final06c1339
Ensure thatlinkcheck_anchors
is properly respected (#11544)89808c6
Emend attribution for GH-11431 in CHANGES (#11547)4958d2a
Fix flake8 E231 reported linting failure4862da8
Bump versiond8d73c1
Bump to 7.1.1 finala54e630
[internationalisation] Update message catalogues8452300
Fix multi-line copyright whenSOURCE_DATE_EPOCH
is set (#11524)fe08cec
bump versione560f63
Bump to 7.1.0 finalUpdates
sphinx-autodoc-typehints
from 1.23.0 to 2.0.1Release notes
Sourced from sphinx-autodoc-typehints's releases.
... (truncated)
Commits
a79c4c1
Return injection fix (#445)01c9126
Add missing option to readme (#446)8d565a5
[pre-commit.ci] pre-commit autoupdate (#440)03a9beb
[pre-commit.ci] pre-commit autoupdate (#439)3b6815a
[pre-commit.ci] pre-commit autoupdate (#438)08877b7
[pre-commit.ci] pre-commit autoupdate (#437)f0732da
Bump pypa/gh-action-pypi-publish from 1.8.12 to 1.8.14 (#435)09c7b82
Fix the CI (#434)2c37bfc
Bump pypa/gh-action-pypi-publish from 1.8.11 to 1.8.12 (#430)ce2f37c
[pre-commit.ci] pre-commit autoupdate (#428)Updates
hiredis
from 2.2.3 to 3.0.0Release notes
Sourced from hiredis's releases.
... (truncated)
Commits
c1eefbd
Return Redis sets as Python lists (#189)a94bb44
Version 2.4.0 (#193)7792dd2
Fix a typo in the README file (#192)01fa2fd
Quote version for Python setup action in CI (#191)4c970a3
Fix building the wheel for windows (#190)f4dd081
pack: Replace sdsalloc.h with alloc.h (#159)e70af5b
Bump black from 22.3.0 to 24.3.0 (#185)cc23970
Removing Python 3.7 trove (#181)64e3394
Badge for latest released on Pypi (#182)ba18089
Sync license in metadata with LICENSE file (#183)Updates
pytest
from 7.3.1 to 8.3.2Release notes
Sourced from pytest's releases.
... (truncated)
Commits
bbcec9c
Prepare release version 8.3.278fe8b6
Merge pull request #12657 from pytest-dev/patchback/backports/8.3.x/6c806b499...238bad2
Merge pull request #12656 from RonnyPfannschmidt/fix-12652-detect-conda-envae6034a
Merge pull request #12641 from pytest-dev/patchback/backports/8.3.x/c03989cee...31337ab
Merge pull request #12640 from pytest-dev/update-userca3070b
Merge pull request #12637 from pytest-dev/release-8.3.1de98446
Prepare release version 8.3.1bd0a042
Merge pull request #12636 from pytest-dev/update-release-notes664325b
doc/changelog: update 8.3.0 notes19d225d
Merge pull request #12635 from pytest-dev/release-8.3.0Updates
pytest-aiohttp
from 1.0.4 to 1.0.5Release notes
Sourced from pytest-aiohttp's releases.
... (truncated)
Changelog
Sourced from pytest-aiohttp's changelog.
Commits
74b6faf
Release 1.0.521112c0
[pre-commit.ci] pre-commit autoupdate (#51)e8c8cfd
[pre-commit.ci] pre-commit autoupdate (#45)49d9b35
Add CodeQL workflow for GitHub code scanning (#46)a6a2533
Usepytest.hookimpl
inpytest_configure
(#49)9aea81e
Update check-jsonschema URL and version (#48)a2c68a8
[pre-commit.ci] pre-commit autoupdate (#44)74afa87
[pre-commit.ci] pre-commit autoupdate (#42)fca6a97
[pre-commit.ci] pre-commit autoupdate (#41)a4218fa
[pre-commit.ci] pre-commit autoupdate (#39)Updates
pytest-asyncio
from 0.21.0 to 0.23.8Release notes
Sourced from pytest-asyncio's releases.
... (truncated)
Commits
4be86a5
docs: Prepare release of v0.23.8.74b3a0a
Build(deps): Bump exceptiongroup in /dependencies/defaultb0009ca
[build] Declare support for Python 3.13.c747c7d
Build(deps): Bump coverage from 7.5.4 to 7.6.0 in /dependencies/default5c40a1c
Build(deps): Bump hypothesis in /dependencies/defaultb735e8a
build: Remove development dependency on Docker.91171b4
ci: Test with CPython 3.13.d572138
Build(deps): Bump hypothesis in /dependencies/defaulta89e4d7
Build(deps): Bump certifi in /dependencies/docsb646cc1
[fix] Fixed a bug that causes markers to be duplicated for async test functions.Updates
pytest-cov
from 4.1.0 to 5.0.0Changelog
Sourced from pytest-cov's changelog.
Commits
5295ce0
Bump version: 4.1.0 → 5.0.01181b06
Update changelog.9757222
Fix a minor grammar error (#636)9f5cd81
Cleanup releasing instructions. Closes #616.93b5047
Add test for pyproject.toml loading without explicit --cov-config. Ref #508.ff50860
docs: add config instructions for pyproject.toml.4a5a4b5
Keep GitHub Actions up to date with GitHub's Dependabot1d7f559
Fix or remove URLs that are causing docs tests to fail6a5af8e
Update changelog.d9fe8df
Switch to furo. Closes #618.Updates
redis
from 4.5.5 to 5.0.8Release notes
Sourced from redis's releases.
... (truncated)
Commits
6a2a636
Decode search results at field level (#3309)e7ef54a
Fix bug: client side caching causes unexpected disconnections (async version)...0cd0c5d
Format connection errors in the same way everywhere (#3305)6fedfef
Prepare for Redis 7.4 RC2 (#3303)ed1680f
Add details to the asyncio connection error message (#3211)511fda0
Add missing type hints forretry.py
(#3250)c1a6ff7
Bump rojopolis/spellcheck-github-actions from 0.37.0 to 0.38.0 (#3301)338cbfd
Re-enable Graph tests (#3287)532bc02
Do not restrict pytest dependencies versions (#3286)b6a0f96
Add CODECOV token to CI (#3285)Most Recent Ignore Conditions Applied to This Pull Request
| Dependency Name | Ignore Conditions | | --- | --- | | sphinx | [>= 4.2.a, < 4.3] |Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show