Search code examples
pythonpypi

How to protect PyPI package from being deleted


It seems deleting a PyPI package is possible - How to remove a package from Pypi

This can cause problems if multiple team members have access to PyPI account holding the PyPI package and permissions. A person can accidentally delete a package if a person don't know dependent packages using the specific versions of a particular package.

Is it possible to block deletion of certain PyPI packages or send a notification if someone performs this sort of operation?


Solution

  • PyPI has two distinct roles for project collaborators:

    Maintainer: Can upload releases for a package. Cannot add collaborators. Cannot delete files, releases, or the project.

    Owner: Can upload releases. Can add other collaborators. Can delete files, releases, or the entire project.

    You can prevent your project from being accidentally deleted by giving it a single "owner", and making all other collaborators "maintainers".

    With regards to notifications, this isn't currently possible, but would make a great feature request.