db620d33df
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
dotnet-build-and-test / dotnet-test-functions (push) Has been cancelled
dotnet-build-and-test / paths-filter (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Debug, windows-latest, net9.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net8.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-foundry-hosted-it (push) Has been cancelled
dotnet-build-and-test / dotnet-build-and-test-check (push) Has been cancelled
dotnet-build-and-test / Integration Test Report (push) Has been cancelled
50 lines
2.1 KiB
YAML
50 lines
2.1 KiB
YAML
name: Reusable Setup UV
|
|
description: Reusable workflow to setup uv environment
|
|
|
|
inputs:
|
|
python-version:
|
|
description: The Python version to set up
|
|
required: true
|
|
os:
|
|
description: The operating system to set up
|
|
required: true
|
|
exclude-packages:
|
|
description: Space-separated list of packages to exclude from uv sync
|
|
required: false
|
|
default: ''
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Set up uv
|
|
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6
|
|
with:
|
|
version-file: "python/pyproject.toml"
|
|
enable-cache: true
|
|
cache-suffix: ${{ inputs.os }}-${{ inputs.python-version }}
|
|
cache-dependency-glob: "**/uv.lock"
|
|
- name: Exclude incompatible workspace packages
|
|
if: ${{ inputs.exclude-packages != '' }}
|
|
shell: bash
|
|
run: |
|
|
for pkg in ${{ inputs.exclude-packages }}; do
|
|
for f in python/packages/*/pyproject.toml; do
|
|
if grep -q "name = \"$pkg\"" "$f"; then
|
|
pkg_dir=$(dirname "$f" | sed 's|python/||')
|
|
echo "Excluding workspace package: $pkg ($pkg_dir)"
|
|
if awk '/^\[tool\.uv\.workspace\]/{f=1;next} /^\[/{f=0} f && /^exclude = \[/{found=1} END{exit !found}' python/pyproject.toml; then
|
|
if ! awk '/^\[tool\.uv\.workspace\]/{f=1;next} /^\[/{f=0} f && /^exclude = \[/ && index($0, "\"'"$pkg_dir"'\"")' python/pyproject.toml | grep -q .; then
|
|
sed -i.bak '/\[tool\.uv\.workspace\]/,/^\[/ { /^exclude = \[/ s|\]|, "'"$pkg_dir"'"]| }' python/pyproject.toml
|
|
fi
|
|
else
|
|
sed -i.bak '/\[tool\.uv\.workspace\]/a\exclude = ["'"$pkg_dir"'"]' python/pyproject.toml
|
|
fi
|
|
sed -i.bak '/'"$pkg"' = { workspace = true }/d' python/pyproject.toml
|
|
fi
|
|
done
|
|
done
|
|
- name: Install the project
|
|
shell: bash
|
|
run: |
|
|
cd python && uv sync --all-packages --all-extras --all-groups --prerelease=if-necessary-or-explicit
|