From be9c76cd6a14a8572b055a622ab7faa4db52b2c9 Mon Sep 17 00:00:00 2001 From: Chris Mitchell Date: Mon, 10 Aug 2026 13:33:01 +1200 Subject: [PATCH 1/2] [PETOSS-980] Fix twine install escaping the venv in publish workflow sudo pip install twine ran outside the activated venv and tried to upgrade the system's apt-installed packaging package, which has no pip RECORD metadata and can't be uninstalled, failing the Install dependencies step. Install twine via the venv's pip instead. --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6ea5b553..4ab00a7f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,7 +34,7 @@ jobs: python -m venv venv source venv/bin/activate pip install --upgrade pip - sudo pip install twine + pip install twine working-directory: xero-python - name: Fetch Latest release number From b4ec6aa0b96fabffc1b00ce2db5f0b468f50806d Mon Sep 17 00:00:00 2001 From: Chris Mitchell Date: Mon, 10 Aug 2026 13:54:10 +1200 Subject: [PATCH 2/2] [PETOSS-980] Persist venv on PATH so twine resolves in later steps Each workflow run: block is a fresh shell, so the venv activated in Install dependencies didn't carry over to the Publish to PyPi step. Append the venv's bin dir to GITHUB_PATH so twine keeps resolving there without needing to escape the venv via sudo. Verified locally with act (catthehacker/ubuntu:act-latest, which has the same apt-installed python3-packaging 24.0 as the real runner): the old sudo pip install step fails the same way, the new step installs twine cleanly inside the venv, twine --version resolves correctly in a later step with no venv activation, and the apt packaging package is left untouched. --- .github/workflows/publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4ab00a7f..9335c48f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,6 +35,7 @@ jobs: source venv/bin/activate pip install --upgrade pip pip install twine + echo "$PWD/venv/bin" >> "$GITHUB_PATH" working-directory: xero-python - name: Fetch Latest release number