Skip to content

Commit 5235658

Browse files
committed
chore: remove duplicate .keep files for pypi publish step fix
1 parent 5ed0e5f commit 5235658

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ jobs:
9999
100100
cp "_stagehand/packages/server/dist/sea/${{ matrix.binary_name }}" "${{ matrix.output_path }}"
101101
chmod +x "${{ matrix.output_path }}" 2>/dev/null || true
102+
rm -f src/stagehand/_sea/.keep || true
102103
git add -f src/stagehand/_sea/*
103104
104105
- name: Build wheel
@@ -112,13 +113,24 @@ jobs:
112113
echo "Contents of src/stagehand/_sea/"
113114
ls -al src/stagehand/_sea || true
114115
python - <<'PY'
115-
import pathlib, zipfile
116+
import pathlib, zipfile, collections, sys
117+
had_error = False
116118
for wheel in sorted(pathlib.Path("dist").glob("*.whl")):
117119
print(f"Contents of {wheel.name} entries matching stagehand/_sea")
118120
with zipfile.ZipFile(wheel, "r") as zf:
121+
names = [info.filename for info in zf.infolist()]
122+
counts = collections.Counter(names)
123+
dups = sorted([name for name, n in counts.items() if n > 1])
119124
for info in zf.infolist():
120125
if "stagehand/_sea/" in info.filename:
121126
print(info.filename)
127+
if dups:
128+
had_error = True
129+
print("ERROR: duplicate zip entries detected:")
130+
for name in dups:
131+
print(f" {counts[name]}x {name}")
132+
if had_error:
133+
sys.exit(1)
122134
PY
123135
124136
- name: Upload wheel artifact

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ path = "hatch_build.py"
9191

9292
[tool.hatch.build.targets.wheel]
9393
packages = ["src/stagehand"]
94-
include = [
95-
"src/stagehand/_sea/*"
94+
exclude = [
95+
"src/stagehand/_sea/.keep"
9696
]
97+
9798
[tool.hatch.build.targets.wheel.force-include]
9899
"src/stagehand/_sea" = "stagehand/_sea"
99100

0 commit comments

Comments
 (0)