Registry / testing / deprecated

deprecated

JSON →
library1.3.1pypypi✓ verified 26d ago

A Python library providing a `@deprecated` decorator to mark functions, classes, or methods as deprecated, encouraging developers to transition to newer APIs. Current version: 1.3.1. Release cadence: Regular updates with new features and fixes.

pip install deprecated
INSTALL
IMPORT
SIG · DEPRECATED
D
deprecated
testingpythonv1.3.1
Install
2.3s avg
Import
287ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.3.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.302s · 18.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.3s · import 0.272s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

deprecated
import deprecated
Ensure correct import path to avoid ImportError

Example of using the `@deprecated` decorator to mark a function as deprecated.

import deprecated @deprecated def old_function(): pass old_function()
Debug
Known issues
breakingDeprecated Library version 1.3.0 introduced support for wrapt 2.x, which may cause compatibility issues with previous versions.
fix
Upgrade to wrapt 2.x or adjust your code to maintain compatibility.
affects: 1.3.0
deprecatedPython 2.7 support is deprecated and will be removed in future releases.
fix
Upgrade to Python 3.7 or later.
affects: All versions supporting Python 2.7
gotchaUsing the `@deprecated` decorator without specifying a version may lead to confusion about the deprecation status.
fix
Always specify the version when marking a function as deprecated.
affects: All versions
breakingAttempting to use `@deprecated` directly as a decorator results in a `TypeError: 'module' object is not callable` because `deprecated` refers to the module itself. The actual decorator function is `deprecated.deprecated`.
fix
Use `@deprecated.deprecated` when marking a function as deprecated, optionally passing arguments like version: `@deprecated.deprecated(version='1.0')`.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'deprecated'
The 'deprecated' Python package has not been installed in the active Python environment.
fix
Run `pip install deprecated` in your terminal to install the library.
TypeError: deprecated() got an unexpected keyword argument 'name'
This error typically occurs due to a version mismatch or incompatibility between a package (e.g., `pip`, `pyopenssl`, `botocore`) and its internal or dependent use of a 'deprecated' utility, which might be an older version or a custom implementation that does not accept a 'name' argument.
fix
Upgrade the related conflicting packages to their latest compatible versions, often starting with `pip install --upgrade pip setuptools` and then `pip install --upgrade pyopenssl` or other libraries mentioned in the traceback.
DeprecationWarning: Call to deprecated function (or staticmethod) <function_name>.
While `DeprecationWarning` messages are emitted, they are often ignored by default by Python's warning filters, especially when the deprecated code is not in the `__main__` module.
fix
To make `DeprecationWarning` messages visible, run your Python script with `PYTHONWARNINGS='default'` or add `import warnings; warnings.simplefilter('default', DeprecationWarning)` at the beginning of your script.
Upgrade
Version history
1.3.1latest on PyPI · released Oct 30, 2025
Audit
Dependencies
wraptrequiredRequired for function wrapping and decorator support
Agent activity
17 hits · last 30 days
node
16
Resources
deprecated — pip install deprecated · libregistry