From 4cb09cd69e0dc3aada4a3e1914760b31d0b40141 Mon Sep 17 00:00:00 2001 From: "Hammond, Rob" <13874373+RHammond2@users.noreply.github.com> Date: Thu, 26 Feb 2026 12:46:34 -0800 Subject: [PATCH 1/6] add pypi and test-pypi publishers --- .github/publish_to_pypi.yml | 31 ++++++++++++++++++++++++++++++ .github/publish_to_test_pypi.yml | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/publish_to_pypi.yml create mode 100644 .github/publish_to_test_pypi.yml diff --git a/.github/publish_to_pypi.yml b/.github/publish_to_pypi.yml new file mode 100644 index 0000000..341b4e0 --- /dev/null +++ b/.github/publish_to_pypi.yml @@ -0,0 +1,31 @@ +name: Upload to PyPi + +on: + release: + types: [published] + +jobs: + deploy: + runs-on: ubuntu-latest + if: github.event.action == 'published' + environment: + name: pypi-publishing + url: https://pypi.org/p/electrolyzer + permissions: + id-token: write + steps: + - uses: actions/checkout@v6 + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: 3.13 + - name: Build package + run: | + python -m pip install --upgrade pip + pip install setuptools build wheel twine + python -m build + twine check --strict dist/* + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verbose: True diff --git a/.github/publish_to_test_pypi.yml b/.github/publish_to_test_pypi.yml new file mode 100644 index 0000000..cd5e8f8 --- /dev/null +++ b/.github/publish_to_test_pypi.yml @@ -0,0 +1,33 @@ +name: Upload to Test PyPi + +on: + push: + tags: + - 'v*' + +jobs: + deploy: + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + environment: + name: pypi-publishing + url: https://test.pypi.org/p/electrolyzer + permissions: + id-token: write + steps: + - uses: actions/checkout@v6 + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: 3.13 + - name: Build package + run: | + python -m pip install --upgrade pip + pip install setuptools build wheel twine + python -m build + twine check --strict dist/* + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verbose: True + repository-url: https://test.pypi.org/legacy/ From 865cf6b84eb0821e4a510c019a19e664f0dacbe0 Mon Sep 17 00:00:00 2001 From: "Hammond, Rob" <13874373+RHammond2@users.noreply.github.com> Date: Thu, 26 Feb 2026 12:46:49 -0800 Subject: [PATCH 2/6] slight reorg of pyproject.toml --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5ecffd2..7d4831e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,16 +39,16 @@ classifiers = [ [project.optional-dependencies] develop = [ + "pre-commit", "pytest", + "pytest_mock", "pytest-subtests", "pytest-dependency", - "pre-commit", - "pytest_mock", "responses", - "jupyter-book", - "readthedocs-sphinx-ext", "Sphinx", + "jupyter-book", "sphinxcontrib-napoleon", + "readthedocs-sphinx-ext", ] examples = ["jupyterlab"] all = ["electrolyzer[develop,examples]"] From 175b62902d85c9c5cefc1e46da6c908e9ddd6fb3 Mon Sep 17 00:00:00 2001 From: "Hammond, Rob" <13874373+RHammond2@users.noreply.github.com> Date: Thu, 26 Feb 2026 12:47:17 -0800 Subject: [PATCH 3/6] remove redundant requirements file --- requirements.txt | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 9904cb3..0000000 --- a/requirements.txt +++ /dev/null @@ -1,19 +0,0 @@ -# Requirements for Electrolyzer - -# Prod -numpy -scipy -pandas -matplotlib -rainflow -attrs -jsonschema -ruamel.yaml - -# Dev -pytest -pytest_mock -pre-commit - -# Examples -ipykernel From 5a2be4ac427f9eeabcbc7315baccde060d815733 Mon Sep 17 00:00:00 2001 From: "Hammond, Rob" <13874373+RHammond2@users.noreply.github.com> Date: Thu, 26 Feb 2026 12:57:34 -0800 Subject: [PATCH 4/6] remove requirements reference --- CONTRIBUTING.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index e0e2e5d..940e16b 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -69,7 +69,6 @@ Ready to contribute? Here's how to set up ``electrolyzer`` for local development $ cd electrolyzer $ python -m venv env $ source env/bin/activate - $ pip install -r requirements.txt $ pip install -e . $ pre-commit install From fa3c3424ee0a6fab144ef7db0790e454604ac742 Mon Sep 17 00:00:00 2001 From: "Hammond, Rob" <13874373+RHammond2@users.noreply.github.com> Date: Thu, 26 Feb 2026 13:01:18 -0800 Subject: [PATCH 5/6] add release note for updated process --- CONTRIBUTING.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 940e16b..4b5ca98 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -120,3 +120,8 @@ Then run:: $ bump2version patch # possible: major / minor / patch $ git push $ git push --tags + +This will trigger the publishing to Test PyPI. If the action runs unsucessfully, then +delete the tag from local and remote, restore the old version number, fix the issue, and +try again. If the action runs successfully, then simply create the release on the github +to trigger the publishing to PyPI. From 043ce887d9bcec4a06bc528d53c583762d955742 Mon Sep 17 00:00:00 2001 From: "Hammond, Rob" <13874373+RHammond2@users.noreply.github.com> Date: Thu, 26 Feb 2026 13:06:28 -0800 Subject: [PATCH 6/6] add missing bump2version dependency --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 7d4831e..531c271 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,6 +49,7 @@ develop = [ "jupyter-book", "sphinxcontrib-napoleon", "readthedocs-sphinx-ext", + "bump2version", ] examples = ["jupyterlab"] all = ["electrolyzer[develop,examples]"]