{"id":391,"library":"deprecated","title":"Deprecated Library","description":"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.","status":"active","version":"1.3.1","language":"python","source_language":"en","source_url":"https://github.com/laurent-laporte-pro/deprecated","tags":["deprecation","decorator","Python"],"install":[{"cmd":"pip install deprecated","lang":"bash","label":"Install Deprecated Library"}],"dependencies":[{"reason":"Required for function wrapping and decorator support","package":"wrapt"}],"imports":[{"note":"Ensure correct import path to avoid ImportError","symbol":"deprecated","correct":"import deprecated"}],"quickstart":{"code":"import deprecated\n\n@deprecated\ndef old_function():\n    pass\n\nold_function()","lang":"python","description":"Example of using the `@deprecated` decorator to mark a function as deprecated."},"warnings":[{"fix":"Upgrade to wrapt 2.x or adjust your code to maintain compatibility.","message":"Deprecated Library version 1.3.0 introduced support for wrapt 2.x, which may cause compatibility issues with previous versions.","severity":"breaking","affected_versions":"1.3.0"},{"fix":"Upgrade to Python 3.7 or later.","message":"Python 2.7 support is deprecated and will be removed in future releases.","severity":"deprecated","affected_versions":"All versions supporting Python 2.7"},{"fix":"Always specify the version when marking a function as deprecated.","message":"Using the `@deprecated` decorator without specifying a version may lead to confusion about the deprecation status.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Use `@deprecated.deprecated` when marking a function as deprecated, optionally passing arguments like version: `@deprecated.deprecated(version='1.0')`.","message":"Attempting 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`.","severity":"breaking","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-05-12T13:29:07.525Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Run `pip install deprecated` in your terminal to install the library.","cause":"The 'deprecated' Python package has not been installed in the active Python environment.","error":"ModuleNotFoundError: No module named 'deprecated'"},{"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.","cause":"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.","error":"TypeError: deprecated() got an unexpected keyword argument 'name'"},{"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.","cause":"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.","error":"DeprecationWarning: Call to deprecated function (or staticmethod) <function_name>."}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.15,"mem_mb":4.5,"disk_size":"18.4M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.1,"mem_mb":4.5,"disk_size":"19M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.18,"mem_mb":5.1,"disk_size":"20.3M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.14,"mem_mb":5.1,"disk_size":"21M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.14,"mem_mb":5,"disk_size":"12.2M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.14,"mem_mb":5,"disk_size":"13M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.1,"mem_mb":3.9,"disk_size":"11.8M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.1,"mem_mb":3.7,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.07,"mem_mb":3.3,"disk_size":"17.9M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.06,"mem_mb":3.3,"disk_size":"18M"}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}