From 3a85d0110548179889af1f984cb67705d6f76a37 Mon Sep 17 00:00:00 2001 From: Frank Schultz Date: Fri, 10 Oct 2025 10:09:33 +0200 Subject: [PATCH 1/5] add Build wheel and source tarball in publish.yml --- .github/workflows/publish.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6763af0..01f478f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,8 +13,9 @@ jobs: with: python-version: "3" - name: Install "build" - run: | - python -m pip install build + run: python -m pip install build + - name: Build wheel and source tarball + run: python -m build - name: Store the distribution packages uses: actions/upload-artifact@v4 with: From e34eeebe39cd06f7402faa6d0372078045e3bb10 Mon Sep 17 00:00:00 2001 From: Frank Schultz Date: Fri, 10 Oct 2025 11:21:43 +0200 Subject: [PATCH 2/5] Update CONTRIBUTING.rst mods for Github workflow -> PyPi release handling --- CONTRIBUTING.rst | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index b84729c..7da18f5 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -62,22 +62,39 @@ whatever you need with ``uv run``. Creating a New Release ^^^^^^^^^^^^^^^^^^^^^^ -New releases are made using the following steps: +It is proposed to perform these steps for creating a new release: #. Bump version number in ``sfs/__init__.py`` #. Update ``NEWS.rst`` #. Commit those changes as "Release x.y.z" #. Create an (annotated) tag with ``git tag -a x.y.z`` -#. Clear the ``dist/`` directory -#. Create a source distribution with ``python3 setup.py sdist`` -#. Create a wheel distribution with ``python3 setup.py bdist_wheel`` -#. Check that both files have the correct content -#. Upload them to PyPI_ with twine_: ``python3 -m twine upload dist/*`` -#. Push the commit and the tag to Github and `add release notes`_ containing a - link to PyPI and the bullet points from ``NEWS.rst`` +#. Push the commit and the tag to Github +#. Github workflow publish.yml will handle the build and upload to PyPi +#. `Add release notes`_ containing a link to PyPI and the bullet points + from ``NEWS.rst`` #. Check that the new release was built correctly on RTD_ - and select the new release as default version + and select the new release as the default version + +Alternatively, an extra branch and PR can be utilised as follows: + +#. Create a branch from the current master branch state. In this new branch: +#. Bump version number in ``sfs/__init__.py`` +#. Update ``NEWS.rst`` +#. Commit those changes as "Release x.y.z", push this commit and make a PR. + This will trigger workflows to check that everything is fine, the PR is a + nice additional documentation of this release process. +#. Create an (annotated) tag with ``git tag -a x.y.z`` and push it +#. Due to this tag push Github workflow publish.yml will handle the build + and upload to PyPi +#. Merge the PR by ``git merge branch_name --ff-only``. This is needed for + preserving the release and tag commits as they need to appear exactly this + way in the master branch history. +#. Delete the branch +#. `Add release notes`_ containing a link to PyPI and the bullet points + from ``NEWS.rst`` +#. Check that the new release was built correctly on RTD_ + and select the new release as the default version + -.. _twine: https://twine.readthedocs.io/ .. _add release notes: https://github.com/sfstoolbox/sfs-python/tags .. _RTD: https://readthedocs.org/projects/sfs-python/builds/ From dbf912ce6403143cd3a53c1bb07088224f52b114 Mon Sep 17 00:00:00 2001 From: Frank Schultz Date: Sat, 11 Oct 2025 11:55:58 +0200 Subject: [PATCH 3/5] Update CONTRIBUTING.rst --- CONTRIBUTING.rst | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 7da18f5..095ea53 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -62,39 +62,20 @@ whatever you need with ``uv run``. Creating a New Release ^^^^^^^^^^^^^^^^^^^^^^ -It is proposed to perform these steps for creating a new release: +These steps for creating a new release are proposed to be taken only after +ensuring that CI (unit tests, sphinx for RTD_, build of wheel and source distribution) +raised no errors. #. Bump version number in ``sfs/__init__.py`` #. Update ``NEWS.rst`` #. Commit those changes as "Release x.y.z" #. Create an (annotated) tag with ``git tag -a x.y.z`` #. Push the commit and the tag to Github -#. Github workflow publish.yml will handle the build and upload to PyPi +#. The workflow ``.github/workflows/publish.yml`` will handle the build and the + upload to PyPI #. `Add release notes`_ containing a link to PyPI and the bullet points - from ``NEWS.rst`` -#. Check that the new release was built correctly on RTD_ - and select the new release as the default version - -Alternatively, an extra branch and PR can be utilised as follows: - -#. Create a branch from the current master branch state. In this new branch: -#. Bump version number in ``sfs/__init__.py`` -#. Update ``NEWS.rst`` -#. Commit those changes as "Release x.y.z", push this commit and make a PR. - This will trigger workflows to check that everything is fine, the PR is a - nice additional documentation of this release process. -#. Create an (annotated) tag with ``git tag -a x.y.z`` and push it -#. Due to this tag push Github workflow publish.yml will handle the build - and upload to PyPi -#. Merge the PR by ``git merge branch_name --ff-only``. This is needed for - preserving the release and tag commits as they need to appear exactly this - way in the master branch history. -#. Delete the branch -#. `Add release notes`_ containing a link to PyPI and the bullet points - from ``NEWS.rst`` -#. Check that the new release was built correctly on RTD_ - and select the new release as the default version - + from the updated ``NEWS.rst`` +#. Select the new release as the default on RTD_ .. _add release notes: https://github.com/sfstoolbox/sfs-python/tags .. _RTD: https://readthedocs.org/projects/sfs-python/builds/ From 1121f3f5022cf3810a1a5708ccbff9f4417ef5a6 Mon Sep 17 00:00:00 2001 From: Frank Schultz Date: Sat, 11 Oct 2025 12:00:15 +0200 Subject: [PATCH 4/5] Update publish.yml --- .github/workflows/publish.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 01f478f..eb8a56b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,9 +13,12 @@ jobs: with: python-version: "3" - name: Install "build" - run: python -m pip install build + run: | + python -m pip install build - name: Build wheel and source tarball run: python -m build + run: | + python -m build - name: Store the distribution packages uses: actions/upload-artifact@v4 with: From dd0962a972c3f05142f7258192fd3f9ebed0c19a Mon Sep 17 00:00:00 2001 From: Frank Schultz Date: Sat, 11 Oct 2025 12:21:37 +0200 Subject: [PATCH 5/5] Update publish.yml --- .github/workflows/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index eb8a56b..d3250cb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,6 @@ jobs: run: | python -m pip install build - name: Build wheel and source tarball - run: python -m build run: | python -m build - name: Store the distribution packages