Skip to content

Conversation

@RonnyPfannschmidt
Copy link
Member

Require Python 3.10+ as minimum version and modernize type annotations using PEP 604 syntax and other Python 3.10+ features.

Depends on #615 - to be merged after.

@RonnyPfannschmidt RonnyPfannschmidt force-pushed the refactor/require-python310 branch from 8be26bc to f68db34 Compare October 27, 2025 09:18
RonnyPfannschmidt and others added 3 commits November 28, 2025 14:15
- Bump requires-python to >=3.10 in pyproject.toml
- Remove Python 3.9 from classifiers, CI matrix, tox envlist
- Update PyPy version references (pypy3.9 → pypy3.10)
- Modernize type hints: Union → |, Optional → | None
- Move Callable imports to collections.abc
- Update pyupgrade to --py310-plus

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace .format() with f-string in _tracing.py
- Use walrus operator for dict.get() pattern in _tracing.py
- Convert string concatenation to parenthesized f-strings in _callers.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Leverage TypeAlias (available in Python 3.10+) to explicitly mark
type aliases throughout the codebase:

- _hooks.py: _Namespace, _Plugin, _HookExec, _HookImplFunction, _CallHistory
- _manager.py: _BeforeTrace, _AfterTrace
- _result.py: _ExcInfo
- _callers.py: Teardown

This improves IDE support, type checker accuracy, and makes the
distinction between type aliases and regular assignments clear.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@RonnyPfannschmidt RonnyPfannschmidt force-pushed the refactor/require-python310 branch from 78fe2e9 to 009bdc3 Compare November 28, 2025 13:23
@RonnyPfannschmidt RonnyPfannschmidt merged commit dbe2131 into pytest-dev:main Nov 28, 2025
16 of 19 checks passed
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.

2 participants