Skip to content

Commit f16428d

Browse files
binaryaaronclaudeCopilot
authored
chore: add .python-version pin (#244)
## Summary ran into weird bootstrapping issues with uv install python 3.13 due to the recently relaxed versions. adding a pin here for now. --------- Signed-off-by: aagonzales <aagonzales@nvidia.com> Signed-off-by: Aaron Gonzales <aaron@aarongonzales.net> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 63e8ca5 commit f16428d

9 files changed

Lines changed: 52 additions & 59 deletions

File tree

.github/actions/setup-python-env/action.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ inputs:
2121
required: false
2222
default: ""
2323
python-version:
24-
description: "Python version to use"
24+
description: "Python version to use (defaults to .python-version when empty)"
2525
required: false
26-
default: "3.11"
26+
default: ""
2727
fetch-depth:
2828
description: "Number of commits to fetch (0 for all history)"
2929
required: false
@@ -69,10 +69,17 @@ runs:
6969
enable-cache: true
7070

7171
- name: Set up Python ${{ inputs.python-version }}
72+
if: inputs.python-version != ''
7273
uses: actions/setup-python@v5
7374
with:
7475
python-version: ${{ inputs.python-version }}
7576

77+
- name: Set up Python from .python-version
78+
if: inputs.python-version == ''
79+
uses: actions/setup-python@v5
80+
with:
81+
python-version-file: ".python-version"
82+
7683
- name: Install tools
7784
if: inputs.bootstrap-tools == 'true'
7885
shell: bash

.github/workflows/README.md

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ This directory contains GitHub Actions workflows for CI/CD automation.
77

88
## Workflows Overview
99

10-
11-
| Workflow | Trigger | Description |
12-
| -------------------------------------------------- | ------------------------------------- | ---------------------------------------------------- |
13-
| [ci-checks.yml](ci-checks.yml) | Push to `main`, PRs, manual | Format, typecheck, and unit tests (CPU) |
14-
| [gpu-tests.yml](gpu-tests.yml) | Push to `main`/`pull-request/*`, manual | GPU E2E tests (A100) |
15-
| [conventional-commit.yml](conventional-commit.yml) | PRs | Validates PR titles follow conventional commit format |
16-
| [copyright-check.yml](copyright-check.yml) | Push to `main`/`pull-request/*` | Validates NVIDIA copyright headers on Python files |
17-
| [docs.yml](docs.yml) | Push to `main` (docs paths) | Builds and deploys documentation to GitHub Pages |
18-
| [internal-release.yml](internal-release.yml) | Tag push (`v[0-9]*`), manual dispatch | Builds and publishes wheel to Artifactory or PyPI |
19-
| [release.yml](release.yml) | Manual dispatch | Builds and publishes package to PyPI (production) |
20-
| [secrets-detector.yml](secrets-detector.yml) | PRs | Scans for accidentally committed secrets |
21-
10+
All workflows that use `.github/actions/setup-python-env` now default to the version in `../../.python-version`. Set the action input `python-version` only when a job intentionally needs an override.
11+
12+
| Workflow | Trigger | Description |
13+
| -------------------------------------------------- | ---------------------------------------- | ----------------------------------------------------- |
14+
| [ci-checks.yml](ci-checks.yml) | Push to `main`, PRs, manual | Format, typecheck, and unit tests (CPU) |
15+
| [gpu-tests.yml](gpu-tests.yml) | Push to `main`/`pull-request/*`, manual | GPU E2E tests (A100) |
16+
| [conventional-commit.yml](conventional-commit.yml) | PRs | Validates PR titles follow conventional commit format |
17+
| [copyright-check.yml](copyright-check.yml) | Push to `main`/`pull-request/*` | Validates NVIDIA copyright headers on Python files |
18+
| [docs.yml](docs.yml) | Push to `main` (docs paths) | Builds and deploys documentation to GitHub Pages |
19+
| [internal-release.yml](internal-release.yml) | Tag push (`v[0-9]*`), manual dispatch | Builds and publishes wheel to Artifactory or PyPI |
20+
| [release.yml](release.yml) | Manual dispatch | Builds and publishes package to PyPI (production) |
21+
| [secrets-detector.yml](secrets-detector.yml) | PRs | Scans for accidentally committed secrets |
2222

2323
## Pull Request Testing (copy-pr-bot)
2424

@@ -109,7 +109,7 @@ flowchart LR
109109
The `ci-checks.yml` workflow runs on every push to `main` and on pull requests. Every check step calls a `make` target so the Makefile is the single source of truth for how each check runs.
110110

111111
| Job | `make` target | What it checks |
112-
|---|---|---|
112+
| --- | --- | --- |
113113
| Format | `format-check` | `ruff format --check` + `ruff check` + SPDX copyright headers |
114114
| Format (lock) | `lock-check` | `uv.lock` matches `pyproject.toml` |
115115
| Typecheck | `typecheck` | `ty check` (excludes per `pyproject.toml [tool.ty.src]`) |
@@ -204,6 +204,7 @@ The `internal-release.yml` workflow builds a wheel and publishes it to NVIDIA Ar
204204
**Tag push (automatic):** Pushing a `v[0-9]*` tag (e.g. `git tag v0.2.0 && git push --tags`) automatically builds and publishes to Artifactory. This is the primary release mechanism.
205205

206206
**Manual dispatch:** Go to Actions > Internal Release and run with:
207+
207208
- `release-ref`: Branch, tag, or commit SHA to build (defaults to `main`)
208209
- `publish-target`: `artifactory` (default) or `pypi`
209210

@@ -258,10 +259,11 @@ this is placeholder information until we do a real release. will update then.
258259
1. Go to Actions > Release NeMo Safe Synthesizer
259260
2. Click Run workflow
260261
3. Fill in the required inputs:
261-
- `release-ref`: Full SHA or tag of the commit to release
262-
- `dry-run`: Set to `false` for production release (publishes to PyPI)
263-
- `create-gh-release`: Whether to create a GitHub release
264-
- `version-bump-branch`: Branch to push the version bump PR (usually `main`)
262+
263+
- `release-ref`: Full SHA or tag of the commit to release
264+
- `dry-run`: Set to `false` for production release (publishes to PyPI)
265+
- `create-gh-release`: Whether to create a GitHub release
266+
- `version-bump-branch`: Branch to push the version bump PR (usually `main`)
265267

266268
### Release Process
267269

@@ -293,28 +295,24 @@ The release workflow automatically bumps the PATCH version (or PRE_RELEASE for r
293295

294296
The following secrets must be configured in GitHub repository settings:
295297

296-
297-
| Secret | Purpose |
298-
| ------------------------ | ---------------------------- |
299-
| `TWINE_USERNAME` | PyPI username |
300-
| `TWINE_PASSWORD` | PyPI API token |
301-
| `SLACK_WEBHOOK_ADMIN` | Slack admin notifications |
302-
| `SLACK_RELEASE_ENDPOINT` | Slack release notifications |
303-
| `PAT` | GitHub Personal Access Token |
304-
| `SSH_KEY` | GPG signing key |
305-
| `SSH_PWD` | GPG key passphrase |
306-
| `BOT_KEY` | GitHub App private key |
307-
| `ARTIFACTORY_USERNAME` | NVIDIA Artifactory username |
308-
| `ARTIFACTORY_TOKEN` | NVIDIA Artifactory API key |
309-
| `ARTIFACTORY_INTERNAL_URL`| NVIDIA Artifactory repo URL |
310-
311-
298+
| Secret | Purpose |
299+
| --------------------------- | ---------------------------- |
300+
| `TWINE_USERNAME` | PyPI username |
301+
| `TWINE_PASSWORD` | PyPI API token |
302+
| `SLACK_WEBHOOK_ADMIN` | Slack admin notifications |
303+
| `SLACK_RELEASE_ENDPOINT` | Slack release notifications |
304+
| `PAT` | GitHub Personal Access Token |
305+
| `SSH_KEY` | GPG signing key |
306+
| `SSH_PWD` | GPG key passphrase |
307+
| `BOT_KEY` | GitHub App private key |
308+
| `ARTIFACTORY_USERNAME` | NVIDIA Artifactory username |
309+
| `ARTIFACTORY_TOKEN` | NVIDIA Artifactory API key |
310+
| `ARTIFACTORY_INTERNAL_URL` | NVIDIA Artifactory repo URL |
312311

313312
| Variable | Purpose |
314313
| -------- | ------------- |
315314
| `BOT_ID` | GitHub App ID |
316315

317-
318316
## Reusable Workflows
319317

320318
All compliance and release workflows reuse templates from [NVIDIA-NeMo/FW-CI-templates](https://github.com/NVIDIA-NeMo/FW-CI-templates) (pinned to `v0.66.6`):
@@ -326,9 +324,8 @@ All compliance and release workflows reuse templates from [NVIDIA-NeMo/FW-CI-tem
326324

327325
## Configuration Files
328326

329-
330-
| File | Purpose |
331-
| ------------------------------------------------- | ------------------------------------ |
332-
| `config/.secrets.baseline` | False positives for secrets detector |
333-
| `../../.python-version` | Python version for uv packaging |
334-
| `../../src/nemo_safe_synthesizer/package_info.py` | Version information |
327+
| File | Purpose |
328+
| --- | --- |
329+
| `config/.secrets.baseline` | False positives for secrets detector |
330+
| `../../.python-version` | Python version source for CI |
331+
| `../../src/nemo_safe_synthesizer/package_info.py` | Version information |

.github/workflows/ci-checks.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,10 @@ jobs:
107107
run: make typecheck
108108

109109
unit-test:
110-
name: Unit Tests - (Python ${{ matrix.python-version }})
110+
name: Unit Tests
111111
needs: changes
112112
if: ${{ needs.changes.outputs.src == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.deps == 'true' || github.event_name == 'workflow_dispatch' }}
113113
runs-on: ubuntu-latest
114-
strategy:
115-
fail-fast: false
116-
matrix:
117-
python-version: ["3.11"]
118114
steps:
119115
- name: checkout
120116
uses: actions/checkout@v6
@@ -125,7 +121,6 @@ jobs:
125121
id: setup
126122
uses: ./.github/actions/setup-python-env
127123
with:
128-
python-version: ${{ matrix.python-version }}
129124
bootstrap-tools: "true"
130125

131126
- name: Bootstrap
@@ -136,7 +131,6 @@ jobs:
136131

137132
- name: Upload coverage report
138133
uses: actions/upload-artifact@v7
139-
if: matrix.python-version == '3.11'
140134
with:
141135
name: coverage-report
142136
path: coverage.json

.github/workflows/docs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ jobs:
4848
with:
4949
fetch-depth: 0
5050
bootstrap-tools: "true"
51-
python-version: "3.11"
5251

5352
- name: Install docs dependencies
5453
run: make bootstrap-nss dev

.github/workflows/gpu-tests.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,11 @@ jobs:
5656
uses: ./.github/actions/detect-changes
5757

5858
gpu-e2e-test:
59-
name: GPU E2E Tests - (Python ${{ matrix.python-version }})
59+
name: GPU E2E Tests
6060
needs: changes
6161
if: ${{ needs.changes.outputs.src == 'true' || needs.changes.outputs.test == 'true' || github.event_name == 'workflow_dispatch' }}
6262
timeout-minutes: 60
6363
runs-on: linux-amd64-gpu-a100-latest-1
64-
strategy:
65-
fail-fast: false
66-
matrix:
67-
python-version: ["3.11"]
6864
steps:
6965
- name: checkout
7066
uses: actions/checkout@v6
@@ -75,7 +71,6 @@ jobs:
7571
id: setup
7672
uses: ./.github/actions/setup-python-env
7773
with:
78-
python-version: ${{ matrix.python-version }}
7974
bootstrap-tools: "true"
8075

8176
- name: Run GPU E2E tests

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Please read our [Code of Conduct](CODE_OF_CONDUCT.md) before contributing.
2424

2525
### Prerequisites
2626

27-
- Python 3.11+
27+
- Python 3.11+ (project supports Python ≥3.11; `.python-version` currently pins 3.11 for bootstrapping at the repo root)
2828
- Git 2.34+ (minimum required for SSH commit signing)
2929

3030
> Note: Other tools like [uv](https://docs.astral.sh/uv/), [ruff](https://docs.astral.sh/ruff/), [ty](https://github.com/astral-sh/ty), and [gh](https://cli.github.com/) are installed automatically by `make bootstrap-tools`.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This package makes synthetic data, safely.
66

77
### Prerequisites
88

9-
- Python 3.11+
9+
- Python 3.11+ (we pin a specific 3.11.x in `.python-version` for local/dev bootstrap; any supported 3.11+ interpreter is fine)
1010
- [uv](https://docs.astral.sh/uv/) - Python package manager (>=0.9.14, <0.10.0)
1111
- Git
1212

docs/user-guide/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ does at each stage.
1414

1515
### Prerequisites
1616

17-
- Python 3.11+
17+
- Python 3.11+ (dev tooling currently pins 3.11 via `.python-version` in the repo root)
1818
- CUDA runtime 12.8
1919
- NVIDIA GPU (A100 or better) for training and generation
2020

0 commit comments

Comments
 (0)