Skip to content

The open-source agent harness - the runtime layer that turns an LLM into a working agent.

Remove the temporary PyPI 0.1.3 bootstrap from publish-python (#731)

Bhavesh Patela2f46ee5ebc9
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index e31b55f13..fcfb4187f 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -265,14 +265,11 @@ jobs:
- name: Install build tools
run: python -m pip install --upgrade pip build packaging
- - name: Plan PyPI versions
+ - name: Read version and skip if published
id: version
working-directory: python/trueforge_sdk
run: |
set -euo pipefail
- pypi_code() {
- curl -sS -L -o /dev/null -w '%{http_code}' "https://pypi.org/pypi/trueforge-sdk/${1}/json"
- }
VERSION="$(python3 -c '
import re, pathlib
from packaging.version import Version
@@ -283,8 +280,7 @@ jobs:
print(Version(match.group(1)))
')"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
-
- code="$(pypi_code "$VERSION")"
+ code="$(curl -sS -L -o /dev/null -w '%{http_code}' "https://pypi.org/pypi/trueforge-sdk/${VERSION}/json")"
if [[ "$code" == "200" ]]; then
echo "already=true" >> "$GITHUB_OUTPUT"
echo "trueforge-sdk==$VERSION already on PyPI; skipping"
@@ -295,59 +291,10 @@ jobs:
exit 1
fi
- # Remove this 0.1.3 bootstrap block in a follow-up PR.
- # HTTP 200 means 0.1.3 is already on PyPI, so later rc publishes skip it.
- # HTTP 404 when the current version is not 0.1.3 means this is the first
- # upload: we publish 0.1.3 so pip does not install the 0.0.0 placeholder.
- # HTTP 404 when the current version is already 0.1.3 means the normal
- # publish step will upload it, so we must not build it twice.
- bootstrap_code="$(pypi_code "0.1.3")"
- if [[ "$bootstrap_code" == "200" ]]; then
- echo "bootstrap=false" >> "$GITHUB_OUTPUT"
- elif [[ "$bootstrap_code" == "404" && "$VERSION" != "0.1.3" ]]; then
- echo "bootstrap=true" >> "$GITHUB_OUTPUT"
- echo "trueforge-sdk==0.1.3 missing; will upload before $VERSION"
- elif [[ "$bootstrap_code" == "404" ]]; then
- echo "bootstrap=false" >> "$GITHUB_OUTPUT"
- else
- echo "Unexpected PyPI response HTTP $bootstrap_code for trueforge-sdk==0.1.3" >&2
- exit 1
- fi
-
- # Remove this 0.1.3 bootstrap block in a follow-up PR.
- # Rewrite pyproject.toml to version 0.1.3, build that wheel from today's
- # tree, then restore pyproject.toml so the next step can publish the real
- # rc (for example 0.2.0rc5).
- - name: Build 0.1.3 bootstrap
- if: steps.version.outputs.bootstrap == 'true'
- working-directory: python/trueforge_sdk
- run: |
- set -euo pipefail
- python3 -c '
- import re
- from pathlib import Path
- path = Path("pyproject.toml")
- text = path.read_text()
- next_text, count = re.subn(r"(?m)^version\s*=\s*\"[^\"]+\"", "version = \"0.1.3\"", text, count=1)
- if count != 1:
- raise SystemExit("python/trueforge_sdk/pyproject.toml is missing version = \"…\"")
- path.write_text(next_text)
- '
- python -m build --outdir dist-bootstrap
- git checkout -- pyproject.toml
-
- - name: Publish 0.1.3 bootstrap
- if: steps.version.outputs.bootstrap == 'true'
- uses: pypa/gh-action-pypi-publish@release/v1
- with:
- packages-dir: python/trueforge_sdk/dist-bootstrap
-
- name: Build distributions
if: steps.version.outputs.already == 'false'
working-directory: python/trueforge_sdk
- run: |
- set -euo pipefail
- python -m build
+ run: python -m build
- name: Publish to PyPI
if: steps.version.outputs.already == 'false'
diff --git a/RELEASING.md b/RELEASING.md
index abb35adf5..b52b2b6ae 100644
--- a/RELEASING.md
+++ b/RELEASING.md
@@ -105,8 +105,6 @@ the source repo and commit on npmjs.com.
pending/trusted publisher before the first OIDC upload succeeds.
- Import and `pyproject.toml` name stay `trueforge_sdk` (what we upload); install with `pip install trueforge-sdk`.
-> Note: if PyPI has no `0.1.3`, the first publish also uploads `0.1.3` (so default pip is not the `0.0.0` placeholder), then the current `pyproject.toml` version. Delete that bootstrap code in a follow-up PR.
-
## Local without publishing
```bash