Skip to content

[BugFix] Restore torchrl-nightly PyPI uploads - #3844

Merged
vmoens merged 1 commit into
mainfrom
fix-nightly-pypi-uploads
Jun 10, 2026
Merged

vmoens merged 1 commit into
mainfrom
fix-nightly-pypi-uploads

Conversation

@vmoens

@vmoens vmoens commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What's broken

torchrl-nightly on PyPI has been stale since 2025.9.1. The scheduled nightly workflow builds and tests wheels every day and shows green, but every PyPI upload job fails; continue-on-error: true masks it (see e.g. this scheduled run - all 15 upload jobs red, run green).

Two upload blockers:

  1. Local version identifiers. Nightly wheels are versioned e.g. 2026.6.9+ga1a1070: setup.py appends +g<sha> to the date written by build_nightly.sh. PyPI rejects any PEP 440 local version with 400: The use of local versions in '2026.6.9+ga1a1070' is not allowed.
  2. Platform tag. [BugFix] Old/Opt deps fixes #3799 dropped the linux_x86_64 -> manylinux1_x86_64 wheel rename, and PyPI rejects plain linux_x86_64 wheels, so Linux uploads would keep failing even with the version fixed (the last published nightlies were manylinux1_x86_64).

Two masking bugs let this rot silently:

  1. continue-on-error: true on the upload jobs keeps scheduled runs green when uploads fail.
  2. torchrl.__version__ is None in nightly wheels: the distribution is named torchrl-nightly but torchrl/__init__.py only queries torchrl, and no _version.py fallback is generated since setuptools_scm is not installed in the nightly build env. packaging/verify_nightly_version.py treats a missing version as a warning and passes, so the +g<sha> version sailed through the test job instead of failing it.

Fixes

  • build_nightly.sh: export TORCHRL_BUILD_VERSION="$(date +%Y.%m.%d)". setup.py uses this override verbatim, so the wheel version is the plain (normalized) date with no local suffix. Dev builds from source keep the +g<sha> behavior.
  • .github/workflows/nightly_build.yml: restore the manylinux1 rename (with the original rationale comment, matching what pytorch/pytorch binaries do) and drop continue-on-error from the two upload jobs so a failed upload turns the run red.
  • torchrl/__init__.py: fall back to the torchrl-nightly distribution name so nightly wheels report a real __version__.
  • packaging/verify_nightly_version.py: a missing/empty __version__ is now a hard failure instead of a warning-skip.

Validation

  • set_version() exercised locally: with TORCHRL_BUILD_VERSION=2026.06.10 the build version is 2026.06.10 (no local part, normalizes to 2026.6.10 which is what the verify script expects); without the override the dev path is unchanged (0.13.0+g<sha>).
  • The rename find command verified against dummy wheel filenames (linux wheel renamed to manylinux1, macos wheel untouched).
  • The build/test halves of nightly_build.yml run on this PR's own CI (pull_request trigger); the upload path gets exercised by the next 15:15 UTC scheduled run.

Note: the Nightly Orchestrator's scheduled runs are currently cancelled every day (separate concurrency issue, not addressed here), but nightly_build.yml has its own 15:15 UTC schedule that uploads independently, so nightlies resume regardless.

Generated with Claude Code

torchrl-nightly has been stale on PyPI since 2025.9.1: the scheduled
nightly workflow builds and tests wheels daily but every upload job
fails, and continue-on-error keeps the run green.

Two upload blockers:
- Wheels are versioned with a PEP 440 local identifier (2026.6.9+g<sha>)
  which PyPI rejects with 400. build_nightly.sh now exports
  TORCHRL_BUILD_VERSION so setup.py uses the plain date version and
  skips the +g<sha> suffix. Dev builds from source are unchanged.
- The linux_x86_64 -> manylinux1_x86_64 wheel rename was dropped in
  #3799 and PyPI rejects plain linux platform tags. Restore the rename.

Two masking bugs that let this rot silently:
- Drop continue-on-error from the upload jobs so a failed upload turns
  the scheduled run red.
- torchrl.__version__ was None in nightly wheels (dist is named
  torchrl-nightly, only torchrl was queried), so
  packaging/verify_nightly_version.py warning-skipped its validation.
  Fall back to the torchrl-nightly dist name and make a missing version
  a hard failure in the verify script.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pytorch-bot

pytorch-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/3844

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 10, 2026
@github-actions github-actions Bot added the CI Has to do with CI setup (e.g. wheels & builds, tests...) label Jun 10, 2026
@vmoens
vmoens merged commit 13c7eca into main Jun 10, 2026
104 of 127 checks passed
@vmoens
vmoens deleted the fix-nightly-pypi-uploads branch June 10, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Has to do with CI setup (e.g. wheels & builds, tests...) CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant