Skip to content

fix(deps): remove unmaintained deprecation package, use stdlib instead#1999

Open
NIK-TIGER-BILL wants to merge 1 commit intoweaviate:mainfrom
NIK-TIGER-BILL:fix/remove-deprecation-package
Open

fix(deps): remove unmaintained deprecation package, use stdlib instead#1999
NIK-TIGER-BILL wants to merge 1 commit intoweaviate:mainfrom
NIK-TIGER-BILL:fix/remove-deprecation-package

Conversation

@NIK-TIGER-BILL
Copy link
Copy Markdown

Summary

Removes the deprecation package dependency and replaces its single usage with an inline stdlib helper.

Fixes #1998

Motivation

The deprecation package:

  • Has had no release since 2019 (last release 2.1.0 in Aug 2018)
  • Is flagged as a security / maintenance risk by multiple dependency scanners
  • Is used in exactly one file (weaviate/collections/batch/client.py) for two decorators

Changes

setup.cfg

Removed:

deprecation>=2.1.0,<3.0.0

weaviate/collections/batch/client.py

Replaced from deprecation import deprecated as docstring_deprecated with an inline docstring_deprecated() helper using only stdlib (functools, warnings).

The helper provides identical runtime behaviour:

  1. Prepends a .. deprecated:: RST note to the wrapped function's docstring.
  2. Emits a DeprecationWarning at call time (same as the original package).

The typing_extensions.deprecated import (already present, unchanged) continues to provide static-analysis / IDE warnings via the __deprecated__ attribute.

Testing

All existing tests for the deprecated experimental() and dynamic() methods should pass without modification — the runtime behaviour is identical.

…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>
Copy link
Copy Markdown

@orca-security-eu orca-security-eu bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@weaviate-git-bot
Copy link
Copy Markdown

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.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Forum?

@NIK-TIGER-BILL
Copy link
Copy Markdown
Author

I agree to the Contributor License Agreement (CLA). ✅

@dirkkul
Copy link
Copy Markdown
Collaborator

dirkkul commented Mar 31, 2026

Hey, thanks for contributing!

I had a quick look, but we use the deprecated package in more places:

  • weaviate/connect/helpers.py
  • weaviate/collections/classes/config.py
  • weaviate/collections/classes/config_vectorizers.py
  • weaviate/collections/classes/config_named_vectors.py
  • weaviate/collections/batch/collection.py

Could you:

  • move your code into weaviate/util.py
  • replace the other methods
  • run the tests afterwards to make sure that everything was removed? Linters should also catch it

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.

Remove deprecation package as depedency - security issue

3 participants