-
Couldn't load subscription status.
- Fork 134
Etablish claude #613
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
9
commits into
pytest-dev:main
Choose a base branch
from
RonnyPfannschmidt:etablish-claude
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.
+773
−74
Open
Etablish claude #613
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6c9d274
Add uv dependency management and dev tooling
RonnyPfannschmidt 6a9d811
Add CLAUDE.md with development guidance
RonnyPfannschmidt aad7bc6
Require Python 3.10+, modernize type annotations
RonnyPfannschmidt f68db34
Modernize code with Python 3.10+ idioms
RonnyPfannschmidt aee2b85
Refactor legacy setuptools compatibility into _compat module
RonnyPfannschmidt 242146c
Add tests for new list_plugin_distributions() API
RonnyPfannschmidt 67a3727
Replace coverage with pytest-cov in testing dependencies
RonnyPfannschmidt cc687d9
Add test for _remove_plugin ValueError on unknown plugin
RonnyPfannschmidt 3b67f0c
Replace defensive isinstance check with assertion in call_historic
RonnyPfannschmidt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "permissions": { | ||
| "allow": [ | ||
| "Bash(uv run pytest:*)", | ||
| "Bash(git add:*)", | ||
| "Bash(uv run mypy:*)", | ||
| "Bash(uv run pre-commit:*)" | ||
|
|
||
| ], | ||
| "deny": [] | ||
| } | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,3 +67,6 @@ pip-wheel-metadata/ | |
|
|
||
| # pytest-benchmark | ||
| .benchmarks/ | ||
|
|
||
| # Claude Code local settings | ||
| .claude/settings.local.json | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
||
| ## Project Overview | ||
|
|
||
| Pluggy is a minimalist production-ready plugin system that serves as the core framework for pytest, datasette and devpi. | ||
| It provides hook specification and implementation mechanisms through a plugin manager system. | ||
|
|
||
| ## Development Commands | ||
|
|
||
| All commands use `uv run` for consistent environments. | ||
|
|
||
| ### Testing | ||
| - `uv run pytest` - Run all tests (prefer running all tests for quick feedback) | ||
| - `uv run pytest testing/benchmark.py` - Run benchmark tests | ||
|
|
||
| ### Code Quality | ||
| - `uv run pre-commit run -a` - Run all pre-commit hooks (linting, formatting, type checking) | ||
| - Always reread files modified by pre-commit | ||
|
|
||
| ## Development Process | ||
|
|
||
| - Always read `src/pluggy/*.py` to get a full picture | ||
| - Consider backward compatibility | ||
| - Always run all tests: `uv run pytest` | ||
| - Always run pre-commit before committing: `uv run pre-commit run -a` | ||
| - Prefer running full pre-commit over individual tools (ruff/mypy) | ||
|
|
||
|
|
||
|
|
||
| ## Core Architecture | ||
|
|
||
| ### Main Components | ||
|
|
||
| - **PluginManager** (`src/pluggy/_manager.py`): Central registry that manages plugins and coordinates hook calls | ||
| - **HookCaller** (`src/pluggy/_hooks.py`): Executes hook implementations with proper argument binding | ||
| - **HookImpl/HookSpec** (`src/pluggy/_hooks.py`): Represent hook implementations and specifications | ||
| - **Result** (`src/pluggy/_result.py`): Handles hook call results and exception propagation | ||
| - **Multicall** (`src/pluggy/_callers.py`): Core execution engine for calling multiple hook implementations | ||
|
|
||
| ### Package Structure | ||
| - `src/pluggy/` - Main package source | ||
| - `testing/` - Test suite using pytest | ||
| - `docs/` - Sphinx documentation and examples | ||
| - `changelog/` - Towncrier fragments for changelog generation | ||
|
|
||
| ## Configuration Files | ||
| - `pyproject.toml` - Project metadata, build system, tool configuration (ruff, mypy, setuptools-scm) | ||
| - `tox.ini` - Multi-environment testing configuration | ||
| - `.pre-commit-config.yaml` - Code quality automation (ruff, mypy, flake8, etc.) |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| """ | ||
| Compatibility layer for legacy setuptools/pkg_resources API. | ||
| This module provides backward compatibility wrappers around modern | ||
| importlib.metadata, allowing gradual migration away from setuptools. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import importlib.metadata | ||
| from typing import Any | ||
|
|
||
|
|
||
| class DistFacade: | ||
| """Facade providing pkg_resources.Distribution-like interface. | ||
| This class wraps importlib.metadata.Distribution to provide a | ||
| compatibility layer for code expecting the legacy pkg_resources API. | ||
| The primary difference is the ``project_name`` attribute which | ||
| pkg_resources provided but importlib.metadata.Distribution does not. | ||
| """ | ||
|
|
||
| __slots__ = ("_dist",) | ||
|
|
||
| def __init__(self, dist: importlib.metadata.Distribution) -> None: | ||
| self._dist = dist | ||
|
|
||
| @property | ||
| def project_name(self) -> str: | ||
| """Get the project name (for pkg_resources compatibility). | ||
| This is equivalent to dist.metadata["name"] but matches the | ||
| pkg_resources.Distribution.project_name attribute. | ||
| """ | ||
| name: str = self.metadata["name"] | ||
| return name | ||
|
|
||
| def __getattr__(self, attr: str) -> Any: | ||
| """Delegate all other attributes to the wrapped Distribution.""" | ||
| return getattr(self._dist, attr) | ||
|
|
||
| def __dir__(self) -> list[str]: | ||
| """List available attributes including facade additions.""" | ||
| return sorted(dir(self._dist) + ["_dist", "project_name"]) | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.