-
Notifications
You must be signed in to change notification settings - Fork 135
Replace coverage with pytest-cov and add code quality improvements #618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RonnyPfannschmidt
wants to merge
7
commits into
pytest-dev:main
Choose a base branch
from
RonnyPfannschmidt:chore/coverage-to-pytest-cov
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Replace coverage with pytest-cov and add code quality improvements #618
RonnyPfannschmidt
wants to merge
7
commits into
pytest-dev:main
from
RonnyPfannschmidt:chore/coverage-to-pytest-cov
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add dependency-groups for dev and testing in pyproject.toml - Configure uv to use both groups by default - Add uv.lock for reproducible environments - Update .gitignore for uv cache This enables faster, more reliable dependency management using uv. Tools like mypy and ruff are managed via pre-commit hooks.
Add development documentation for Claude Code (claude.ai/code) including: - Project overview - Development commands using uv - Development process guidelines - Core architecture overview Also add Claude settings to allow running approved commands directly. Co-Authored-By: Claude <noreply@anthropic.com>
- 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>
50f1ca0 to
3b67f0c
Compare
bluetech
requested changes
Oct 27, 2025
Member
bluetech
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pytest-cov change seems incomplete, are you sure that's all that's needed? And there are still dependencies on coverage and such.
The two new tests seem good, but the last commit contains changes that belong to the earlier commit.
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>
- Create src/pluggy/_compat.py for legacy pkg_resources compatibility - Move DistFacade from _manager.py to _compat.py - Update PluginManager to use stdlib Distribution internally - Add new list_plugin_distributions() method returning unwrapped Distribution objects - Update list_plugin_distinfo() to wrap with DistFacade for backward compatibility - Update test import to use _compat module This separates legacy setuptools API emulation from modern importlib.metadata usage, while maintaining full backward compatibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add test coverage for the new list_plugin_distributions() method - Verify it returns unwrapped importlib.metadata.Distribution objects - Confirm DistFacade wrapping only in legacy list_plugin_distinfo() - Extend existing test_load_setuptools_instantiation test 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
3b67f0c to
28fcb7d
Compare
Member
Author
|
i'll have to fix a rebase mistake |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replace coverage with pytest-cov in testing dependencies, add test for _remove_plugin ValueError handling, and replace defensive isinstance check with assertion in call_historic.
Depends on #617 - to be merged after.