Skip to content

Commit 8470ca9

Browse files
committed
ci(py): publish pure-Python dotpromptz-handlebars wheel
- Move release-please configuration from python/handlebarrz to python/handlebars with release-as: 0.2.0. - Rewrite publish_python_handlebarrz_package.yml to build a single py3-none-any pure-Python wheel and sdist, dropping the 15-target multi-arch Rust build matrix. - Add PyPI smoke test verifying clean installation and import across Python 3.10-3.14. - Delete smoke-test-wheels.yml. - Update dotpromptz publish workflow with a floor check requiring dotpromptz-handlebars>=0.2.0 on PyPI before publishing.
1 parent 6281ac6 commit 8470ca9

6 files changed

Lines changed: 99 additions & 1128 deletions

‎.github/workflows/publish_python_dotpromptz_package.yml‎

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -62,39 +62,35 @@ jobs:
6262
with:
6363
python-version: ${{ matrix.python-version }}
6464

65-
# Dependency Check of handlebars
66-
- name: Install Dependencies for Check
67-
run: pip install requests
68-
69-
- name: Smoke Test - Check handlebarrz Dependency on PyPI
70-
id: check_dependency
71-
run: |
72-
IS_FOUND=$(python -c '
73-
import requests
74-
url = "https://pypi.org/project/dotpromptz-handlebars/json"
75-
response = requests.get(url)
76-
77-
if response.status_code == 200:
78-
print("true")
79-
else:
80-
print("false")
81-
')
82-
83-
echo "Dependency 'handlebarrz' checked. Status: $IS_FOUND"
84-
85-
if [ "$IS_FOUND" = "true" ]; then
86-
echo "BUILD_SUCCESS=true" >> "$GITHUB_OUTPUT"
87-
else
88-
echo "BUILD_SUCCESS=false" >> "$GITHUB_OUTPUT"
89-
fi
90-
91-
- name: Dependency Check Failed - Exit
92-
if: steps.check_dependency.outputs.BUILD_SUCCESS == 'false'
65+
# dotpromptz pins a floor on dotpromptz-handlebars. Publishing before
66+
# that floor exists on PyPI makes dotpromptz uninstallable.
67+
- name: Check dotpromptz-handlebars floor is on PyPI
9368
run: |
94-
echo "::error::Dependency 'handlebarrz' not found on PyPI. Aborting publish."
95-
exit 1
69+
python - <<'EOF'
70+
import re
71+
import sys
72+
import tomllib
73+
import urllib.error
74+
import urllib.request
75+
76+
with open('python/dotpromptz/pyproject.toml', 'rb') as f:
77+
deps = tomllib.load(f)['project']['dependencies']
78+
spec = next((d for d in deps if d.startswith('dotpromptz-handlebars')), None)
79+
m = re.fullmatch(r'dotpromptz-handlebars\s*>=\s*([0-9][0-9A-Za-z.]*)', spec or '')
80+
if not m:
81+
print(f'::error::Expected dotpromptz-handlebars>=X.Y.Z, got {spec!r}.')
82+
sys.exit(1)
83+
floor = m.group(1)
84+
url = f'https://pypi.org/pypi/dotpromptz-handlebars/{floor}/json'
85+
try:
86+
urllib.request.urlopen(url, timeout=30)
87+
except urllib.error.HTTPError as e:
88+
print(f'::error::dotpromptz-handlebars {floor} not on PyPI ({e.code}). Release it first.')
89+
sys.exit(1)
90+
print(f'dotpromptz-handlebars {floor} is on PyPI.')
91+
EOF
9692
97-
# BUILD dotpromptz (Only if handlebarrz check passed)
93+
# BUILD dotpromptz (only if the dependency check passed)
9894
- name: Set up uv and Create VENV
9995
uses: astral-sh/setup-uv@v7
10096
with:

0 commit comments

Comments
 (0)