What's the recommended way of renaming a project in pypi?

Question:

I want people that know of the old name to be directed to the new name.

For the pypi website, it’s easy to upload a package with a README linking to the new package.

I’m not sure what’s the best way to handle people using pip to install it. I assume it might be possible to show an error on pip install old_name, looking around it seems to be possible using cmdclass in setup.py and maybe throwing an exception in the right place but the documentation around it is scarce to put it mildly.

So I was wondering if anyone is aware of proper built-in systems for this, or common practices to handle this sort of thing.

Asked By: MattBas

||

Answers:

Declare the new package a dependency of the old. See for example how scikit-learn does it: the old package sklearn declares in its setup.py:

install_requires=['scikit-learn'],

Thus everyone who does pip install sklearn automatically gets scikit-learn.

Answered By: phd

pypi-rename worked perfectly for me. It automates the process of making a README and redirecting users to the new package.

https://github.com/simonw/pypi-rename

Answered By: manimino
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.