Skip to content

Commit 6ffbffc

Browse files
committed
hot-fix for pypi minor release pub error
1 parent a72eade commit 6ffbffc

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

‎.github/workflows/publish-python.yml‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,45 @@ jobs:
2222
- name: Build package
2323
run: |
2424
python -m pip install --upgrade pip build twine
25+
rm -rf dist build *.egg-info
2526
python -m build
2627
python -m twine check dist/*
2728
29+
- name: Verify built artifact versions
30+
run: |
31+
python - <<'PY'
32+
from pathlib import Path
33+
import tomllib
34+
35+
version = tomllib.loads(Path("pyproject.toml").read_text(encoding="utf-8"))["project"]["version"]
36+
dist = sorted(Path("dist").glob("*"))
37+
if not dist:
38+
raise SystemExit("No build artifacts found in dist/")
39+
40+
names = [path.name for path in dist]
41+
expected = {
42+
f"vcf_rdfizer-{version}.tar.gz",
43+
f"vcf_rdfizer-{version}-py3-none-any.whl",
44+
}
45+
missing = sorted(expected.difference(names))
46+
if missing:
47+
raise SystemExit(
48+
f"Built artifacts do not match project version {version}; missing: {', '.join(missing)}"
49+
)
50+
51+
unexpected = sorted(
52+
name for name in names if name.startswith("vcf_rdfizer-") and f"vcf_rdfizer-{version}" not in name
53+
)
54+
if unexpected:
55+
raise SystemExit(
56+
f"Found stale artifacts in dist/: {', '.join(unexpected)}"
57+
)
58+
59+
print("Verified build artifacts:")
60+
for name in names:
61+
print(f" {name}")
62+
PY
63+
2864
- name: Upload artifacts
2965
uses: actions/upload-artifact@v4
3066
with:

‎scripts/release.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ def main() -> int:
133133
print(f" git tag -a {tag} -m \"VCF-RDFizer {tag}\"")
134134
print(" git push origin main")
135135
print(f" git push origin {tag}")
136+
print(" # Before building locally for upload, clean old artifacts:")
137+
print(" rm -rf dist build *.egg-info")
138+
print(" python -m build")
139+
print(" python -m twine check dist/*")
136140

137141
return 0
138142

0 commit comments

Comments
 (0)