Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/publish_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -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
33 changes: 33 additions & 0 deletions .github/publish_to_test_pypi.yml
Original file line number Diff line number Diff line change
@@ -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/
6 changes: 5 additions & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -121,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.
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,17 @@ 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",
"bump2version",
]
examples = ["jupyterlab"]
all = ["electrolyzer[develop,examples]"]
Expand Down
19 changes: 0 additions & 19 deletions requirements.txt

This file was deleted.