Deprecating a Python package

In typeshed, we often deprecate stub packages, mainly because the upstream added type annotations or stubs themselves. While we do add a note about the deprecation to the package’s description (see here for an example), this is very easily overlooked by our users. In other cases, a maintainer might deprecate a Python package, or a package is superseded by a newer package. There is also no way to signal that to the user.

I suggest to add an optional Deprecated header to package metadata. The value would be an explanation how or why a package is deprecated and for possible alternatives. This could be displayed prominently on a package’s PyPI page, but it could also be displayed by tools like pip or poetry when a deprecated package is installed.

While this doesn’t solve all problems (for example, if a package is just abandoned), at least for typeshed users this would be highly beneficial.

Some previous discussion was here: How to deprecate a python package? · Issue #883 · pypa/packaging.python.org · GitHub.

7 Likes

Please see this topic: