Registry / serialization / deprecation-alias

deprecation-alias

JSON →
library0.4.0pypypi✓ verified 86d ago

A wrapper around the 'deprecation' library that provides support for deprecated aliases of functions, methods, and classes. Current version 0.4.0, requires Python >=3.6.1. Maintained by domdfcoding, releases are infrequent.

pip install deprecation-alias
INSTALL
IMPORT
SIG · DEPRECATION-ALIAS
D
deprecation-alias
serializationpythonv0.4.0
Install
1.8s avg
Import
—
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.4.0 · 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.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.6MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.8s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage

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

deprecated
✓ from deprecation_alias import deprecated
✗ from deprecation_alias import deprecated_alias
deprecation
✓ from deprecation_alias import deprecation
Callable
✓ from deprecation_alias import Callable

Define a deprecated alias for an existing function using the deprecated_alias decorator.

from deprecation_alias import deprecated_alias @deprecated_alias(new_name='new_func', deprecated_in='2.0', removed_in='3.0') def old_func(): """Old function that is now an alias.""" return 'result' # Calling old_func will emit a deprecation warning print(old_func())
Debug
Known issues
breakingThe 'deprecated_alias' decorator requires the 'deprecation' library to be installed separately; it is not an automatic dependency of 'deprecation-alias'.
fix
Ensure 'deprecation' is in your project dependencies: pip install deprecation or add to requirements.txt.
affects: all
gotchaThe 'DeprecatedAlias' class is intended for use with classes, but using it incorrectly can lead to unexpected behavior (e.g., missing __init__).
fix
Review the documentation for proper usage. For classes, consider using @deprecated_alias on the class itself.
affects: all
gotchaWhen using 'deprecated_alias', the 'new_name' parameter must match an existing function/class name; otherwise, no alias is created, and the original function is still called.
fix
Verify that the target name exists in the same module scope as the decorator.
affects: all
Upgrade
Version history
0.4.0latest on PyPI · released Feb 11, 2025
Audit
Dependencies
deprecationrequiredCore dependency; provides the underlying deprecation machinery.
Agent activity
10 hits · last 30 days
node
10
Resources
deprecation-alias — pip install deprecation-alias · libregistry