Skip to content

Commit af1c7e3

Browse files
authored
Add: unique package name checks for PyPI and TestPyPI
Unique package name - Corrective action steps
2 parents dcdd937 + 81ea657 commit af1c7e3

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

tutorials/publish-pypi.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Package Version Editable project location
113113
numpy 1.26.3
114114
pandas 2.1.4
115115
pip 23.3.1
116-
pyosPackage 0.1 /path/to/your/project/here/pyosPackage
116+
pyosPackage 0.1.0 /path/to/your/project/here/pyosPackage
117117
python-dateutil 2.8.2
118118
pytz 2023.3.post1
119119
six 1.16.0
@@ -205,11 +205,22 @@ If you have a package that you are confident belongs on PyPI, all of the steps b
205205

206206
Example: `pyosPackage_yourNameHere`.
207207

208-
:::{todo}
209-
Show them how to do this
208+
:::{dropdown} Renaming your project before publishing
209+
:color: secondary
210+
211+
#### Required
212+
213+
1. Search your publishing location(s) to make sure your new name isn't taken ([TestPyPI](https://test.pypi.org/), [PyPI](https://pypi.org/), [conda-forge](https://conda-forge.org/packages/))
214+
2. Update the project name in your pyproject.toml file (e.g. `name = "pyospackage_yourNameHere"`)
215+
3. Update the module folder name to be the same (e.g. `src/pyospackage_yourNameHere`)
216+
4. Rebuild your project (`hatch build`)
217+
5. Publish your package to capture the name (continue this tutorial!)
218+
219+
#### Recommended
210220

211-
1. update the project-name in the pyproject.toml file
212-
2. update the module repository directory to be the same
221+
- Update the Github repository name to align with the new package name
222+
- Update your local project folder to match the new package name (e.g. `pyospackage_yourNameHere/src`)
223+
- Update mentions of your repository name in other files (e.g. `README.md`)
213224
:::
214225

215226
:::{figure-md} test-pypi-search

tutorials/pyproject-toml.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ The pyproject.toml file tells your build tool:
7878

7979
- What build backend to use to build your package (we are using `hatchling` in this tutorial but there are [many others to choose from](/package-structure-code/python-package-build-tools)).
8080
- How and where to retrieve your package's version:
81-
- **statically** where you declare the version `version = "0.1"` or
81+
- **statically** where you declare the version `version = "0.1.0"` or
8282
- **dynamically** where the tool looks to the most recent tag in your history to determine the current version.
8383
- What dependencies your package needs
8484
- What versions of Python your package supports (important for your users).
@@ -139,7 +139,7 @@ build-backend = "hatchling.build"
139139

140140
[project]
141141
name = "pyospackage"
142-
version = "0.1"
142+
version = "0.1.0"
143143
```
144144

145145
Your next step is to add additional recommended metadata fields that will both
@@ -161,7 +161,7 @@ After completing the [installable code tutorial](installable-code), you should h
161161
```toml
162162
[project]
163163
name = "pyospackage"
164-
version = "0.1"
164+
version = "0.1.0"
165165
```
166166

167167
Add the following to your table:
@@ -230,7 +230,7 @@ build-backend = "hatchling.build"
230230

231231
[project]
232232
name = "pyospackage"
233-
version = "0.1"
233+
version = "0.1.0"
234234
description = """
235235
Tools that update the pyOpenSci contributor and review metadata
236236
that is posted on our website
@@ -278,7 +278,7 @@ build-backend = "hatchling.build"
278278

279279
[project]
280280
name = "pyospackage"
281-
version = "0.1"
281+
version = "0.1.0"
282282
description = """
283283
Tools that update the pyOpenSci contributor and review metadata
284284
that is posted on our website
@@ -310,7 +310,7 @@ build-backend = "hatchling.build"
310310

311311
[project]
312312
name = "pyospackage"
313-
version = "0.1"
313+
version = "0.1.0"
314314
description = """
315315
Tools that update the pyOpenSci contributor and review metadata
316316
that is posted on our website
@@ -382,7 +382,7 @@ build-backend = "hatchling.build"
382382

383383
[project]
384384
name = "pyospackage"
385-
version = "0.1"
385+
version = "0.1.0"
386386
description = """
387387
Tools that update the pyOpenSci contributor and review metadata
388388
that is posted on our website
@@ -457,7 +457,7 @@ build-backend = "hatchling.build"
457457

458458
[project]
459459
name = "pyospackage"
460-
version = "0.1"
460+
version = "0.1.0"
461461
description = """
462462
Tools that update the pyOpenSci contributor and review metadata
463463
that is posted on our website
@@ -507,7 +507,7 @@ build-backend = "hatchling.build"
507507

508508
[project]
509509
name = "pyospackage"
510-
version = "0.1"
510+
version = "0.1.0"
511511
description = """
512512
Tools that update the pyOpenSci contributor and review metadata
513513
that is posted on our website
@@ -558,7 +558,7 @@ build-backend = "hatchling.build"
558558

559559
[project]
560560
name = "pyospackage"
561-
version = "0.1"
561+
version = "0.1.0"
562562
description = """
563563
Tools that update the pyOpenSci contributor and review metadata
564564
that is posted on our website
@@ -614,7 +614,7 @@ build-backend = "hatchling.build"
614614
[project]
615615
name = "pyospackage"
616616
# dynamic = ["version"] # you will learn how to dynamically set the version in a future lesson
617-
version = "0.1" # manually assign version (not preferred)
617+
version = "0.1.0" # manually assign version (not preferred)
618618
description = "Tools that update the pyOpenSci contributor and review metadata that is posted on our website"
619619
authors = [{ name = "Firstname lastname", email = "email@pyopensci.org" }]
620620

0 commit comments

Comments
 (0)