Skip to content

Commit b411d61

Browse files
Resolve code review comments and merge conflicts
2 parents bc8f3d2 + b5b7579 commit b411d61

File tree

654 files changed

+30528
-6652
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

654 files changed

+30528
-6652
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/python-3/.devcontainer/base.Dockerfile
22

3-
# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
3+
# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.13, 3.12, 3.11, 3.10, 3-bullseye, 3.13-bullseye, 3.12-bullseye, 3.11-bullseye, 3.10-bullseye, 3-buster, 3.13-buster, 3.12-buster, 3.11-buster, 3.10-buster
44
ARG VARIANT="3.10-bullseye"
55
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
66

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dockerfile": "Dockerfile",
77
"context": "..",
88
"args": {
9-
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
9+
// Update 'VARIANT' to pick a Python version: 3, 3.13, 3.12, 3.11, 3.10
1010
// Append -bullseye or -buster to pin to an OS version.
1111
// Use -bullseye variants on local on arm64/Apple Silicon.
1212
"VARIANT": "3.10-bullseye",

.github/workflows/docs-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
path: pr/
7575

7676
store-html:
77-
if: github.event_name == 'push' && github.repository_owner == 'NVIDIA'
77+
if: github.event_name == 'push' && github.repository_owner == 'NVIDIA-NeMo'
7878
needs: [build-docs]
7979
runs-on: ubuntu-latest
8080
steps:

.github/workflows/full-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
matrix:
2121
os: [Windows, macOS] # exclude Ubuntu as it is available in pr-tests
22-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
22+
python-version: ["3.10", "3.11", "3.12", "3.13"]
2323
include:
2424
- os: Windows
2525
image: windows-2022

.github/workflows/latest-deps-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
os: [Ubuntu]
13-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
13+
python-version: ["3.10", "3.11", "3.12", "3.13"]
1414
include:
1515
- os: Ubuntu
1616
image: ubuntu-latest

.github/workflows/pr-tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: PR Tests
22

33
on:
4-
push:
5-
64
pull_request:
75
# we don't ignore markdkowns to run pre-commits
86
paths-ignore:
@@ -13,7 +11,7 @@ jobs:
1311
strategy:
1412
matrix:
1513
os: [Ubuntu]
16-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
14+
python-version: ["3.10", "3.11", "3.12", "3.13"]
1715
include:
1816
- os: Ubuntu
1917
image: ubuntu-latest
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Publish to PyPI (with Approval)
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Build and Test Distribution"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
publish-pypi:
11+
if: github.event.workflow_run.conclusion == 'success'
12+
runs-on: ubuntu-latest
13+
environment:
14+
name: pypi-production
15+
url: https://pypi.org/project/nemoguardrails/
16+
permissions:
17+
contents: write
18+
id-token: write
19+
20+
steps:
21+
- name: Checkout repository for tag detection
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Detect version tag and extract info
27+
id: version
28+
run: |
29+
COMMIT_SHA="${{ github.event.workflow_run.head_sha }}"
30+
31+
TAG_NAME=$(git tag --points-at "$COMMIT_SHA" | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | head -1)
32+
33+
if [ -z "$TAG_NAME" ]; then
34+
echo "❌ No version tag found at commit $COMMIT_SHA"
35+
echo "Available tags at this commit:"
36+
git tag --points-at "$COMMIT_SHA" || echo " (none)"
37+
exit 1
38+
fi
39+
40+
VERSION="${TAG_NAME#v}"
41+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
42+
echo "tag=${TAG_NAME}" >> $GITHUB_OUTPUT
43+
echo "artifact_name=${TAG_NAME}-build" >> $GITHUB_OUTPUT
44+
echo "✅ Detected version tag: $TAG_NAME"
45+
46+
- name: Checkout repository
47+
uses: actions/checkout@v4
48+
with:
49+
ref: ${{ steps.version.outputs.tag }}
50+
51+
- name: Validate version matches tag
52+
run: |
53+
VERSION_IN_FILE=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
54+
TAG_VERSION="${{ steps.version.outputs.version }}"
55+
if [ "$VERSION_IN_FILE" != "$TAG_VERSION" ]; then
56+
echo "❌ Version mismatch: pyproject.toml=$VERSION_IN_FILE, tag=$TAG_VERSION"
57+
exit 1
58+
fi
59+
echo "✅ Version validated: $VERSION_IN_FILE matches tag $TAG_VERSION"
60+
61+
- name: Download artifact
62+
uses: actions/download-artifact@v4
63+
with:
64+
name: ${{ steps.version.outputs.artifact_name }}
65+
path: dist
66+
github-token: ${{ secrets.GITHUB_TOKEN }}
67+
repository: ${{ github.repository }}
68+
run-id: ${{ github.event.workflow_run.id }}
69+
70+
- name: List files
71+
run: ls -la dist/
72+
73+
- name: Publish to PyPI
74+
uses: pypa/gh-action-pypi-publish@release/v1
75+
with:
76+
verbose: true
77+
packages-dir: dist/
78+
attestations: true
79+
80+
- name: Create GitHub Release
81+
env:
82+
GH_TOKEN: ${{ github.token }}
83+
run: |
84+
TAG_NAME="${{ steps.version.outputs.tag }}"
85+
86+
git config --global user.name "github-actions[bot]"
87+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
88+
89+
CHANGELOG_SECTION=$(awk -v version="${{ steps.version.outputs.version }}" '
90+
/^## \[/ {
91+
if (found) exit
92+
if ($0 ~ "\\[" version "\\]") {
93+
found=1
94+
next
95+
}
96+
}
97+
found && /^## \[/ { exit }
98+
found { print }
99+
' CHANGELOG.md || echo "No changelog entry found for this version.")
100+
101+
echo "$CHANGELOG_SECTION" > release_notes.md
102+
103+
if gh release view "$TAG_NAME" --repo ${{ github.repository }} >/dev/null 2>&1; then
104+
echo "ℹ️ Release $TAG_NAME already exists, skipping creation"
105+
else
106+
if gh release create "$TAG_NAME" \
107+
--draft \
108+
--title "$TAG_NAME" \
109+
--notes-file release_notes.md \
110+
--repo ${{ github.repository }}; then
111+
echo "✅ Release $TAG_NAME created successfully"
112+
else
113+
echo "❌ Failed to create release $TAG_NAME" >&2
114+
rm -f release_notes.md
115+
exit 1
116+
fi
117+
fi
118+
119+
rm -f release_notes.md

.github/workflows/test-and-build-wheel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
runs-on: ubuntu-latest
8686
strategy:
8787
matrix:
88-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
88+
python-version: ["3.10", "3.11", "3.12", "3.13"]
8989
steps:
9090
- name: Set up Python
9191
uses: actions/setup-python@v5

.github/workflows/test-coverage-report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Coverage Report
22

33
on:
44
push:
5-
branches: [develop]
5+
branches: ["**"]
66
pull_request:
7-
branches: [develop]
7+
branches: ["**"]
88

99
jobs:
1010
test:

.github/workflows/test-published-dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
python-version: ["3.9", "3.10", "3.11", "3.12"]
12+
python-version: ["3.10", "3.11", "3.12", "3.13"]
1313
steps:
1414
- name: Set up Python
1515
uses: actions/setup-python@v5

0 commit comments

Comments
 (0)