From 63af4ffe87aae53ca007cfb928bc71cc221517d4 Mon Sep 17 00:00:00 2001 From: "Patrick K. Byers" Date: Tue, 21 May 2024 14:20:35 -0400 Subject: [PATCH 1/3] first pass over steps from #244 --- tutorials/publish-pypi.md | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/tutorials/publish-pypi.md b/tutorials/publish-pypi.md index 21375e93..6752d04b 100644 --- a/tutorials/publish-pypi.md +++ b/tutorials/publish-pypi.md @@ -205,11 +205,27 @@ If you have a package that you are confident belongs on PyPI, all of the steps b Example: `pyosPackage_yourNameHere`. -:::{todo} -Show them how to do this - -1. update the project-name in the pyproject.toml file -2. update the module repository directory to be the same +:::{dropdown} Renaming your project before publishing +:color: secondary + +**Required**: +0. 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/) +1. Update the project name in your pyproject.toml file + - `name = "pyospackage_yourNameHere"` +2. Update the module folder name to be the same + - `src/pyospackage_yourNameHere` +3. Rebuild your project + - `hatch build` +4. Publish your package to capture the name (continue this guide!) + +**Recommended**: +- Update the Github repository name to align with the new package name +- Update the project folder to match the new package name + - `pyospackage_yourNameHere/src` +- Update mentions of your repository name in other files; e.g. `README.md` ::: :::{figure-md} test-pypi-search From 5c7e33462f9f87326ab6ac3ce86345f9452b326a Mon Sep 17 00:00:00 2001 From: "Patrick K. Byers" Date: Tue, 21 May 2024 14:26:20 -0400 Subject: [PATCH 2/3] revert unrelated, unmerged changes --- tutorials/publish-pypi.md | 2 +- tutorials/pyproject-toml.md | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tutorials/publish-pypi.md b/tutorials/publish-pypi.md index 6752d04b..2a75242f 100644 --- a/tutorials/publish-pypi.md +++ b/tutorials/publish-pypi.md @@ -113,7 +113,7 @@ Package Version Editable project location numpy 1.26.3 pandas 2.1.4 pip 23.3.1 -pyosPackage 0.1 /path/to/your/project/here/pyosPackage +pyosPackage 0.1.0 /path/to/your/project/here/pyosPackage python-dateutil 2.8.2 pytz 2023.3.post1 six 1.16.0 diff --git a/tutorials/pyproject-toml.md b/tutorials/pyproject-toml.md index 38107071..0cc45363 100644 --- a/tutorials/pyproject-toml.md +++ b/tutorials/pyproject-toml.md @@ -78,7 +78,7 @@ The pyproject.toml file tells your build tool: - 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)). - How and where to retrieve your package's version: - - **statically** where you declare the version `version = "0.1"` or + - **statically** where you declare the version `version = "0.1.0"` or - **dynamically** where the tool looks to the most recent tag in your history to determine the current version. - What dependencies your package needs - What versions of Python your package supports (important for your users). @@ -139,7 +139,7 @@ build-backend = "hatchling.build" [project] name = "pyospackage" -version = "0.1" +version = "0.1.0" ``` 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 ```toml [project] name = "pyospackage" -version = "0.1" +version = "0.1.0" ``` Add the following to your table: @@ -230,7 +230,7 @@ build-backend = "hatchling.build" [project] name = "pyospackage" -version = "0.1" +version = "0.1.0" description = """ Tools that update the pyOpenSci contributor and review metadata that is posted on our website @@ -278,7 +278,7 @@ build-backend = "hatchling.build" [project] name = "pyospackage" -version = "0.1" +version = "0.1.0" description = """ Tools that update the pyOpenSci contributor and review metadata that is posted on our website @@ -310,7 +310,7 @@ build-backend = "hatchling.build" [project] name = "pyospackage" -version = "0.1" +version = "0.1.0" description = """ Tools that update the pyOpenSci contributor and review metadata that is posted on our website @@ -382,7 +382,7 @@ build-backend = "hatchling.build" [project] name = "pyospackage" -version = "0.1" +version = "0.1.0" description = """ Tools that update the pyOpenSci contributor and review metadata that is posted on our website @@ -457,7 +457,7 @@ build-backend = "hatchling.build" [project] name = "pyospackage" -version = "0.1" +version = "0.1.0" description = """ Tools that update the pyOpenSci contributor and review metadata that is posted on our website @@ -507,7 +507,7 @@ build-backend = "hatchling.build" [project] name = "pyospackage" -version = "0.1" +version = "0.1.0" description = """ Tools that update the pyOpenSci contributor and review metadata that is posted on our website @@ -558,7 +558,7 @@ build-backend = "hatchling.build" [project] name = "pyospackage" -version = "0.1" +version = "0.1.0" description = """ Tools that update the pyOpenSci contributor and review metadata that is posted on our website @@ -614,7 +614,7 @@ build-backend = "hatchling.build" [project] name = "pyospackage" # dynamic = ["version"] # you will learn how to dynamically set the version in a future lesson -version = "0.1" # manually assign version (not preferred) +version = "0.1.0" # manually assign version (not preferred) description = "Tools that update the pyOpenSci contributor and review metadata that is posted on our website" authors = [{ name = "Firstname lastname", email = "email@pyopensci.org" }] @@ -688,7 +688,7 @@ You are now ready to publish a new version of your Python package to (test) PyPI Try to republish now. First, update the version of your package in your pyproject toml file. Below version is updated from -`0.1` to `0.2`. +`0.1.0` to `0.1.1`. ```TOML [build-system] @@ -697,7 +697,7 @@ build-backend = "hatchling.build" [project] name = "pyospackage" -version = "0.2" +version = "0.1.1" ``` Now use hatch to publish the new version of your package to test.PyPI.org. From 4b7f1e9312244235134a1e073cd0704f5d74d7af Mon Sep 17 00:00:00 2001 From: "Patrick K. Byers" Date: Tue, 21 May 2024 14:53:38 -0400 Subject: [PATCH 3/3] fidle with markdown for better formatting / readability after build --- tutorials/publish-pypi.md | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/tutorials/publish-pypi.md b/tutorials/publish-pypi.md index 2a75242f..0fa4d6ea 100644 --- a/tutorials/publish-pypi.md +++ b/tutorials/publish-pypi.md @@ -208,24 +208,19 @@ Example: `pyosPackage_yourNameHere`. :::{dropdown} Renaming your project before publishing :color: secondary -**Required**: -0. 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/) -1. Update the project name in your pyproject.toml file - - `name = "pyospackage_yourNameHere"` -2. Update the module folder name to be the same - - `src/pyospackage_yourNameHere` -3. Rebuild your project - - `hatch build` -4. Publish your package to capture the name (continue this guide!) - -**Recommended**: +#### Required + +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/)) +2. Update the project name in your pyproject.toml file (e.g. `name = "pyospackage_yourNameHere"`) +3. Update the module folder name to be the same (e.g. `src/pyospackage_yourNameHere`) +4. Rebuild your project (`hatch build`) +5. Publish your package to capture the name (continue this tutorial!) + +#### Recommended + - Update the Github repository name to align with the new package name -- Update the project folder to match the new package name - - `pyospackage_yourNameHere/src` -- Update mentions of your repository name in other files; e.g. `README.md` +- Update your local project folder to match the new package name (e.g. `pyospackage_yourNameHere/src`) +- Update mentions of your repository name in other files (e.g. `README.md`) ::: :::{figure-md} test-pypi-search