Skip to content

Commit c2202fd

Browse files
committed
Add sidpy-mcp release packaging check
1 parent 5845fe4 commit c2202fd

2 files changed

Lines changed: 31 additions & 5 deletions

File tree

.github/workflows/actions.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,30 @@ jobs:
9595
run: |
9696
pip install wheel twine
9797
python setup.py sdist bdist_wheel
98+
python - <<'PY'
99+
import pathlib
100+
import zipfile
101+
102+
wheel_paths = sorted(pathlib.Path("dist").glob("*.whl"))
103+
if not wheel_paths:
104+
raise SystemExit("No wheel was built in dist/")
105+
106+
wheel_path = wheel_paths[-1]
107+
with zipfile.ZipFile(wheel_path) as archive:
108+
entry_points = [
109+
name for name in archive.namelist()
110+
if name.endswith("entry_points.txt")
111+
]
112+
if not entry_points:
113+
raise SystemExit(f"{wheel_path.name} is missing entry_points.txt")
114+
115+
contents = archive.read(entry_points[0]).decode()
116+
expected = "sidpy-mcp = sidpy.proc.mcp_server_beps:main"
117+
if expected not in contents:
118+
raise SystemExit(
119+
f"{wheel_path.name} does not declare the sidpy-mcp console script"
120+
)
121+
122+
print(f"Verified {wheel_path.name} includes sidpy-mcp")
123+
PY
98124
twine upload --username "__token__" --password $PYPI_TOKEN_PASSWORD dist/*

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@
8989
# To provide executable scripts, use entry points in preference to the
9090
# "scripts" keyword. Entry points provide cross-platform support and allow
9191
# pip to create the appropriate form of executable for the target platform.
92-
# entry_points={
93-
# 'console_scripts': [
94-
# 'sample=sample:main',
95-
# ],
96-
# },
92+
entry_points={
93+
'console_scripts': [
94+
'sidpy-mcp=sidpy.proc.mcp_server_beps:main',
95+
],
96+
},
9797
)

0 commit comments

Comments
 (0)