class Pet(Enum):
CAT = 1 # Member attribute
DOG = 2 # Member attribute
WOLF: int = 3 # New error: Enum members must be left unannotated
species: str # Considered a non-member attribute
In particular, the specification change can result in issues in type stubs (.pyi files), since
historically it was common to leave the value absent:
# In a type stub (.pyi file)
class Pet(Enum):
# Change in semantics: previously considered members, now non-member attributes
CAT: int
DOG: int
# Mypy will now issue a warning if it detects this situation in type stubs:
# > Detected enum "Pet" in a type stub with zero members.
# > There is a chance this is due to a recent change in the semantics of enum membership.
# > If so, use `member = value` to mark an enum member, instead of `member: type`
class Pet(Enum):
# As per the specification, you should now do one of the following:
DOG = 1 # Member attribute with value 1 and known type
WOLF = cast(int, ...) # Member attribute with unknown value but known type
LION = ... # Member attribute with unknown value and unknown type
Contributed by Terence Honles in PR 17207 and
Shantanu Jain in PR 18068.
Mypy 1.13
We’ve just uploaded mypy 1.13 to the Python Package Index (PyPI).
Mypy is a static type checker for Python. You can install it as follows:
#12446: Avoid calling @property (and other instance descriptors) during fixture discovery -- by asottile{.interpreted-text role="user"}
#12659: Fixed the issue of not displaying assertion failure differences when using the parameter --import-mode=importlib in pytest>=8.1.
#12667: Fixed a regression where type change in [ExceptionInfo.errisinstance]{.title-ref} caused [mypy]{.title-ref} to fail.
#12744: Fixed typing compatibility with Python 3.9 or less -- replaced [typing.Self]{.title-ref} with [typing_extensions.Self]{.title-ref} -- by Avasam{.interpreted-text role="user"}
#12745: Fixed an issue with backslashes being incorrectly converted in nodeid paths on Windows, ensuring consistent path handling across environments.
#6682: Fixed bug where the verbosity levels where not being respected when printing the "msg" part of failed assertion (as in assert condition, msg).
#9422: Fix bug where disabling the terminal plugin via -p no:terminal would cause crashes related to missing the verbose option.
-- by GTowers1{.interpreted-text role="user"}
Improved documentation
#12663: Clarify that the [pytest_deselected]{.title-ref} hook should be called from [pytest_collection_modifyitems]{.title-ref} hook implementations when items are deselected.
#12678: Remove erroneous quotes from [tmp_path_retention_policy]{.title-ref} example in docs.
Miscellaneous internal changes
#12769: Fix typos discovered by codespell and add codespell to pre-commit hooks.
Commits
d0f136f build(deps): Bump pypa/gh-action-pypi-publish from 1.10.0 to 1.10.1 (#12790)
BREAKING: Updated minimum supported pytest version to v8.2.0
Adds an optional loop_scope keyword argument to pytest.mark.asyncio. This argument controls which event loop is used to run the marked async test. #706, #871
Deprecates the optional scope keyword argument to pytest.mark.asyncio for API consistency with pytest_asyncio.fixture. Users are encouraged to use the loop_scope keyword argument, which does exactly the same.
Raises an error when passing scope or loop_scope as a positional argument to @pytest.mark.asyncio. #812
Fixes a bug that caused module-scoped async fixtures to fail when reused in other modules #862#668
pytest-asyncio 0.24.0a1
0.24.0 (UNRELEASED)
BREAKING: Updated minimum supported pytest version to v8.2.0
Adds an optional loop_scope keyword argument to pytest.mark.asyncio. This argument controls which event loop is used to run the marked async test. #706, #871
Deprecates the optional scope keyword argument to pytest.mark.asyncio for API consistency with pytest_asyncio.fixture. Users are encouraged to use the loop_scope keyword argument, which does exactly the same.
Raises an error when passing scope or loop_scope as a positional argument to @pytest.mark.asyncio. #812
Fixes a bug that caused module-scoped async fixtures to fail when reused in other modules #862#668
pytest-asyncio 0.24.0a0
0.24.0 (UNRELEASED)
Adds an optional loop_scope keyword argument to pytest.mark.asyncio. This argument controls which event loop is used to run the marked async test. #706, #871
Deprecates the optional scope keyword argument to pytest.mark.asyncio for API consistency with pytest_asyncio.fixture. Users are encouraged to use the loop_scope keyword argument, which does exactly the same.
Raises an error when passing scope or loop_scope as a positional argument to @pytest.mark.asyncio. #812
Commits
fb5422f docs: Set release date for v0.24 in changelog.
6dc7f58 docs: Add migration guides for pytest-asyncio v0.21 and v0.23.
1bfc181 Wire Sphinx builds into the RTD config via tox
f03cf13 Build(deps): Bump hypothesis in /dependencies/default
69540bf Build(deps): Bump attrs from 24.1.0 to 24.2.0 in /dependencies/default
b0ccfc5 Build(deps): Bump hypothesis in /dependencies/default
574f1db Build(deps): Bump babel from 2.15.0 to 2.16.0 in /dependencies/docs
ae30dac Update .readthedocs.yaml to install pytest-asyncio
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 6 updates in the / directory:
1.11.1
1.13.0
6.0.12.20240808
6.0.12.20240917
4.6.0.20240806
4.6.0.20241004
8.3.2
8.3.3
0.23.8
0.24.0
4.6.0
5.2.0
Updates
mypy
from 1.11.1 to 1.13.0Changelog
Sourced from mypy's changelog.
... (truncated)
Commits
eb31034
Bump version to 1.13.02eeb588
Update changelog for 1.12.1 (#17999)bc0386b
Changelog for 1.13 (#18000)5c4d2db
Add faster-cache extra, test in CI (#17978)854ad18
Make is_sub_path faster (#17962)50aa4ca
Speed up stubs suggestions (#17965)7c27808
Use orjson instead of json, when available (#17955)2cd2406
Use fast path in modulefinder more often (#17950)e20aaee
Let mypyc optimise os.path.join (#17949)159974c
Use sha1 for hashing (#17953)Updates
types-pyyaml
from 6.0.12.20240808 to 6.0.12.20240917Commits
Updates
types-redis
from 4.6.0.20240806 to 4.6.0.20241004Commits
Updates
pytest
from 8.3.2 to 8.3.3Release notes
Sourced from pytest's releases.
Commits
d0f136f
build(deps): Bump pypa/gh-action-pypi-publish from 1.10.0 to 1.10.1 (#12790)972f307
Prepare release version 8.3.30dabdcf
Include co-authors in release announcement (#12795) (#12797)a9910a4
Do not discover properties when iterating fixtures (#12781) (#12788)0f10b6b
Fix issue with slashes being turned into backslashes on Windows (#12760) (#12...300d13d
Merge pull request #12785 from pytest-dev/patchback/backports/8.3.x/57cccf7f4...e5d32c7
Merge pull request #12784 from svenevs/fix/docs-example-parametrize-minor-typobc913d1
Streamline checks for verbose option (#12706) (#12778)01cfcc9
Fix typos and introduce codespell pre-commit hook (#12769) (#12774)4873394
doc: Remove past training (#12772) (#12773)Updates
pytest-asyncio
from 0.23.8 to 0.24.0Release notes
Sourced from pytest-asyncio's releases.
Commits
fb5422f
docs: Set release date for v0.24 in changelog.6dc7f58
docs: Add migration guides for pytest-asyncio v0.21 and v0.23.1bfc181
Wire Sphinx builds into the RTD config via toxf03cf13
Build(deps): Bump hypothesis in /dependencies/default69540bf
Build(deps): Bump attrs from 24.1.0 to 24.2.0 in /dependencies/defaultb0ccfc5
Build(deps): Bump hypothesis in /dependencies/default574f1db
Build(deps): Bump babel from 2.15.0 to 2.16.0 in /dependencies/docsae30dac
Update .readthedocs.yaml to install pytest-asyncio972a704
Derive project version using importlibd587a52
[pre-commit.ci] pre-commit autoupdateUpdates
redis
from 4.6.0 to 5.2.0Release notes
Sourced from redis's releases.
... (truncated)
Commits
166ae7b
Updated package version (#3418)00f5be4
adds scorer to AggregateRequest (#3409)4c4d4af
Pin pytest-profiling (#3417)d6ddb0d
DOC-4199: add TCEs to the combined query page (#3380)17db62e
DOC-4200: add TCEs to the aggregation query page (#3381)700045c
Backport 5.1 changes into master (#3406)2e46613
Client side caching refactoring (#3350)7d73d74
DOC-4197: add TCEs to the geospatial query page (#3378)c7483b3
DOC-4196: add TCEs to the full-text query page (#3377)64d4bb8
DOC-4194: add TCEs to the range query page (#3374)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