Add PyPI metadata + bump to miles-rl 0.0.2 - #1238
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the package configuration by defensively including README.md and LICENSE in MANIFEST.in, and enriching the metadata in setup.py (including adding a long description read from README.md). A review comment suggests adding a fallback check for the existence of README.md in setup.py to prevent a FileNotFoundError during packaging in environments where the file might be missing.
| def _read_long_description(): | ||
| """Return the README contents so PyPI renders the project page.""" | ||
| from pathlib import Path | ||
| return Path(__file__).parent.joinpath("README.md").read_text(encoding="utf-8") |
There was a problem hiding this comment.
If setup.py is executed in an environment where README.md is missing (for example, in some automated build/packaging pipelines or environments where only setup.py is parsed), Path.read_text() will raise a FileNotFoundError and crash the setup process. It is safer to check if the file exists and fallback to an empty string.
| def _read_long_description(): | |
| """Return the README contents so PyPI renders the project page.""" | |
| from pathlib import Path | |
| return Path(__file__).parent.joinpath("README.md").read_text(encoding="utf-8") | |
| def _read_long_description(): | |
| """Return the README contents so PyPI renders the project page.""" | |
| from pathlib import Path | |
| readme_path = Path(__file__).parent.joinpath("README.md") | |
| return readme_path.read_text(encoding="utf-8") if readme_path.exists() else "" |
7aaf8d4 to
9a66871
Compare
1dae6b5 to
a8d2453
Compare
9a66871 to
9ef42e9
Compare
1493b2e to
eb4ba7c
Compare
1e4511e to
335b60f
Compare
177752c to
aa7b3f5
Compare
335b60f to
a0afd1f
Compare
PyPI metadata is locked per uploaded version. The 0.0.1 release had no summary, description, project URLs, license, or author email, so https://pypi.org/project/miles-rl/ was rendering a near-empty page. PyPI shows the LATEST releases metadata on the project page, so cutting 0.0.2 with full metadata fixes the project page going forward. Changes to setup.py: add description, long_description (the existing README.md), long_description_content_type=text/markdown, url, project_urls (Source, Documentation, Issues), license=Apache-2.0 + license_files, author + author_email, keywords. Bump version 0.0.1 -> 0.0.2. MANIFEST.in: defensively include README.md and LICENSE so they ship in both the sdist and the wheel (setuptools embeds long_description into the wheel METADATA already, but the explicit include is harmless and protects the sdist).
aa7b3f5 to
d5499b6
Compare
|
Superseded. Replaced by a thin packaging slice cut fresh off current `main`:
This branch was 457 commits behind `main` and its submodule pin for sglang was 2831 commits stale and no longer an ancestor of `sglang-miles`. Rebasing it would also have resurrected the `examples/experimental/swe-agent` submodules that #1918 deliberately deleted. The branch is left in place; nothing is lost. |
ci-image-tag: dev-phase2-test-v2
Summary
setup.pyversionto0.0.2.description,long_description(from README.md),long_description_content_type,url,project_urls(Source / Documentation / Issues),license="Apache-2.0"(withlicense_files=("LICENSE",)),author,author_email,keywords.include README.md LICENSEinMANIFEST.inso they ship in both sdist and wheel.Why
PyPI metadata is locked per uploaded version — it can't be edited after upload. miles-rl 0.0.1 went up with empty
summary/description/home_page/license/ etc., so https://pypi.org/project/miles-rl/ shows a near-empty project page. PyPI displays the latest release's metadata on the project page, so cutting 0.0.2 with full metadata fixes it going forward.Test plan
python3 -m astparses setup.py cleanly.publish-pypi.ymlworkflow_dispatch withdry_run=falseon this branch → uploadsmiles-rl==0.0.2via OIDC, polls PyPI index, smoke-installs in a fresh venv.Stacked on
radixark/miles PR #1231 (Phase 7 publish workflow).
What this PR explicitly does NOT do
setup.pyandMANIFEST.in.extras_require["gpu"]— that's separate work.publish-pypi.ymlworkflow (only triggers it).