zope.deprecation provides utilities for marking modules, classes, functions, methods, and properties as deprecated in Python projects. It helps manage backward compatibility by issuing warnings when deprecated code is used. The current version is 6.0, and it generally sees a few releases per year, often tied to Python version support updates or internal Zope Foundation infrastructure changes.
pip install zope.deprecationVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use the `@deprecate` decorator for functions and mentions `moved` for module relocations. It also shows how to enable warnings and temporarily suppress them using `Suppressor`.
Ensure your project's `pyproject.toml` or `setup.cfg` correctly declares namespace packages according to PEP 420. If you encounter `ModuleNotFoundError`, a clean reinstall of all `zope` related packages in a new virtual environment is often recommended.
Upgrade to Python 3.9 or newer. The current version (6.0) requires Python >=3.9.
Always use a single, consistent tool for installing Python packages, preferably `pip` with virtual environments. If issues arise, perform a clean uninstall of all related packages and reinstall using only `pip`.
Use `warnings.simplefilter('always', DeprecationWarning)` in your code, or run Python with the `-Wa` or `-Wd` flag (e.g., `python -Wd your_script.py`) to ensure deprecation warnings are displayed.pip install zope.deprecation
Use `@deprecated('your deprecation message')` as the decorator for functions and methods, or call `zope.deprecation.deprecate(obj, 'obj_name')` for classes or modules.Import `implementer` from `zope.interface` instead. Ensure `zope.interface` is installed if you intend to use it.
No dependency data recorded yet.