fix(deps): remove unmaintained deprecation package, use stdlib instead#1999
Open
NIK-TIGER-BILL wants to merge 1 commit intoweaviate:mainfrom
Open
fix(deps): remove unmaintained deprecation package, use stdlib instead#1999NIK-TIGER-BILL wants to merge 1 commit intoweaviate:mainfrom
NIK-TIGER-BILL wants to merge 1 commit intoweaviate:mainfrom
Conversation
…lacement The `deprecation` package (>=2.1.0,<3.0.0) has had no release since 2019 and is flagged as a security / maintenance risk by dependency scanners. The package was only used in one file (`weaviate/collections/batch/client.py`) to add docstring notes and emit `DeprecationWarning` at call time. This PR removes the external dependency and replaces it with an equivalent `docstring_deprecated` helper implemented entirely with stdlib (`functools`, `warnings`). The public behaviour is unchanged: * The function docstring gets a `.. deprecated::` RST prefix. * Calling the function emits a :class:`DeprecationWarning`. The `typing_extensions.deprecated` import (already present) is kept because it provides static analysis / IDE warnings via the `__deprecated__` attribute. Fixes weaviate#1998 Signed-off-by: NIK-TIGER-BILL <nik.tiger.bill@github.com>
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
|
To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge. |
Author
|
I agree to the Contributor License Agreement (CLA). ✅ |
Collaborator
|
Hey, thanks for contributing! I had a quick look, but we use the deprecated package in more places:
Could you:
|
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.
Summary
Removes the
deprecationpackage dependency and replaces its single usage with an inline stdlib helper.Fixes #1998
Motivation
The
deprecationpackage:weaviate/collections/batch/client.py) for two decoratorsChanges
setup.cfgRemoved:
weaviate/collections/batch/client.pyReplaced
from deprecation import deprecated as docstring_deprecatedwith an inlinedocstring_deprecated()helper using only stdlib (functools,warnings).The helper provides identical runtime behaviour:
.. deprecated::RST note to the wrapped function's docstring.DeprecationWarningat call time (same as the original package).The
typing_extensions.deprecatedimport (already present, unchanged) continues to provide static-analysis / IDE warnings via the__deprecated__attribute.Testing
All existing tests for the deprecated
experimental()anddynamic()methods should pass without modification — the runtime behaviour is identical.