Changelog 3.x¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
v3.0.1 (2026-10-30)¶
Patch release: preserve the constructor signatures of deprecated classes
Fixed¶
Preserve constructor signatures on deprecated classes, including in Sphinx autodoc, instead of displaying the warning wrapper’s generic arguments (#86). See PR #115 (Mirochill).
Other¶
Bump the dev-dependencies group (Dependabot). See PR #114.
Add the social preview image of the repository and document its release steps. See PR #113.
v3.0.0 (2026-09-26)¶
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.
Changed¶
Require Python >= 3.12 and wrapt >= 1.16 (first wrapt release supporting Python 3.12). See PR #102.
Migrate the packaging from setuptools (
setup.py/setup.cfg/MANIFEST.in) topyproject.tomlwith the Hatchling build backend; the version is read fromsrc/deprecated/__init__.py.Adopt the
srclayout: the package moves tosrc/deprecated(the tests stay intestsand the documentation indocs).Manage the project with uv (
uv.lock) and Hatch: tox is dropped and replaced by thehatch testmatrix.Modernize the
Makefile(uv/Hatch based targets, runmake help).Replace bump2version by
hatch version <major|minor|patch>: the version is only defined insrc/deprecated/__init__.py, and the git tag is created by GitHub when the release is published.Update the Fedora RPM spec file to the
%pyproject_*macros.
Removed¶
Remove the
inspect2dependency (it was only used on Python 2). See PR #102.Remove the Python 2 compatibility constructs (
u""literals,codingcookies,class Foo(object),super(Class, self),OrderedDict…). See PR #102.Remove the undocumented
deprecated.classic.string_typescompatibility tuple. Abytespositional reason is still accepted by@deprecated, as before. See PR #102.Remove the
deprecated.__date__attribute (the release dates are in the changelog). See PR #102.
Added¶
Add the
deprecated.googlemodule: the@deprecated,@versionaddedand@versionchangeddecorators insert aDeprecated:,Version added:orVersion changed:section in Google style docstrings (see the “Google” decorators page). See PR #105.Add the
deprecated.numpymodule: the@deprecated,@versionaddedand@versionchangeddecorators insert aDeprecated,Version addedorVersion changedsection in NumPy style docstrings (see the “NumPy” decorators page). See PR #106.Add the
ClassicAdapter.warn()method used to emit the deprecation warning (can be overridden by custom adapters). See PR #102.Add Python 3.12 type annotations to the public API and ship the
py.typedmarker (PEP 561): the decorators preserve the signature of the decorated functions and classes. See PR #102.Add
__all__to thedeprecatedpackage:from deprecated import *only exportsdeprecatedanddeprecated_params. See PR #102.
Fixed¶
Deprecated functions and methods can now be pickled (by reference, like regular functions), so they can be used with
multiprocessingand the spawn start method (the default one on Windows and macOS), for instance as aProcesstarget or withPool.map(). Previously, pickling failed withNotImplementedError: object proxy must define __reduce_ex__()(#16). See PR #108 and PR #111 (a function decorated with@deprecatedabove@staticmethodcould not be pickled).When a deprecated class inherits from a deprecated class, all the deprecation warnings now refer to the user code (previously, the warning of the parent class referred to
classic.py). The warnings are emitted withskip_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.Stacked
@deprecated_paramsdecorators 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.
Documentation¶
Convert the documentation from reStructuredText to Markdown (MyST), built with Sphinx 9.1 and MyST-Parser 5.1. The API page remains in reStructuredText (autodoc), and the docstrings are still written in reStructuredText. See PR #103.
Convert the root files to plain Markdown, readable on GitHub:
CHANGELOG.md,CONTRIBUTING.mdandLICENSE.md.Declare the documentation dependencies in the
docsdependency group ofpyproject.toml(docs/requirements.txtis removed); ReadTheDocs installs them with uv.Check the documentation build in the CI (
make docs-check: warnings are errors).Rewrite the white paper: state of the art of deprecation in Python (warning categories and stack level, PEP 702 and the type checkers, the CPython policy, practices of major Open Source projects, best practices), and how to combine
warnings.deprecatedwith this library. See PR #104.Remove the ebook, LaTeX, manual page and Texinfo configuration of the documentation (HTML only), with the files used by the ebook (cover, title page and blurb).
Rework the README: a short presentation, the warning emitted, the options of
@deprecated,@deprecated_params, and how the library complementswarnings.deprecated(PEP 702). The “Authors” section now tells who started the library and who maintains it.New logo (a “best before: next major” price tag), shown in the README and on the home page of the documentation; it replaces the rusty tools image. See PR #109.
Switch the documentation to the Furo theme, with light, dark and automatic (system preference) modes, and the red of the logo as accent color. The code is highlighted with the Lovelace (light) and Gruvbox dark (dark) Pygments styles, tuned for contrast (WCAG AA). See PR #110.
Add
make docs-liveto preview the documentation while editing it: the pages are rebuilt and the browser is reloaded on each change (sphinx-autobuild,docs-livedependency group). See PR #110.Present the Google and NumPy docstring decorators in the documentation. See PR #107.
Document the release process (
docs/source/release.md).Fix the outputs quoted in the tutorial and in the Sphinx page, stale references and typos of the documentation and of the docstrings. See PR #111.
Other¶
Run the CI with uv and Hatch on Python 3.12, 3.13 and 3.14 (Linux, macOS and Windows), plus the wrapt compatibility matrix (wrapt 1.16, 1.17 and 2.x on every supported Python) and the pure Python implementation of wrapt. See PR #102 and PR #111.
Add the
hatch check code(Ruff lint),hatch check fmt(Ruff format) andhatch check types(mypy, strict mode) quality checks. See PR #102.Add non-regression tests for the behaviours which differ between Python 2 and Python 3, and make the
test_sphinx_metaclasstests test the Sphinx decorator. See PR #102.Bump the GitHub Actions versions. See PR #99.
Run CodeQL on the
developandmasterbranches, and add Dependabot version updates (GitHub Actions anduv.lock). See PR #111.Publish the coverage to Coveralls (README badge), and fail the tests below 95% of coverage. See PR #111.
Add
AGENTS.mdandCLAUDE.md: guidance for AI coding agents.
Changelog 1.3.x¶
All notable changes for the 1.3.x releases.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
v1.3.1 (2025-10-30)¶
Patch release: Packaging fix
Fixed¶
Restore missing source distribution (
.tar.gz) that was not included in v1.3.0.
v1.3.0 (2025-10-29)¶
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
Added¶
Add compatibility tests and adjustments for Wrapt v2.0. See PR #88 (musicinmybrain).
Add experimental
@deprecated_paramsdecorator 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.
Documentation¶
Update the Wrapt compatibility matrix to include Python 3.13 and 3.14. See PR #91
Changed¶
Limit test coverage collection to the dedicated
coveragetox environment to avoid collecting coverage across all test environments and reduce cross-environment coverage noise. See PR #92.
Changelog 1.2.x¶
All notable changes for the 1.2.x releases.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Note
The library “Python-Deprecated” was renamed “Deprecated”, simply! This project is more consistent because now, the name of the library is the same as the name of the Python package.
In your
setup.py, you can replace the “Python-Deprecated” dependency with “Deprecated”.In your source code, nothing has changed, you will always use
import deprecated, as before.I decided to keep the same version number because there is really no change in the source code (only in comment or documentation).
v1.2.18 (2024-01-25)¶
This version does not bring any change in the source code, but fixes the build anomaly on Fedora (Packit).
The package must be published on PyPi using twine to correctly deal with the license file.
v1.2.17 (2024-01-25)¶
Bug fix release
v1.2.16 (2025-01-24)¶
Bug fix release
Fix¶
Fix #78: Fix configuration for Packit 1.0.0
Fix #79: Fix the configuration for the intersphinx mapping in the Sphinx documentation. See How to link to other documentation projects with Intersphinx.
Other¶
Drop support for Python older than 3.7 in GitHub Actions.
v1.2.15 (2024-11-15)¶
Bug fix release
Fix¶
Resolve Python 2.7 support issue introduced in v1.2.14 in
sphinx.py.Fix #69: Add
extra_stacklevelargument for interoperating with other wrapper functions (refer to #68 for a concrete use case).Fix #73: Update class method deprecation warnings for Python 3.13.
Fix #75: Update GitHub workflows and fix development dependencies for Python 3.12.
Other¶
Fix #66: discontinue TravisCI and AppVeyor due to end of free support.
v1.2.14 (2023-05-27)¶
Bug fix release
Fix¶
Fix #60: return a correctly dedented docstring when long docstring are using the D212 or D213 format.
Other¶
Add support for Python 3.11.
Drop support for Python older than 3.7 in build systems like pytest and tox, while ensuring the library remains production-compatible.
Update GitHub workflow to run in recent Python versions.
v1.2.13 (2021-09-05)¶
Bug fix release
Fix¶
Fix #45: Change the signature of the
deprecated()decorator to reflect the valid use cases.Fix #48: Fix
versionaddedandversionchangeddecorators: do not return a decorator factory, but a Wrapt adapter.
Other¶
Fix configuration for AppVeyor: simplify the test scripts and set the version format to match the current version.
Change configuration for Tox:
change the requirements for
pipto “pip >= 9.0.3, < 21” (Python 2.7, 3.4 and 3.5).install
typingwhen building on Python 3.4 (required by Pytest->Attrs).run unit tests on Wrapt 1.13 (release candidate).
Migrating project to travis-ci.com.
v1.2.12 (2021-03-13)¶
Bug fix release
Fix¶
Avoid “Explicit markup ends without a blank line” when the decorated function has no docstring.
Fix #40: ‘version’ argument is required in Sphinx directives.
Fix #41:
deprecated.sphinx: strip Sphinx cross-referencing syntax from warning message.
Other¶
Change in Tox and Travis CI configurations: enable unit testing on Python 3.10.
v1.2.11 (2021-01-17)¶
Bug fix release
Fix¶
Fix packit configuration: use
upstream_tag_template: v{version}.Fix #33: Change the class
SphinxAdapter: add theline_lengthkeyword argument to the constructor to specify the max line length of the directive text. Sphinx decorators also accept theline_lengthargument.Fix #34:
versionaddedandversionchangeddecorators don’t emitDeprecationWarninganymore on decorated classes.
Other¶
Change the Tox configuration to run tests on Python 2.7, Python 3.4 and above (and PyPy 2.7 & 3.6).
Update the classifiers in
setup.py.Replace
bumpversionby bump2version insetup.pyand documentation.Update configuration for Black and iSort.
Fix the development requirement versions in
setup.pyfor Python 2.7 EOL.
v1.2.10 (2020-05-13)¶
Bug fix release
Fix¶
Fix #25:
@deprecatedrespects global warning filters with actions other than “ignore” and “always” on Python 3.
Other¶
Change the configuration for TravisCI to build on pypy and pypy3.
Change the configuration for TravisCI and AppVeyor: drop configuration for Python 3.4 and add 3.8.
v1.2.9 (2020-04-10)¶
Bug fix release
Fix¶
Fix #20: Set the
warnings.warn()stacklevel to 2 if the Python implementation is PyPy.Fix packit configuration: use
dist-git-branch: fedora-all.
Other¶
Change the Tox configuration to run tests on PyPy v2.7 and 3.6.
v1.2.8 (2020-04-05)¶
Bug fix release
Fix¶
Fix #15: The
@deprecateddecorator doesn’t set a warning filter if the action keyword argument is not provided orNone. 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.
Documentation¶
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.
Other¶
Change the Tox configuration to test the library with Wrapt 1.12.x.
v1.2.7 (2019-11-11)¶
Bug fix release
Fix¶
Fix #13: Warning displays the correct filename and line number when decorating a function if wrapt does not have the compiled c extension.
Other¶
Support packit for Pull Request tests and sync to Fedora (thanks to Petr Hráček). Supported since v1.2.6.
Add Black configuration file.
v1.2.6 (2019-07-06)¶
Bug fix release
Fix¶
Fix #9: Change the project’s configuration: reinforce the constraint to the Wrapt requirement.
Other¶
Upgrade project configuration (
setup.py) to add the project_urls property: Documentation, Source and Bug Tracker URLs.Change the Tox configuration to test the library against different Wrapt versions.
Fix an issue with the AppVeyor build: upgrade setuptools version in
appveyor.yml, change the Tox configuration: setpy27,py34,py35: pip >= 9.0.3, < 19.2.
v1.2.5 (2019-02-28)¶
Bug fix release
Fix¶
Fix #6: Use
inspect.isroutine()to check if the wrapped object is a user-defined or built-in function or method.
Other¶
Upgrade Tox configuration to add support for Python 3.7. Also, fix PyTest version for Python 2.7 and 3.4 (limited support). Remove dependency ‘requests[security]’: useless to build documentation.
Upgrade project configuration (
setup.py) to add support for Python 3.7.
v1.2.4 (2018-11-03)¶
Bug fix release
Fix¶
Fix #4: Correct the class
ClassicAdapter: Don’t pass arguments toobject.__new__()(other than cls).
Other¶
Add missing docstring to the classes
ClassicAdapterandSphinxAdapter.Change the configuration for TravisCI and AppVeyor: drop configuration for Python 2.6 and 3.3. add configuration for Python 3.7 (if available).
Note
Deprecated is no more tested with Python 2.6 and 3.3. Those Python versions are EOL for some time now and incur incompatibilities with Continuous Integration tools like TravisCI and AppVeyor. However, this library should still work perfectly…
v1.2.3 (2018-09-12)¶
Bug fix release
Fix¶
Fix #3:
deprecated.sphinxdecorators don’t update the docstring.
v1.2.2 (2018-09-04)¶
Bug fix release
Fix¶
Fix #2: a deprecated class is a class (not a function). Any subclass of a deprecated class is also deprecated.
Minor fix: add missing documentation in
deprecated.sphinxmodule.
v1.2.1 (2018-08-27)¶
Bug fix release
Fix¶
Add a
MANIFEST.infile to package additional files like “LICENSE.rst” in the source distribution.
v1.2.0 (2018-04-02)¶
Minor release
Added¶
Add decorators for Sphinx directive integration:
versionadded,versionchanged,deprecated. That way, the developer can document the changes.
Changed¶
Add the
versionparameter to the@deprecateddecorator: used to specify the starting version number of the deprecation.Add a way to choose a
DeprecationWarningsubclass.
Removed¶
Deprecated no longer supports Python 2.6 and 3.3. Those Python versions are EOL for some time now and incur maintenance and compatibility costs on the Deprecated core team, and following up with the rest of the community we decided that they will no longer be supported starting on this version. Users which still require those versions should pin Deprecated to
< 1.2.
Changelog 1.1.x and 1.0.x¶
All notable changes for the 1.1.x and 1.0.x releases.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
v1.1.5 (2019-02-28)¶
Bug fix release
Fix¶
Fix #6: Use
inspect.isroutine()to check if the wrapped object is a user-defined or built-in function or method.
Other¶
Upgrade Tox configuration to add support for Python 3.7. Also, fix PyTest version for Python 2.7 and 3.4 (limited support). Remove dependency ‘requests[security]’: useless to build documentation.
Upgrade project configuration (
setup.py) to add support for Python 3.7.
v1.1.4 (2018-11-03)¶
Bug fix release
Fix¶
Fix #4: Correct the function
deprecated(): Don’t pass arguments toobject.__new__()(other than cls).
Other¶
Change the configuration for TravisCI and AppVeyor: drop configuration for Python 2.6 and 3.3. add configuration for Python 3.7.
Note
Deprecated is no more tested with Python 2.6 and 3.3. Those Python versions are EOL for some time now and incur incompatibilities with Continuous Integration tools like TravisCI and AppVeyor. However, this library should still work perfectly…
v1.1.3 (2018-09-03)¶
Bug fix release
Fix¶
Fix #2: a deprecated class is a class (not a function). Any subclass of a deprecated class is also deprecated.
v1.1.2 (2018-08-27)¶
Bug fix release
Fix¶
Add a
MANIFEST.infile to package additional files like “LICENSE.rst” in the source distribution.
v1.1.1 (2018-04-02)¶
Bug fix release
Fix¶
Minor correction in
CONTRIBUTING.rstfor Sphinx builds: add the-doption to put apart thedoctreesfrom the generated documentation and avoid warnings with epub generator.Fix in documentation configuration: remove hyphens in
epub_identifier(ISBN number has no hyphens).Fix in Tox configuration: set the versions interval of each dependency.
Other¶
Change in documentation: improve sentence phrasing in the Tutorial.
Restore the epub title to “Python Deprecated Library v1.1 Documentation” (required for Lulu.com).
v1.1.0 (2017-11-06)¶
Minor release
Added¶
Change in
deprecated.deprecated()decorator: you can give a “reason” message to help the developer choose another class, function or method.Add support for Universal Wheel (Python versions 2.6, 2.7, 3.3, 3.4, 3.5, 3.6 and PyPy).
Add missing
__doc__and__version__attributes todeprecatedmodule.Add an extensive documentation of Deprecated Library.
Other¶
Improve Travis configuration file (compatibility from Python 2.6 to 3.7-dev, and PyPy).
Add AppVeyor configuration file.
Add Tox configuration file.
Add BumpVersion configuration file.
Improve project settings: add a long description for the project. Set the license and the development status in the classifiers property.
Add the
CONTRIBUTING.rstfile: “How to contribute to Deprecated Library”.
v1.0.0 (2016-08-30)¶
Major release
Added¶
deprecated: Created @deprecated decorator