rename audit public API for consistency and proxy compatibility#125
Merged
Conversation
…lity - Rename validate_deprecated_callable → validate_deprecation_wrapper - Rename find_deprecated_callables → find_deprecation_wrappers - Rename DeprecatedCallableInfo → DeprecatedWrapperInfo - Keep old names as @deprecated shims (deprecated_in="0.6", remove_in="1.0") with runtime FutureWarning; DeprecatedCallableInfo uses deprecated_class() - Fix _DeprecatedProxy: add __instancecheck__ and __subclasscheck__ so isinstance/issubclass work correctly against a deprecated_class() proxy Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors pyDeprecate’s audit public API to use “wrapper” terminology consistently and to better align with proxy-based deprecations, while keeping the old names as deprecated shims.
Changes:
- Renames audit APIs (
validate_deprecated_callable→validate_deprecation_wrapper,find_deprecated_callables→find_deprecation_wrappers) and the result dataclass (DeprecatedCallableInfo→DeprecatedWrapperInfo). - Updates integration/unit tests and collection fixtures to use the new names.
- Updates README examples to reference the renamed audit APIs.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unittests/test_audit.py | Updates unit tests to call the renamed audit APIs. |
| tests/integration/test_audit.py | Updates integration tests to use the renamed audit APIs and dataclass. |
| tests/collection_misconfigured.py | Updates documentation references to the new audit API names. |
| tests/collection_deprecate.py | Updates inline docs referencing the renamed scanner API. |
| src/deprecate/audit.py | Introduces the renamed public audit APIs and adds backward-compatibility shims. |
| src/deprecate/init.py | Re-exports the renamed audit APIs/types from the package root and updates package docs. |
| README.md | Updates documentation and examples to the new audit API names and dataclass. |
Comments suppressed due to low confidence (1)
src/deprecate/init.py:97
- The PR adds backward-compat symbols (DeprecatedCallableInfo/find_deprecated_callables/validate_deprecated_callable) to the package namespace, but they were removed from all. That makes
from deprecate import *silently drop the deprecated shims, which is an API break before the stated removal version. Consider keeping the deprecated names in all until 1.0 (even if they’re marked deprecated) to preserve compatibility.
__all__ = [
"deprecated",
"DeprecatedWrapperInfo",
"deprecated_class",
"deprecated_instance",
"find_deprecation_wrappers",
"validate_deprecation_wrapper",
"validate_deprecation_chains",
"validate_deprecation_expiry",
"no_warning_call",
"void",
]
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Codex <codex@openai.com>
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (7 files)
|
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
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.
Before submitting
What does this PR do?
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃