Add TestPyPI publish workflow (Phase 5a dry-run) - #1212
Closed
Shi-Dong wants to merge 4 commits into
Closed
Conversation
Contributor
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
This was referenced May 27, 2026
Shi-Dong
marked this pull request as ready for review
May 28, 2026 06:50
Shi-Dong
force-pushed
the
shi/phase4-extras-require-inventory
branch
from
May 30, 2026 08:17
f9c1820 to
a458463
Compare
Shi-Dong
force-pushed
the
shi/phase5a-testpypi-dry-run
branch
from
May 30, 2026 08:17
918d208 to
e0d7275
Compare
Shi-Dong
force-pushed
the
shi/phase4-extras-require-inventory
branch
from
June 1, 2026 16:12
a458463 to
ef8c861
Compare
Shi-Dong
force-pushed
the
shi/phase5a-testpypi-dry-run
branch
2 times, most recently
from
June 2, 2026 04:40
497d427 to
a1a7f8c
Compare
Shi-Dong
force-pushed
the
shi/phase4-extras-require-inventory
branch
from
June 2, 2026 04:40
ef8c861 to
51fee7e
Compare
Shi-Dong
force-pushed
the
shi/phase5a-testpypi-dry-run
branch
from
June 2, 2026 09:07
a1a7f8c to
efa3b43
Compare
Shi-Dong
force-pushed
the
shi/phase4-extras-require-inventory
branch
from
June 2, 2026 09:07
51fee7e to
518d340
Compare
Shi-Dong
force-pushed
the
shi/phase5a-testpypi-dry-run
branch
from
June 3, 2026 15:02
efa3b43 to
b61e5ab
Compare
Shi-Dong
force-pushed
the
shi/phase4-extras-require-inventory
branch
from
June 3, 2026 15:02
518d340 to
6ee0b3f
Compare
… 5a)
Phase 5a of the `pip install miles` roadmap: validate the wheel-build
plus index-publish pipeline against TestPyPI before committing to a
production index host (private vs. PyPI proper).
The new workflow `.github/workflows/publish-testpypi.yml` is manual-only
(workflow_dispatch). On invocation it:
1. Checks out miles + submodules.
2. Rewrites the submodule's pyproject.toml to use a Radixark-namespaced
placeholder name (radixark-sglang-test / radixark-megatron-test) and
a PEP 440 dev-release version (0.0.0.devYYYYMMDDHHMMSS).
3. Builds a wheel + sdist via `python -m build`.
4. (Unless dry_run=true) Uploads to https://test.pypi.org/ using a
TEST_PYPI_API_TOKEN secret, then `pip install`s it into a fresh
venv as a smoke check.
The dry_run input lets you validate the build step before you have a
TestPyPI account / token configured. Once the secret is set, leave it
unchecked and the workflow does the full upload + smoke install.
What this PR explicitly does NOT do:
- It does NOT commit to a long-term index host. TestPyPI is ephemeral
(packages can be purged at any time, dependency resolution doesn't
happen there) — this is purely a CI dry-run.
- It does NOT touch the existing Docker / training paths. The image
still installs sglang + Megatron-LM via COPY-from-submodule.
- It does NOT populate miles' extras_require slots with the new
wheel names. That's Phase 6, after we pick the real index.
workflow_dispatch requires the workflow file on the default branch, so add a temporary push trigger on the feature branch that auto-fires a dry-run when the workflow file changes. Wire inputs through env vars so the same workflow body works on both push (defaults: package=sglang, dry_run=true) and workflow_dispatch.
Previous smoke install used --extra-index-url https://test.pypi.org/simple/ alongside --index-url https://pypi.org/simple/, so pip resolved transitive deps from BOTH indexes. TestPyPI is a public sandbox with name-squat packages (e.g. an unrelated FASTAPI-1.0 squatting on fastapi case-insensitively), and pip happily downloaded the squatter, which then failed to build its sdist. The wheel upload itself succeeded; only the dep-resolution smoke tripped on TestPyPI hazards. Switch to --index-url https://test.pypi.org/simple/ --no-deps. Our smoke check only needs to prove the wheel we just published is fetchable and installable — transitive dep resolution from a sandbox is neither safe nor necessary.
twine upload reports success the moment the upload finishes, but TestPyPI is eventually consistent. The simple-index can take 30-120s to surface a new release, during which pip install --no-deps fails with No matching distribution found. Add a polling step that waits for the new version to appear (up to 5 min) before attempting the install.
Shi-Dong
force-pushed
the
shi/phase4-extras-require-inventory
branch
from
June 4, 2026 13:10
6ee0b3f to
db6b4d4
Compare
Shi-Dong
force-pushed
the
shi/phase5a-testpypi-dry-run
branch
from
June 4, 2026 13:10
b61e5ab to
0317549
Compare
Contributor
Author
|
Closing as obsolete. This PR is superseded by a thin packaging slice cut fresh off current `main`:
Why this one is no longer needed: see the per-PR note below. The branch is left in place; nothing is lost. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.github/workflows/publish-testpypi.yml: manual-only workflow that builds a wheel fromthird_party/sglang/pythonorthird_party/Megatron-LM, rewrites the pyproject.toml to use a Radixark-namespaced placeholder name + a PEP 440 dev-release version, and uploads to TestPyPI.dry_runinput so the build step can be validated before TestPyPI credentials are configured.pip install --index-url https://pypi.org/simple/ --extra-index-url https://test.pypi.org/simple/ radixark-sglang-test==<dev-version>) so a green run is end-to-end evidence the publish pipeline works.Why
Phase 5a of the
pip install milesroadmap: validate the wheel-build + index-publish pipeline against TestPyPI before committing to a production index host (private index vs. PyPI proper). TestPyPI is the right tool for this because:twine upload,pip install, the whole flow gets exercised.Once this PR is green, the same workflow can be retargeted to whatever production index we pick (private CodeArtifact / GitHub Packages / real PyPI) by changing the
--repositoryflag and the secret name. Phase 5b is "pick the real index"; this PR is "prove the publish workflow is sound."Setup required to run with
dry_run=falseOnce you're ready to actually upload to TestPyPI:
TEST_PYPI_API_TOKENat https://github.com/radixark/miles/settings/secrets/actions.These instructions are also in the workflow file's header comment.
Test plan
gh workflow run publish-testpypi.yml --ref shi/phase5a-testpypi-dry-run -f package=sglang -f dry_run=true— should build wheel + sdist successfully without needing a token. (I'll fire this immediately after the PR opens.)TEST_PYPI_API_TOKENsecret is configured, re-trigger withdry_run=false. Wheel should upload to TestPyPI and the smoke install should pull it back into a fresh venv.package=megatron-lmto validate Megatron-LM follows the same path.What this PR explicitly does NOT do
extras_requireslots (Phase 6 — gated on picking the real index).Stacked on
radixark/miles PR #1196 (Phase 4: empty extras_require slots).