python-package-guide icon indicating copy to clipboard operation
python-package-guide copied to clipboard

Python Package Guide: Fix breakout box / admonition that shows a user how to rename their package if the name is taken on pypi

Open Tyler-Bonnell opened this issue 1 year ago • 4 comments

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 dist files 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.

Tyler-Bonnell avatar Apr 15 '24 22:04 Tyler-Bonnell

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

  1. Find a name that will work / isn't taken
  2. update pyproject.toml file
  3. update both your project and package directory
  4. update github repo name
  5. update removes to github repo (you don't have to do this but it's a good idea to keep things clear)
  6. 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!

lwasser avatar May 19 '24 22:05 lwasser

For me, the work is captured in the following two commits, with the second being optional but recommended.

  1. Update project name in pyproject.toml; update folder name under src (commit)
  2. Update README.md entries (commit)

More info about my experience under #261, including errors encountered when trying to have hyphens in new name.

pb-413 avatar May 21 '24 16:05 pb-413

@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!.

lwasser avatar May 31 '24 00:05 lwasser

I do want to keep this issue open. I think what we want to do is

  1. make that admonition visible to everyone (rather than a drop down link that people might miss)
  2. 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!!

lwasser avatar Jul 12 '24 18:07 lwasser