fix: add platform markers to GPU extras, use --extra cpu in CI, simplify lockfile workflow

- rocm/intel/gpu extras are x86_64-only; aarch64 wheels don't exist so uv
  failed to resolve them when required-environments includes aarch64
- test.yml: switch from --all-extras (broken by conflicts + missing wheels)
  to --extra cpu which is cross-platform and sufficient for unit tests
- update-lockfile.yml: drop old file-swap loop; single pyproject means a
  single uv lock run and a single uv.lock to commit
This commit is contained in:
2026-06-14 20:04:25 +00:00
parent e2a1924fb0
commit 02c56493f6
3 changed files with 14 additions and 31 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ jobs:
run: uv python install 3.13 run: uv python install 3.13
- name: Install dependencies - name: Install dependencies
run: uv sync --all-extras run: uv sync --extra cpu
- name: Run tests - name: Run tests
run: uv run pytest run: uv run pytest
+7 -27
View File
@@ -1,5 +1,5 @@
# .github/workflows/update-lockfile.yml # .github/workflows/update-lockfile.yml
name: Update lockfiles name: Update lockfile
on: on:
push: push:
@@ -7,9 +7,6 @@ on:
- '**' - '**'
paths: paths:
- 'pyproject.toml' - 'pyproject.toml'
- 'pyproject-cpu.toml'
- 'pyproject-rocm.toml'
- 'pyproject-intel.toml'
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@@ -18,14 +15,6 @@ jobs:
permissions: permissions:
contents: write contents: write
steps: steps:
- name: Free up disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
echo "Disk space freed."
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v6 uses: actions/checkout@v6
@@ -35,32 +24,23 @@ jobs:
- name: Set up Python - name: Set up Python
run: uv python install 3.13 run: uv python install 3.13
- name: Regenerate all lockfiles - name: Regenerate lockfile
run: | run: uv lock
cp pyproject.toml _pyproject_orig.toml
for variant in cpu rocm intel; do
cp pyproject-${variant}.toml pyproject.toml
uv lock
cp uv.lock uv-${variant}.lock
done
cp _pyproject_orig.toml pyproject.toml
uv lock
rm _pyproject_orig.toml
- name: Check for changes - name: Check for changes
id: diff id: diff
run: | run: |
if git diff --quiet uv.lock uv-cpu.lock uv-rocm.lock uv-intel.lock; then if git diff --quiet uv.lock; then
echo "changed=false" >> "$GITHUB_OUTPUT" echo "changed=false" >> "$GITHUB_OUTPUT"
else else
echo "changed=true" >> "$GITHUB_OUTPUT" echo "changed=true" >> "$GITHUB_OUTPUT"
fi fi
- name: Commit and push updated lockfiles - name: Commit and push updated lockfile
if: steps.diff.outputs.changed == 'true' if: steps.diff.outputs.changed == 'true'
run: | run: |
git config user.name "github-actions[bot]" git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add uv.lock uv-cpu.lock uv-rocm.lock uv-intel.lock git add uv.lock
git commit -m "chore: update lockfiles" git commit -m "chore: update lockfile"
git push git push
+6 -3
View File
@@ -26,9 +26,12 @@ dependencies = [
] ]
[project.optional-dependencies] [project.optional-dependencies]
gpu = ["onnxruntime-gpu>=1.23.2", "nvidia-cudnn-cu12>=9.0.0"] gpu = [
rocm = ["onnxruntime-rocm>=1.16.0"] "onnxruntime-gpu>=1.23.2; sys_platform == 'linux' and platform_machine == 'x86_64'",
intel = ["onnxruntime-openvino>=1.20.0"] "nvidia-cudnn-cu12>=9.0.0; sys_platform == 'linux' and platform_machine == 'x86_64'",
]
rocm = ["onnxruntime-rocm>=1.16.0; sys_platform == 'linux' and platform_machine == 'x86_64'"]
intel = ["onnxruntime-openvino>=1.20.0; sys_platform == 'linux' and platform_machine == 'x86_64'"]
cpu = ["onnxruntime>=1.23.2"] cpu = ["onnxruntime>=1.23.2"]
[project.scripts] [project.scripts]