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
26 changes: 10 additions & 16 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,20 @@ on:

jobs:
build-and-upload:
name: Build and upload release to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write

steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Python 3.13
uses: actions/setup-python@v6
- uses: astral-sh/setup-uv@v6
with:
python-version: '3.13'
cache: 'pip'
cache-dependency-path: 'requirements/publish.txt'
- name: Install dependencies
run: python -m pip install -r requirements/publish.txt
- name: Build sdist and wheel
run: python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m twine check --strict dist/*
python -m twine upload dist/*
version: "0.9.7"
- name: Build package
run: uv build
- name: Publish package
run: uv publish
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Python bytecode
*.pyc
__pycache__/

# Coverage database
.coverage

# Build and distribution
/dist/
/src/*.egg-info/
19 changes: 19 additions & 0 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,22 @@ From the root directory of the repository:
- Run `uv run coverage run` to execute the test suite under coverage.
- Run `uvx ruff check` for linting checks.
- Run `uvx ruff format` to format the code.

## Making a release

There's a GitHub Actions workflow that will automatically publish a release to
PyPI when a GitHub release is created.

Steps to make a release:

- Bump the version number in the `pyproject.toml` file if necessary, for example using
`uv version --bump minor` for a minor release. (Note: this also updates the lockfile.)
Make a PR for the version bump.
- Ensure that the lockfile has been updated. (Not necessary if you used `uv version`.)
- Prepare release notes in a (temporary) markdown file.
- Tag the release commit with an annotated tag matching the version (e.g. `git tag -a
2.3.4`); include the prepared release notes in the commit message body.
- Go to the GitHub releases page: https://github.com/mdickinson/simplefractions/releases
- Create a new release, using the previously prepared release notes.
- Double-check that the release workflow succeeded and that the new release is present
on PyPI at https://pypi.org/project/simplefractions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "uv_build"

[project]
name = 'simplefractions'
version = '1.4.0'
version = "1.4.0"
description = 'Find the simplest fraction for a given float or interval'
readme = 'README.md'
requires-python = '>=3.10'
Expand Down
2 changes: 0 additions & 2 deletions requirements/publish.txt

This file was deleted.