NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #222 most downloaded on PyPI
Python @deprecated decorator to deprecate old python classes, functions or methods.
Last release 8 days ago
26 Sep 2026
Release timing varies
gaps range from 5 weeks to 1.7 years
Most releases are documented
notes for 21 of 27 stable releases
1 version withdrawn
withdrawn after publishing
9 years old
28 releases · first in 2017
Deprecated 3.0.0: port to Python 3.12+ with uv, Hatch and modern typing by @laurent-laporte-pro in #102
Full Changelog: v1.3.1...v3.0.0
One column per quarter.
Major release: Python 3.12+ modernization
[!WARNING] This release drops the support of Python 2.7 and of Python 3 versions older than 3.12. Use Deprecated 1.3.x on these versions: pip keeps resolving to 1.3.x on Python < 3.12.
[!IMPORTANT] Upgrading from 1.x — the public API (
@deprecated,@deprecated_params,deprecated.sphinx,ClassicAdapter) is unchanged, but check the following points:
- wrapt >= 1.16 is required (was >= 1.10);
deprecated.__date__anddeprecated.classic.string_typesare removed;from deprecated import *only exportsdeprecatedanddeprecated_params;- stacked
@deprecated_paramsdecorators emit one warning per deprecated parameter;- the warnings of deprecated subclasses now refer to the user code: tests which assert the file name or the line number of a warning may need to be updated.
[!NOTE] There is no 2.x release: the major version 3 was chosen to match Python 3.
setup.py/setup.cfg/MANIFEST.in) to
pyproject.toml with the Hatchling build backend; the version is read from
src/deprecated/__init__.py.src layout: the package moves to src/deprecated
(the tests stay in tests and the documentation in docs).uv.lock) and Hatch: tox is dropped and replaced
by the hatch test matrix.Makefile (uv/Hatch based targets, run make help).hatch version <major|minor|patch>: the version is only defined
in src/deprecated/__init__.py, and the git tag is created by GitHub when the release
is published.%pyproject_* macros.inspect2 dependency (it was only used on Python 2). See PR #102.u"" literals, coding cookies,
class Foo(object), super(Class, self), OrderedDict...). See PR #102.deprecated.classic.string_types compatibility tuple.
A bytes positional reason is still accepted by @deprecated, as before. See PR #102.deprecated.__date__ attribute (the release dates are in the changelog).
See PR #102.deprecated.google module: the @deprecated, @versionadded and @versionchanged
decorators insert a Deprecated:, Version added: or Version changed: section
in Google style
docstrings (see the "Google" decorators
page). See PR #105.deprecated.numpy module: the @deprecated, @versionadded and @versionchanged
decorators insert a Deprecated, Version added or Version changed section
in NumPy style
docstrings (see the "NumPy" decorators
page). See PR #106.ClassicAdapter.warn() method used to emit the deprecation warning
(can be overridden by custom adapters). See PR #102.py.typed marker (PEP 561):
the decorators preserve the signature of the decorated functions and classes. See PR #102.__all__ to the deprecated package: from deprecated import * only exports
deprecated and deprecated_params. See PR #102.multiprocessing and the spawn start method (the default one on
Windows and macOS), for instance as a Process target or with Pool.map().
Previously, pickling failed with NotImplementedError: object proxy must define __reduce_ex__()
(#16). See PR #108 and PR #111
(a function decorated with @deprecated above @staticmethod could not be pickled).classic.py).
The warnings are emitted with skip_file_prefixes (Python 3.12+): the frames of this library
and of wrapt are skipped, whatever the wrapt implementation (C extension or pure Python).
See PR #102.@deprecated_params decorators now emit only one warning for each deprecated
parameter: the message (and category) of the outermost decorator wins, as documented
in the tutorial. The warnings refer to the caller. See PR #102.CHANGELOG.md,
CONTRIBUTING.md and LICENSE.md.docs dependency group of pyproject.toml
(docs/requirements.txt is removed); ReadTheDocs installs them with uv.make docs-check: warnings are errors).warnings.deprecated with this library.
See PR #104.@deprecated,
@deprecated_params, and how the library complements warnings.deprecated (PEP 702).
The "Authors" section now tells who started the library and who maintains it.make docs-live to preview the documentation while editing it: the pages are rebuilt
and the browser is reloaded on each change (sphinx-autobuild, docs-live dependency group).
See PR #110.docs/source/release.md).hatch check code (Ruff lint), hatch check fmt (Ruff format)
and hatch check types (mypy, strict mode) quality checks. See PR #102.test_sphinx_metaclass tests test the Sphinx decorator. See PR #102.develop and master branches, and add Dependabot version updates
(GitHub Actions and uv.lock). See PR #111.AGENTS.md and CLAUDE.md: guidance for AI coding agents.v1.3.1 by @laurent-laporte-pro in #95
Patch release: Packaging fix
Restore missing source distribution (.tar.gz) that was not included in v1.3.0.
feature: parameter deprecation by @laurent-laporte-pro in #93
Full Changelog: v1.2.18...v1.3.0
Note
This release was yanked on PyPI due to a missing source distribution (.tar.gz). See issue #94: https://github.com/laurent-laporte-pro/deprecated/issues/94 It has been replaced by version 1.3.1.
Minor release: Parameters deprecation
Add compatibility tests and adjustments for Wrapt v2.0. See PR #88 (musicinmybrain).
Add experimental @deprecated_params decorator to mark function parameters as deprecated at call-time; emits warnings when deprecated parameters are used with optional messages and configurable warning categories. See PR #93.
Update the Wrapt compatibility matrix to include Python 3.13 and 3.14. See PR #91
Limit test coverage collection to the dedicated coverage tox environment to avoid collecting coverage across all test environments and reduce cross-environment coverage noise. See PR #92.
v1.2.18 by @laurent-laporte-pro in #84
fix: enhance documentation and build configuration: update versioning, fixes, and ReadTheDocs setup by @laurent-laporte-pro in #81
Full Changelog: v1.2.16...v1.2.17
Update Packit configuration by @packit-public-repos-bot in #78
Full Changelog: v1.2.15...v1.2.16
build: drop deprecated CI tools by @12rambau in #67
extra_stacklevel argument to better control deprecated function call references by @coroa in #69Full Changelog: v1.2.14...v1.2.15
Fix #60 : return a correctly dedented docstring when long docstring are using the D212 or D213 format.
Full Changelog: v1.2.13...v1.2.14
Fix #45 : Change the signature of the :func: ~deprecated.sphinx.deprecated decorator to reflect the valid use cases.
Fix #45: Change the signature of the :func:~deprecated.sphinx.deprecated decorator to reflect
the valid use cases.
Fix #48: Fix versionadded and versionchanged decorators: do not return a decorator factory,
but a Wrapt adapter.
Fix configuration for AppVeyor: simplify the test scripts and set the version format to match the current version.
Change configuration for Tox:
pip to "pip >= 9.0.3, < 21" (Python 2.7, 3.4 and 3.5).typing when building on Python 3.4 (required by Pytest->Attrs).Migrating project to travis-ci.com <https://travis-ci.com/github/tantale/deprecated>_.
Fix #41: deprecated.sphinx: strip Sphinx cross-referencing syntax from warning message.
New bug fix release v1.2.12 (2020-03-13)
deprecated.sphinx: strip Sphinx cross-referencing syntax from warning message.Fix \#33: Change the class \~deprecated.sphinx.SphinxAdapter: add the line_length keyword argument to the constructor to specify the max line length o…
upstream_tag_template: v{version}.line_length keyword argument to the constructor to specify the
max line length of the directive text. Sphinx decorators also accept
the line_length argument.versionadded and versionchanged decorators don't emit
DeprecationWarning anymore on decorated classes.Fix #25: @deprecated respects global warning filters with actions other than "ignore" and "always" on Python 3.
Fix #25: @deprecated respects global warning filters with actions other than "ignore" and "always" on Python 3.
- Fix #20 - Fix #19 packit configuration
Fix #15: The \@deprecated decorator doesn’t set a warning filter if the action keyword argument is not provided or None. In consequences, the warning…
Fix #15: The @deprecated decorator doesn’t set a warning filter if the action keyword argument is not provided or None. In consequences, the warning messages are only emitted if the global filter allow it. For more information, see The Warning Filter in the Python documentation.
Fix #13: Warning displays the correct filename and line number when decorating a class if wrapt does not have the compiled c extension.
The API documentation and the Tutorial is improved to explain how to use custom warning categories and local filtering (warning filtering at function call).
Fix #17: Customize the sidebar to add links to the documentation to the source in GitHub and to the Bug tracker. Add a logo in the sidebar and change the logo in the main page to see the library version.
Add a detailed documentation about The “Sphinx” decorators.
Change the Tox configuration to test the library with Wrapt 1.12.x.
Fix: Warning displays the correct filename and line number when decorating a function if wrapt does not have the compiled c extension.
Fix: Warning displays the correct filename and line number when decorating a function if wrapt does not have the compiled c extension.
Nothing published for this version
Nothing published for this version
Fix #4: Correct the class ~deprecated.classic.ClassicAdapter: Don't pass arguments to object.__new__ (other than *cls*).
Fix #4: Correct the class ~deprecated.classic.ClassicAdapter: Don't pass arguments to object.__new__ (other than cls).
Change the configuration for TravisCI and AppVeyor: drop configuration for Python 2.6 and 3.3, add configuration for Python 3.7 (if available).
Fix #3: deprecated.sphinx decorators don't update the docstring.
Fix #3: deprecated.sphinx decorators don't update the docstring.
Fix #2: a deprecated class is a class (not a function). Any subclass of a deprecated class is also deprecated.
Fix #2: a deprecated class is a class (not a function). Any subclass of a deprecated class is also deprecated.
Add a MANIFEST.in file to package additional files like "LICENSE.rst" in the source distribution.
MANIFEST.in file to package additional files like "LICENSE.rst" in the source distribution.Nothing published for this version
Nothing published for this version
Fix #4: Correct the function ~deprecated.deprecated: Don't pass arguments to object.__new__ (other than *cls*).
Fix #4: Correct the function ~deprecated.deprecated: Don't pass arguments to object.__new__ (other than cls).
Change the configuration for TravisCI and AppVeyor: drop configuration for Python 2.6 and 3.3, add configuration for Python 3.7.
Fix #2: a deprecated class is a class (not a function). Any subclass of a deprecated class is also deprecated.
Fix #2: a deprecated class is a class (not a function). Any subclass of a deprecated class is also deprecated.
Add a MANIFEST.in file to package additional files like "LICENSE.rst" in the source distribution.
MANIFEST.in file to package additional files like "LICENSE.rst" in the source distribution.Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →