Skip to content

rename audit public API for consistency and proxy compatibility#125

Merged
Borda merged 6 commits into
mainfrom
audit/names
Mar 3, 2026
Merged

rename audit public API for consistency and proxy compatibility#125
Borda merged 6 commits into
mainfrom
audit/names

Conversation

@Borda

@Borda Borda commented Mar 3, 2026

Copy link
Copy Markdown
Owner
Before submitting
  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

  • 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()

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 🙃

Borda and others added 2 commits March 3, 2026 16:44
…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>
@Borda Borda marked this pull request as ready for review March 3, 2026 16:26
Copilot AI review requested due to automatic review settings March 3, 2026 16:26
@Borda Borda changed the title refactor: rename audit public API for consistency and proxy compatibility rename audit public API for consistency and proxy compatibility Mar 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_callablevalidate_deprecation_wrapper, find_deprecated_callablesfind_deprecation_wrappers) and the result dataclass (DeprecatedCallableInfoDeprecatedWrapperInfo).
  • 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",
]

Comment thread src/deprecate/audit.py
Comment thread src/deprecate/audit.py Outdated
Comment thread src/deprecate/audit.py Outdated
Comment thread tests/unittests/test_audit.py Outdated
Comment thread tests/integration/test_audit.py Outdated
Comment thread tests/unittests/test_audit.py Outdated
Borda and others added 4 commits March 3, 2026 17:33
@kilo-code-bot

kilo-code-bot Bot commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (7 files)
  • README.md
  • src/deprecate/init.py
  • src/deprecate/audit.py
  • tests/collection_deprecate.py
  • tests/collection_misconfigured.py
  • tests/integration/test_audit.py
  • tests/unittests/test_audit.py

@Borda Borda merged commit e88aa78 into main Mar 3, 2026
34 checks passed
@Borda Borda deleted the audit/names branch March 3, 2026 16:55
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