Python Package Guide: Fix breakout box / admonition that shows a user how to rename their package if the name is taken on pypi
When setting up the TestPyPi upload for my custom package -- I noticed there was already a package with my name available in TestPyPi and PyPi. The Package Guide (https://www.pyopensci.org/python-package-guide/tutorials/publish-pypi.html) Step 3. Setup your TestPyPI account states to rename your package (to avoid duplicate names).
I am currently working through the process now, and it is unclear the steps that need to be taken to successfully rename the package?
- [ ] Rename the associated GitHub repository (and local cloned folder)
- [ ] Rename the package files within
src/ - [ ] Rebuild the
distfiles after renaming the package
These were the steps I am considering -- but I am unsure if there are others (what the ideal order of operations would be). It would be great if further documentation could be provided on this.
This issue relates to a documentation / tutorial page around what happens if you create a package locally, want to publish it to pypi and then learn AFTER that the name is already taken. it would walk a user through all of the places that they'd want to update things following best practices. this likely looks like
- Find a name that will work / isn't taken
- update pyproject.toml file
- update both your project and package directory
- update github repo name
- update removes to github repo (you don't have to do this but it's a good idea to keep things clear)
- publish to pypi to capture the name. i suspect you'd want to do this all in the same day so the new name doesn't get taken :)
@Tyler-Bonnell if i didn't capture this quite right please let me know!
For me, the work is captured in the following two commits, with the second being optional but recommended.
- Update project name in
pyproject.toml; update folder name undersrc(commit) - Update README.md entries (commit)
More info about my experience under #261, including errors encountered when trying to have hyphens in new name.
@Tyler-Bonnell @pb-413 submitted a pr that i just merged - the text is here does that fix address your concerns?
(you have to open the dropdown on the page - the styles are odd but we can fix that later - that is a sphinx theme issue!.
I do want to keep this issue open. I think what we want to do is
- make that admonition visible to everyone (rather than a drop down link that people might miss)
- rename the admonition: How to rename your Python package if the name is already taken in PyPI // TestPyPi
Once we do that this issue is complete. this is a very beginner friendly task!!