Add stable HF PyPI release dispatch#2075
Conversation
Greptile SummaryThis PR extends the Hugging Face nightly workflow with a
|
| Filename | Overview |
|---|---|
| .github/workflows/huggingface-nightly.yml | Adds package, release_type, and release_version dispatch inputs; adds validation in nightly_coordinate; adds per-job if: guards; passes stable release args to the OCR CUDA build step via env vars — secure pattern. Third-party actions still on mutable version tags (pre-existing, already flagged). |
| ci/scripts/nightly_build_publish.py | Adds _pep440_stable_release, _target_version helpers and --release-version CLI arg; updates _patch_pyproject_version and _patch_setup_cfg_version to accept the new parameter; correctly uses is not None for the version-mode label and in the target-version dispatch. |
| ci/tests/test_huggingface_release_workflow.py | New test file with SPDX header; covers happy paths for both pyproject.toml and setup.cfg patching, parametrized error-path tests for invalid version strings, mutual-exclusivity rejection, and a YAML content smoke-test. |
| .gitignore | Adds .worktrees/ to the ignore list for local git worktrees. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[workflow_dispatch trigger] --> B{nightly_coordinate validation}
B -->|release_type=stable AND release_version empty| ERR1[exit 1: release_version required]
B -->|release_type=stable AND package=all| ERR2[exit 1: must select single package]
B -->|release_type=nightly AND release_version set| ERR3[exit 1: release_version only valid for stable]
B -->|valid| C{package input}
C -->|package=all or schedule| D[build job - non-OCR packages nightly only]
C -->|package=all or nemotron-ocr-v2 or schedule| E[build_ocr_cuda job]
E --> F{release_type?}
F -->|nightly| G[version_args = --nightly-base-version expected_version = base.dev*]
F -->|stable| H[version_args = --release-version INPUT_RELEASE_VERSION expected_version = INPUT_RELEASE_VERSION]
G --> I[nightly_build_publish.py _patch_pyproject_version / _patch_setup_cfg_version -> _pep440_nightly]
H --> J[nightly_build_publish.py _patch_pyproject_version / _patch_setup_cfg_version -> _pep440_stable_release validates regex]
I --> K[Build wheel & verify metadata_version.startswith expected]
J --> L[Build wheel & verify metadata_version == expected exact match]
Reviews (2): Last reviewed commit: "Add stable HF PyPI release dispatch" | Re-trigger Greptile
2f00e8f to
6a39fba
Compare
(cherry picked from commit 050331f)
Description
Adds a stable release mode to the Hugging Face package workflow so maintainers can manually dispatch an OCR v2 PyPI release without producing a
2.0.0.dev*version.package,release_type, andrelease_versionworkflow dispatch inputs.ci/scripts/nightly_build_publish.pyto patch exact stable versions via--release-version.Dry-run workflow dispatch with
upload_to=none: https://github.com/NVIDIA/NeMo-Retriever/actions/runs/26187815548Checklist