pyOpenSci / python-package-guide

scientific Python package recommendations & guidance curated by pyOpenSci
https://www.pyopensci.org/python-package-guide/
Other
70 stars 43 forks source link

Python Package Guide: Changing Name of a Package (Pre-Existing TestPyPi/PyPi Packages with Same Name) #244

Open Tyler-Bonnell opened 2 months ago

Tyler-Bonnell commented 2 months ago

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?

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.

lwasser commented 1 month ago

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!

pb-413 commented 1 month ago

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.

lwasser commented 1 month ago

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