From be50447871a4ac4d2b9620bcc2540323e180b61e Mon Sep 17 00:00:00 2001 From: boronine-bot Date: Wed, 21 Oct 2026 21:08:46 +0000 Subject: [PATCH 1/6] Prepare 5.0.5rc1 and document PyPI release approvals --- README.md | 20 ++++++++++++++++++++ hsluv.py | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 93667f4..aa40a70 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,26 @@ For HPLuv (the pastel variant), use `hpluv_to_hex`, `hpluv_to_rgb`, `hex_to_hplu Run `python -m unittest discover -v`. +## Publishing to PyPI + +Configure the GitHub environment and PyPI Trusted Publisher before publishing: + +* In `hsluv/hsluv-python` on GitHub, open **Settings → Environments → New environment**. +* Name the environment **`pypi`** and click **Configure environment**. If it already exists, open it instead. +* Under **Deployment protection rules**, enable **Required reviewers**, select trusted release reviewers, and save the rules. Only one listed reviewer needs to approve a deployment. +* Enable **Prevent self-review** if a different person should approve the workflow initiator's deployment. Ensure another reviewer is available before enabling it. +* Under **Deployment branches and tags**, choose **Selected branches and tags** and add a branch rule for **`main`** to restrict publishing to that branch. +* If these protection options are unavailable, check GitHub's plan and repository-visibility requirements before relying on approval enforcement. +* As a PyPI project Owner, open the `hsluv` project's **Manage → Publishing** page and add a GitHub Trusted Publisher with owner **`hsluv`**, repository **`hsluv-python`**, workflow **`publish.yml`**, and environment **`pypi`**. No API token or GitHub secret is needed. + +To publish a release: + +* Update `__version__` in `hsluv.py` to an unused version, such as `5.0.5rc1` for a pre-release, and merge the change into `main` after tests pass. +* Open **Actions → Publish to PyPI → Run workflow**, select **`main`**, and click **Run workflow**. This uploads to production PyPI, including for pre-release versions; a tag or GitHub release is not required. +* If approval is required, have an eligible reviewer open the workflow run, click **Review deployments**, select **`pypi`**, and click **Approve and deploy**. +* Wait for the workflow to succeed, then verify the version on [PyPI](https://pypi.org/project/hsluv/) and install it with `python -m pip install 'hsluv==5.0.5rc1'` (substitute the version being released). +* Never reuse a published version: PyPI does not allow replacing uploaded distribution files, even after deletion. + ## Authors * Robert McGinley ([mcginleyr1](https://github.com/mcginleyr1)) diff --git a/hsluv.py b/hsluv.py index 9c018af..7c0b5f3 100644 --- a/hsluv.py +++ b/hsluv.py @@ -5,7 +5,7 @@ haxe -cp haxe/src hsluv.Hsluv -python hsluv.py """ -__version__ = '5.0.4' +__version__ = '5.0.5rc1' from functools import wraps as _wraps, partial as _partial # unexport, see #17 import math as _math # unexport, see #17 From 3409ae3fc4a791619ec3117ca4d645c2f22d69a7 Mon Sep 17 00:00:00 2001 From: boronine-bot Date: Wed, 21 Oct 2026 22:53:36 +0000 Subject: [PATCH 2/6] Simplify publishing setup and require tests before upload --- .github/workflows/publish.yml | 2 ++ README.md | 22 +++++----------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 94ae99b..fd5f921 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,6 +18,8 @@ jobs: - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: '3.11' + - name: Run tests + run: python -m unittest discover -v - run: python -m pip install build twine - name: Build and check distributions run: | diff --git a/README.md b/README.md index aa40a70..8f18b4f 100644 --- a/README.md +++ b/README.md @@ -42,23 +42,11 @@ Run `python -m unittest discover -v`. ## Publishing to PyPI -Configure the GitHub environment and PyPI Trusted Publisher before publishing: - -* In `hsluv/hsluv-python` on GitHub, open **Settings → Environments → New environment**. -* Name the environment **`pypi`** and click **Configure environment**. If it already exists, open it instead. -* Under **Deployment protection rules**, enable **Required reviewers**, select trusted release reviewers, and save the rules. Only one listed reviewer needs to approve a deployment. -* Enable **Prevent self-review** if a different person should approve the workflow initiator's deployment. Ensure another reviewer is available before enabling it. -* Under **Deployment branches and tags**, choose **Selected branches and tags** and add a branch rule for **`main`** to restrict publishing to that branch. -* If these protection options are unavailable, check GitHub's plan and repository-visibility requirements before relying on approval enforcement. -* As a PyPI project Owner, open the `hsluv` project's **Manage → Publishing** page and add a GitHub Trusted Publisher with owner **`hsluv`**, repository **`hsluv-python`**, workflow **`publish.yml`**, and environment **`pypi`**. No API token or GitHub secret is needed. - -To publish a release: - -* Update `__version__` in `hsluv.py` to an unused version, such as `5.0.5rc1` for a pre-release, and merge the change into `main` after tests pass. -* Open **Actions → Publish to PyPI → Run workflow**, select **`main`**, and click **Run workflow**. This uploads to production PyPI, including for pre-release versions; a tag or GitHub release is not required. -* If approval is required, have an eligible reviewer open the workflow run, click **Review deployments**, select **`pypi`**, and click **Approve and deploy**. -* Wait for the workflow to succeed, then verify the version on [PyPI](https://pypi.org/project/hsluv/) and install it with `python -m pip install 'hsluv==5.0.5rc1'` (substitute the version being released). -* Never reuse a published version: PyPI does not allow replacing uploaded distribution files, even after deletion. +* On GitHub, open **Settings → Environments** and create or open **`pypi`**. Leave **Required reviewers** disabled; no approval is needed. +* On PyPI, open the `hsluv` project's **Manage → Publishing** page and configure a GitHub Trusted Publisher: owner **`hsluv`**, repository **`hsluv-python`**, workflow **`publish.yml`**, environment **`pypi`**. No API token or secret is needed. +* Update `__version__` in `hsluv.py` to an unused version (e.g. `5.0.5rc1` for a pre-release) and merge into `main`. +* Open **Actions → Publish to PyPI → Run workflow**, select **`main`**, and run it. The workflow requires tests to pass before building and uploading to production PyPI. No tag or GitHub release is needed. +* Verify the release on [PyPI](https://pypi.org/project/hsluv/). Published versions cannot be reused. ## Authors From f974bd1b8ed7722f72969604a44f6120120c9b3b Mon Sep 17 00:00:00 2001 From: boronine-bot Date: Wed, 21 Oct 2026 22:57:01 +0000 Subject: [PATCH 3/6] Remove publishing environment requirement --- .github/workflows/publish.yml | 1 - README.md | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fd5f921..add6b98 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,7 +7,6 @@ concurrency: pypi-publish jobs: publish: runs-on: ubuntu-24.04 - environment: pypi permissions: contents: read id-token: write diff --git a/README.md b/README.md index 8f18b4f..8148863 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,7 @@ Run `python -m unittest discover -v`. ## Publishing to PyPI -* On GitHub, open **Settings → Environments** and create or open **`pypi`**. Leave **Required reviewers** disabled; no approval is needed. -* On PyPI, open the `hsluv` project's **Manage → Publishing** page and configure a GitHub Trusted Publisher: owner **`hsluv`**, repository **`hsluv-python`**, workflow **`publish.yml`**, environment **`pypi`**. No API token or secret is needed. +* On PyPI, open the `hsluv` project's **Manage → Publishing** page and configure a GitHub Trusted Publisher: owner **`hsluv`**, repository **`hsluv-python`**, workflow **`publish.yml`**. Leave the environment name blank (**Any**); no GitHub environment, approval, API token, or secret is needed. * Update `__version__` in `hsluv.py` to an unused version (e.g. `5.0.5rc1` for a pre-release) and merge into `main`. * Open **Actions → Publish to PyPI → Run workflow**, select **`main`**, and run it. The workflow requires tests to pass before building and uploading to production PyPI. No tag or GitHub release is needed. * Verify the release on [PyPI](https://pypi.org/project/hsluv/). Published versions cannot be reused. From 32670a2493d3050f36746a7866e9c0158d73b3c8 Mon Sep 17 00:00:00 2001 From: boronine-bot Date: Wed, 21 Oct 2026 22:59:15 +0000 Subject: [PATCH 4/6] Trim Trusted Publisher setup instructions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8148863..7435134 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Run `python -m unittest discover -v`. ## Publishing to PyPI -* On PyPI, open the `hsluv` project's **Manage → Publishing** page and configure a GitHub Trusted Publisher: owner **`hsluv`**, repository **`hsluv-python`**, workflow **`publish.yml`**. Leave the environment name blank (**Any**); no GitHub environment, approval, API token, or secret is needed. +* On PyPI, open the `hsluv` project's **Manage → Publishing** page and configure a GitHub Trusted Publisher: owner **`hsluv`**, repository **`hsluv-python`**, workflow **`publish.yml`**. * Update `__version__` in `hsluv.py` to an unused version (e.g. `5.0.5rc1` for a pre-release) and merge into `main`. * Open **Actions → Publish to PyPI → Run workflow**, select **`main`**, and run it. The workflow requires tests to pass before building and uploading to production PyPI. No tag or GitHub release is needed. * Verify the release on [PyPI](https://pypi.org/project/hsluv/). Published versions cannot be reused. From 04e1a8b566c5b55a88e2d821d2d5ef4ab1424515 Mon Sep 17 00:00:00 2001 From: boronine-bot Date: Wed, 21 Oct 2026 23:00:08 +0000 Subject: [PATCH 5/6] Document publishing from the selected branch --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7435134..b28c89b 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,8 @@ Run `python -m unittest discover -v`. ## Publishing to PyPI * On PyPI, open the `hsluv` project's **Manage → Publishing** page and configure a GitHub Trusted Publisher: owner **`hsluv`**, repository **`hsluv-python`**, workflow **`publish.yml`**. -* Update `__version__` in `hsluv.py` to an unused version (e.g. `5.0.5rc1` for a pre-release) and merge into `main`. -* Open **Actions → Publish to PyPI → Run workflow**, select **`main`**, and run it. The workflow requires tests to pass before building and uploading to production PyPI. No tag or GitHub release is needed. +* Update `__version__` in `hsluv.py` to an unused version (e.g. `5.0.5rc1` for a pre-release) and push the commit to the branch you want to publish. +* Open **Actions → Publish to PyPI → Run workflow**, select that branch, and run it. The workflow requires tests to pass before building and uploading to production PyPI. No tag or GitHub release is needed. * Verify the release on [PyPI](https://pypi.org/project/hsluv/). Published versions cannot be reused. ## Authors From 49e361b89b426231a14349af9dda04f803f246dd Mon Sep 17 00:00:00 2001 From: boronine-bot Date: Wed, 21 Oct 2026 23:08:23 +0000 Subject: [PATCH 6/6] Remove tests from publishing workflow --- .github/workflows/publish.yml | 2 -- README.md | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index add6b98..586761c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,8 +17,6 @@ jobs: - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: '3.11' - - name: Run tests - run: python -m unittest discover -v - run: python -m pip install build twine - name: Build and check distributions run: | diff --git a/README.md b/README.md index b28c89b..8eaa5a0 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Run `python -m unittest discover -v`. * On PyPI, open the `hsluv` project's **Manage → Publishing** page and configure a GitHub Trusted Publisher: owner **`hsluv`**, repository **`hsluv-python`**, workflow **`publish.yml`**. * Update `__version__` in `hsluv.py` to an unused version (e.g. `5.0.5rc1` for a pre-release) and push the commit to the branch you want to publish. -* Open **Actions → Publish to PyPI → Run workflow**, select that branch, and run it. The workflow requires tests to pass before building and uploading to production PyPI. No tag or GitHub release is needed. +* Open **Actions → Publish to PyPI → Run workflow**, select that branch, and run it to build and upload to production PyPI. No tag or GitHub release is needed. * Verify the release on [PyPI](https://pypi.org/project/hsluv/). Published versions cannot be reused. ## Authors