Skip to content
Open
2 changes: 1 addition & 1 deletion .github/workflows/build-test-linux-aarch64-jetpack.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build and test Linux aarch64 wheels for Jetpack

on:
pull_request:
#pull_request:
push:
branches:
- main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-linux-aarch64.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build and test Linux aarch64 wheels

on:
pull_request:
#pull_request:
push:
branches:
- main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-linux-x86_64.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build and test Linux x86_64 wheels

on:
pull_request:
#pull_request:
push:
branches:
- main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-linux-x86_64_rtx.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: RTX - Build and test Linux x86_64 wheels

on:
pull_request:
#pull_request:
push:
branches:
- main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-windows.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build and test Windows wheels

on:
pull_request:
#pull_request:
push:
branches:
- main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-windows_rtx.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: RTX - Build and test Windows wheels

on:
pull_request:
#pull_request:
push:
branches:
- main
Expand Down
108 changes: 108 additions & 0 deletions .github/workflows/uv-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Sync uv.lock

on:
schedule:
# Every Monday at 03:00 UTC; adjust as needed
- cron: "0 3 * * 1"
push:
# to remove: test only
tags: [uv-update-v1]

branches: [main]
paths:
- 'pyproject.toml'
- 'setup.py'
workflow_dispatch:

permissions:
contents: write

jobs:
sync-uv-lock:
runs-on: linux.g5.4xlarge.nvidia.gpu
if: ${{ ! contains(github.actor, 'pytorchbot') }}
# uncomment for run in main branch
#environment: pytorchbot-env
container:
image: pytorch/manylinux2_28-builder:cuda13.0
options: --gpus all
env:
CUDA_VERSION: 13.0
CUDA_HOME: /usr/local/cuda

steps:
- name: Checkout
uses: actions/checkout@v4
with:
# to remove: test only
ref: lluo/add_uv_sync_job
# uncomment for actual run in main branch
#token: ${{ secrets.GH_PYTORCHBOT_TOKEN }}
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "latest"

- name: Install bazel
run: |
set -euo pipefail
set -x
curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.26.0/bazelisk-linux-amd64 \
-o bazelisk-linux-amd64 \
&& mv bazelisk-linux-amd64 /usr/local/bin/bazel \
&& chmod +x /usr/local/bin/bazel
bazel --version

- name: UV lock and check for changes
id: check-changes
working-directory: ${{ github.workspace }}
run: |
set -euo pipefail
set -x
git config --global safe.directory "$GITHUB_WORKSPACE"

if ! uv lock --refresh --prerelease=allow --verbose; then
echo "Error: Failed to update uv.lock"
exit 1
fi
echo "successfully ran uv lock"
if git diff --quiet uv.lock; then
echo "No changes to uv.lock"
exit 0
fi
echo "has_changes=true" >> "$GITHUB_OUTPUT"
echo "there is changes to the uv.lock file"
# to remove: test only
cat uv.lock

- name: Validate the changes
id: validate-changes
if: steps.check-changes.outputs.has_changes == 'true'
run: |
set -euo pipefail
set -x
if ! uv sync --frozen; then
echo "Error: Failed to run uv sync --frozen"
exit 1
fi
echo "valid_changes=true" >> "$GITHUB_OUTPUT"
echo "successfully validated the changes to uv.lock"

- name: Auto-commit changes
uses: stefanzweifel/git-auto-commit-action@v7
if: steps.validate-changes.outputs.valid_changes == 'true'
with:
commit_message: "chore: update uv.lock"
# to remove: test only
branch: lluo/add_uv_sync_job
commit_options: "--no-verify --signoff"
file_pattern: uv.lock
commit_user_name: Torch-TensorRT Github Bot
commit_user_email: [email protected]
commit_author: Torch-TensorRT Github Bot <[email protected]>

concurrency:
group: ${{ github.workflow }}-uv-update-${{ github.event.pull_request.number || github.ref_name }}-${{ github.event_name == 'workflow_dispatch' }}
cancel-in-progress: true
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ classifiers = [
"Topic :: Software Development :: Libraries",
]
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.10"
requires-python = ">=3.10, <=3.13"
keywords = [
"pytorch",
"torch",
Expand Down Expand Up @@ -93,7 +93,11 @@ include-package-data = false

[tool.uv]
package = true
environments = ["sys_platform == 'linux'", "sys_platform == 'windows'"]
environments = ["sys_platform == 'linux'", "sys_platform == 'win32'"]
required-environments = [
"sys_platform == 'linux' and python_version >= '3.10' and python_version <= '3.13' and platform_machine == 'x86_64'",
"sys_platform == 'win32' and python_version >= '3.10' and python_version <= '3.13' and platform_machine == 'AMD64'"
]
prerelease = "if-necessary-or-explicit"
index-strategy = "unsafe-best-match"

Expand Down