From 27077a0e618ab8361470d7ad5b0f596447778957 Mon Sep 17 00:00:00 2001 From: Patrick Totzke Date: Wed, 25 Nov 2026 13:44:56 +0000 Subject: [PATCH] Publish releases to PyPI A published GitHub release builds the sdist and wheel and uploads them with PyPI Trusted Publishing. The installation docs describe installing from PyPI with pipx, taking the compiled bindings from the distribution, and name the notmuch2 bindings alot uses on Debian and Fedora. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01TR9KjabaVCyHnpqp2kQZHC --- .github/workflows/publish.yml | 52 +++++++++++++++++++++++++++++++++++ docs/source/installation.rst | 21 ++++++++++++-- 2 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..c1a70e3f1 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,52 @@ +name: Publish to PyPI + +# Uploads with PyPI Trusted Publishing, so no API token is stored here. +# PyPI accepts only this file name (publish.yml) from pazz/alot. +# Release by publishing a GitHub release for a version tag; setuptools-scm +# takes the version from that tag. + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Build sdist and wheel + run: | + python3 -m pip install build + python3 -m build + + - name: Check the version is the release tag + env: + TAG: ${{ github.ref_name }} + run: test -f "dist/alot-${TAG#v}.tar.gz" + + - uses: actions/upload-artifact@v7 + with: + name: dist + path: dist/ + + publish: + needs: build + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v8 + with: + name: dist + path: dist/ + + - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/docs/source/installation.rst b/docs/source/installation.rst index f002e8fc7..16ad0965e 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -36,16 +36,33 @@ A full list of dependencies is below: On Debian/Ubuntu these are packaged as:: - python3-setuptools python3-magic python3-configobj python3-notmuch python3-urwid python3-urwidtrees python3-gpg python3-dev swig + python3-setuptools python3-magic python3-configobj python3-notmuch2 python3-urwid python3-urwidtrees python3-gpg python3-dev swig On Fedora/Redhat these are packaged as:: - python-setuptools python-magic python-configobj python-notmuch python-urwid python-urwidtrees python-gpg + python-setuptools python-magic python-configobj python-notmuch2 python-urwid python-urwidtrees python-gpg Distributions may package an older urwidtrees than alot needs; if so, install urwidtrees from PyPI instead. +From version 0.13 on, releases are published on +`PyPI `_. +The bindings for notmuch and gpg are compiled against the system libraries, +so take them from your distribution and install alot with +`pipx `_, letting it see the system packages. +On Debian/Ubuntu:: + + sudo apt install pipx python3-notmuch2 python3-gpg python3-magic + PIPX_DEFAULT_BACKEND=pip pipx install --system-site-packages alot + +The other dependencies are then installed from PyPI if the system lacks +them or has too old a version. +(The backend setting matters only if `uv`_ is installed: in that case pipx then uses it instead of pip by default, and uv tries +to build gpg from source instead of using the system's bindings.) + + + To set up and install the latest development version:: git clone https://github.com/pazz/alot