-
Notifications
You must be signed in to change notification settings - Fork 0
3658: AVRO-4232: [Python] Modernize the Python tooling #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
6ec71fe
9902208
d81a4a7
a411989
9a2ff4e
34eae25
a427cfb
d401b80
9e71d4b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,17 +13,17 @@ | |||||||||||||||
| # See the License for the specific language governing permissions and | ||||||||||||||||
| # limitations under the License. | ||||||||||||||||
|
|
||||||||||||||||
| name: 'Test Java' | ||||||||||||||||
| name: "Test Java" | ||||||||||||||||
| on: | ||||||||||||||||
| workflow_dispatch: | ||||||||||||||||
| push: | ||||||||||||||||
| branches: [ main ] | ||||||||||||||||
| branches: [main] | ||||||||||||||||
| pull_request: | ||||||||||||||||
| branches: [ main ] | ||||||||||||||||
| branches: [main] | ||||||||||||||||
| paths: | ||||||||||||||||
| - .github/workflows/test-lang-java.yml | ||||||||||||||||
| - lang/java/** | ||||||||||||||||
| - pom.xml | ||||||||||||||||
| - .github/workflows/test-lang-java.yml | ||||||||||||||||
| - lang/java/** | ||||||||||||||||
| - pom.xml | ||||||||||||||||
|
|
||||||||||||||||
| defaults: | ||||||||||||||||
| run: | ||||||||||||||||
|
|
@@ -35,137 +35,138 @@ concurrency: | |||||||||||||||
|
|
||||||||||||||||
| jobs: | ||||||||||||||||
| test: | ||||||||||||||||
| name: 'Java Test' | ||||||||||||||||
| name: "Java Test" | ||||||||||||||||
| runs-on: ${{ matrix.os }} | ||||||||||||||||
| strategy: | ||||||||||||||||
| matrix: | ||||||||||||||||
| os: | ||||||||||||||||
| os: | ||||||||||||||||
| - ubuntu-latest | ||||||||||||||||
| - ubuntu-24.04-arm | ||||||||||||||||
| steps: | ||||||||||||||||
| - name: 'Checkout sourcecode' | ||||||||||||||||
| - name: "Checkout sourcecode" | ||||||||||||||||
| uses: actions/checkout@v6 | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Cache Local Maven Repository' | ||||||||||||||||
| - name: "Cache Local Maven Repository" | ||||||||||||||||
| uses: actions/cache@v5 | ||||||||||||||||
| with: | ||||||||||||||||
| path: ~/.m2/repository | ||||||||||||||||
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||||||||||||||||
| restore-keys: | | ||||||||||||||||
| ${{ runner.os }}-maven- | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Setup Temurin JDK 11, 17 & 21' | ||||||||||||||||
| - name: "Setup Temurin JDK 11, 17 & 21" | ||||||||||||||||
| uses: actions/setup-java@v5 | ||||||||||||||||
| with: | ||||||||||||||||
| distribution: 'temurin' | ||||||||||||||||
| distribution: "temurin" | ||||||||||||||||
| java-version: | | ||||||||||||||||
| 11 | ||||||||||||||||
| 17 | ||||||||||||||||
| 21 | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Setup Maven 3.9.11' | ||||||||||||||||
| - name: "Setup Maven 3.9.11" | ||||||||||||||||
| uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5 | ||||||||||||||||
| with: | ||||||||||||||||
| maven-version: 3.9.11 | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Install Java Avro Toplevel' | ||||||||||||||||
| - name: "Install Java Avro Toplevel" | ||||||||||||||||
| working-directory: ./ | ||||||||||||||||
| run: mvn -B install -PskipQuality -DskipTests | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Java Lint' | ||||||||||||||||
| - name: "Java Lint" | ||||||||||||||||
| run: ./build.sh lint | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Java Test' | ||||||||||||||||
| - name: "Java Test" | ||||||||||||||||
| run: ./build.sh test | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Install Java Avro' | ||||||||||||||||
| - name: "Install Java Avro" | ||||||||||||||||
| working-directory: . | ||||||||||||||||
| run: mvn -B clean install -PskipQuality -DskipTests | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Test Reproducible Build' | ||||||||||||||||
| - name: "Test Reproducible Build" | ||||||||||||||||
| working-directory: . | ||||||||||||||||
| run: mvn clean verify -PskipQuality artifact:compare | ||||||||||||||||
|
|
||||||||||||||||
| interop: | ||||||||||||||||
| name: 'Java Interop' | ||||||||||||||||
| name: "Java Interop" | ||||||||||||||||
| runs-on: ${{ matrix.os }} | ||||||||||||||||
| strategy: | ||||||||||||||||
| matrix: | ||||||||||||||||
| os: | ||||||||||||||||
| os: | ||||||||||||||||
| - ubuntu-latest | ||||||||||||||||
| - ubuntu-24.04-arm | ||||||||||||||||
|
|
||||||||||||||||
| steps: | ||||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Cache Local Maven Repository' | ||||||||||||||||
| - name: "Cache Local Maven Repository" | ||||||||||||||||
| uses: actions/cache@v5 | ||||||||||||||||
| with: | ||||||||||||||||
| path: ~/.m2/repository | ||||||||||||||||
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||||||||||||||||
| restore-keys: | | ||||||||||||||||
| ${{ runner.os }}-maven- | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Setup Temurin JDK 11, 17 & 21' | ||||||||||||||||
| - name: "Setup Temurin JDK 11, 17 & 21" | ||||||||||||||||
| uses: actions/setup-java@v5 | ||||||||||||||||
| with: | ||||||||||||||||
| distribution: 'temurin' | ||||||||||||||||
| distribution: "temurin" | ||||||||||||||||
| java-version: | | ||||||||||||||||
| 11 | ||||||||||||||||
| 17 | ||||||||||||||||
| 21 | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Setup Maven 3.9.11' | ||||||||||||||||
| - name: "Setup Maven 3.9.11" | ||||||||||||||||
| uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5 | ||||||||||||||||
| with: | ||||||||||||||||
| maven-version: 3.9.11 | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Setup Python for Generating Input Data' | ||||||||||||||||
| - name: "Setup Python for Generating Input Data" | ||||||||||||||||
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | ||||||||||||||||
| with: | ||||||||||||||||
| python-version: '3.12' | ||||||||||||||||
| python-version: "3.12" | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Apt Install Compression Libs Required by Python' | ||||||||||||||||
| - name: Setup uv | ||||||||||||||||
| uses: astral-sh/setup-uv@v6 | ||||||||||||||||
|
|
||||||||||||||||
| - name: "Apt Install Compression Libs Required by Python" | ||||||||||||||||
| run: | | ||||||||||||||||
| sudo apt-get update && \ | ||||||||||||||||
| sudo apt-get install -qqy --no-install-recommends libbz2-dev \ | ||||||||||||||||
| liblzma-dev \ | ||||||||||||||||
| libsnappy-dev \ | ||||||||||||||||
| libzstd-dev | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Install Python Dependencies' | ||||||||||||||||
| run: | | ||||||||||||||||
| python3 -m pip install --break-system-packages --upgrade pip setuptools tox | ||||||||||||||||
| python3 -m pip install --break-system-packages python-snappy zstandard | ||||||||||||||||
| - name: "Install Python Dependencies" | ||||||||||||||||
| run: uv sync | ||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because this workflow sets Severity: high 🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. value:useful; category:bug; feedback: The Augment AI reviewer is correct!
Comment on lines
+139
to
+140
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Find all pyproject.toml and uv.lock files in the repository
echo "=== Searching for pyproject.toml and uv.lock files ==="
find . -type f \( -name "pyproject.toml" -o -name "uv.lock" \) | sortRepository: martin-augment/avro Length of output: 160 🏁 Script executed: # Inspect the workflow file to verify the default working directory and the step in question
echo "=== Workflow file: lines 25-35 (workflow defaults) ==="
sed -n '25,35p' .github/workflows/test-lang-java.yml
echo ""
echo "=== Workflow file: lines 135-145 (the uv sync step) ==="
sed -n '135,145p' .github/workflows/test-lang-java.yml
echo ""
echo "=== Workflow file: lines 150-165 (context for working-directory usage) ==="
sed -n '150,165p' .github/workflows/test-lang-java.ymlRepository: martin-augment/avro Length of output: 1371 🏁 Script executed: # Check if lang/java directory exists and what's in it
echo "=== Listing contents of lang/java ==="
if [ -d "lang/java" ]; then
ls -la lang/java | head -20
else
echo "lang/java directory does not exist"
fi
echo ""
echo "=== Listing contents of lang/py ==="
if [ -d "lang/py" ]; then
ls -la lang/py | head -20
else
echo "lang/py directory does not exist"
fiRepository: martin-augment/avro Length of output: 2106
The Proposed fix - name: "Install Python Dependencies"
+ working-directory: lang/py
run: uv sync📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. value:useful; category:bug; feedback: The CodeRabbit AI reviewer is correct! uv would work only for lang/py/ because it uses pyproject.toml. To fix the CI job's step the current working directory should be set to lang/py/ |
||||||||||||||||
|
|
||||||||||||||||
| - name: 'Setup C# for Generating Interop Data' | ||||||||||||||||
| - name: "Setup C# for Generating Interop Data" | ||||||||||||||||
| uses: actions/setup-dotnet@v5 | ||||||||||||||||
| with: | ||||||||||||||||
| dotnet-version: | | ||||||||||||||||
| 6.0.x | ||||||||||||||||
| 7.0.x | ||||||||||||||||
| 8.0.x | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Create Interop Data Directory' | ||||||||||||||||
| - name: "Create Interop Data Directory" | ||||||||||||||||
| working-directory: . | ||||||||||||||||
| run: mkdir -p build/interop/data | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Generate Interop Data using Python' | ||||||||||||||||
| - name: "Generate Interop Data using Python" | ||||||||||||||||
| working-directory: lang/py | ||||||||||||||||
| run: ./build.sh interop-data-generate | ||||||||||||||||
| run: uv run ./build.sh interop-data-generate | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Generate Interop Data using C#' | ||||||||||||||||
| - name: "Generate Interop Data using C#" | ||||||||||||||||
| working-directory: lang/csharp | ||||||||||||||||
| run: ./build.sh interop-data-generate | ||||||||||||||||
| run: uv run ./build.sh interop-data-generate | ||||||||||||||||
|
Comment on lines
+158
to
+160
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Check if C# build script references Python or uv
fd -g "build.sh" --search-path lang/csharp --exec grep -n -i "python\|uv run\|uv sync" {} +Repository: martin-augment/avro Length of output: 97 🏁 Script executed: # Also check the workflow file structure to compare Python and C# steps
cat -n .github/workflows/test-lang-java.yml | sed -n '150,165p'Repository: martin-augment/avro Length of output: 693 🏁 Script executed: # Examine the C# build script to understand its purpose
fd -g "build.sh" --search-path lang/csharp --exec head -50 {} +Repository: martin-augment/avro Length of output: 1718 🏁 Script executed: # Check if C# build script references Python or uv
cat lang/csharp/build.sh | grep -n -i "python\|uv run\|uv sync" || echo "No matches found"Repository: martin-augment/avro Length of output: 79 🏁 Script executed: # Check the full C# build script, specifically the interop-data-generate target
cat lang/csharp/build.sh | tail -100Repository: martin-augment/avro Length of output: 3321 🏁 Script executed: # Search for interop-data-generate target definition in C# build script
rg "interop-data-generate" lang/csharp/Repository: martin-augment/avro Length of output: 374
The C# Proposed fix - name: "Generate Interop Data using C#"
working-directory: lang/csharp
- run: uv run ./build.sh interop-data-generate
+ run: ./build.sh interop-data-generate📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. value:useful; category:bug; feedback: The CodeRabbit AI reviewer is correct! The changes in the C# CI job should be reverted to not use |
||||||||||||||||
|
|
||||||||||||||||
| - name: 'Install Java Avro for other tests' | ||||||||||||||||
| - name: "Install Java Avro for other tests" | ||||||||||||||||
| working-directory: . | ||||||||||||||||
| run: mvn -B install -PskipQuality | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Generate Interop Data using Java 11, 17 & 21' | ||||||||||||||||
| - name: "Generate Interop Data using Java 11, 17 & 21" | ||||||||||||||||
| working-directory: lang/java/interop-data-test | ||||||||||||||||
| run: mvn -B verify -Pgenerate-test-data | ||||||||||||||||
|
|
||||||||||||||||
| - name: 'Run Interop Tests using Java 11, 17 & 21' | ||||||||||||||||
| - name: "Run Interop Tests using Java 11, 17 & 21" | ||||||||||||||||
| working-directory: lang/java/interop-data-test | ||||||||||||||||
| run: mvn -B verify -Pcheck-test-data | ||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,16 +13,16 @@ | |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: 'Test Python' | ||
| name: "Test Python" | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: [ main ] | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [ main ] | ||
| branches: [main] | ||
| paths: | ||
| - .github/workflows/test-lang-py.yml | ||
| - lang/py/** | ||
| - .github/workflows/test-lang-py.yml | ||
| - lang/py/** | ||
|
|
||
| defaults: | ||
| run: | ||
|
|
@@ -38,16 +38,17 @@ jobs: | |
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: | ||
| os: | ||
| - ubuntu-latest | ||
| - ubuntu-24.04-arm | ||
| python: | ||
| - '3.13' | ||
| - '3.12' | ||
| - '3.11' | ||
| - '3.10' | ||
| - 'pypy-3.11' | ||
| - 'pypy-3.10' | ||
| - "3.14" | ||
| - "3.13" | ||
| - "3.12" | ||
| - "3.11" | ||
| - "3.10" | ||
| - "pypy-3.11" | ||
| - "pypy-3.10" | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
@@ -57,6 +58,9 @@ jobs: | |
| with: | ||
| python-version: ${{ matrix.python }} | ||
|
|
||
| - name: Setup uv | ||
| uses: astral-sh/setup-uv@v6 | ||
|
|
||
| - name: Apt Install Compression Libs | ||
| run: | | ||
| sudo apt-get update && \ | ||
|
|
@@ -67,33 +71,30 @@ jobs: | |
| libzstd-dev | ||
|
|
||
| - name: Install Dependencies | ||
| run: | | ||
| python3 -m pip install --upgrade pip setuptools tox | ||
| run: uv sync | ||
|
|
||
| - name: Lint | ||
| if: ${{ matrix.python == '3.10' }} | ||
| run: python3 -m tox -e lint | ||
| run: uv run ./build.sh lint | ||
|
|
||
| - name: Typechecks | ||
| if: ${{ matrix.python == '3.10' }} | ||
| run: python3 -m tox -e typechecks | ||
| run: uv run ./build.sh typechecks | ||
|
|
||
| - name: Test | ||
| run: python3 -m tox -e py | ||
| run: uv run ./build.sh test | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Severity: medium 🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. value:valid-but-wont-fix; category:bug; feedback: The Augment AI reviewer is correct! The proposed changes will run all checks for all Python versions. The checks are fast enough, so this is not a problem. The idea is to make sure that the Python SDK works fine on all supported Python versions. |
||
|
|
||
| interop: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: | ||
| os: | ||
| - ubuntu-latest | ||
| - ubuntu-24.04-arm | ||
| python: | ||
| - '3.11' | ||
| - '3.10' | ||
| - '3.9' | ||
| - 'pypy-3.10' | ||
| - "3.13" | ||
| - "3.12" | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
@@ -103,6 +104,9 @@ jobs: | |
| with: | ||
| python-version: ${{ matrix.python }} | ||
|
|
||
| - name: Setup uv | ||
| uses: astral-sh/setup-uv@v6 | ||
|
|
||
| - name: Apt Install Compression Libs | ||
| run: | | ||
| sudo apt-get update && \ | ||
|
|
@@ -113,9 +117,7 @@ jobs: | |
| libzstd-dev | ||
|
|
||
| - name: Install Dependencies | ||
| run: | | ||
| python3 -m pip install --upgrade pip setuptools tox | ||
| python3 -m pip install python-snappy zstandard | ||
| run: uv sync | ||
|
|
||
| - name: Cache Local Maven Repository | ||
| uses: actions/cache@v5 | ||
|
|
@@ -125,17 +127,17 @@ jobs: | |
| restore-keys: | | ||
| ${{ runner.os }}-maven- | ||
|
|
||
| - name: 'Setup Temurin JDK 8, 11, 17 & 21' | ||
| - name: "Setup Temurin JDK 8, 11, 17 & 21" | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| distribution: 'temurin' | ||
| distribution: "temurin" | ||
| java-version: | | ||
| 8 | ||
| 11 | ||
| 17 | ||
| 21 | ||
|
|
||
| - name: 'Setup Maven 3.9.11' | ||
| - name: "Setup Maven 3.9.11" | ||
| uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5 | ||
| with: | ||
| maven-version: 3.9.11 | ||
|
|
@@ -153,7 +155,7 @@ jobs: | |
| run: mvn -B -P interop-data-generate generate-resources | ||
|
|
||
| - name: Generate Interop Data | ||
| run: ./build.sh interop-data-generate | ||
| run: uv run ./build.sh interop-data-generate | ||
|
|
||
| - name: Run Interop Tests | ||
| run: ./build.sh interop-data-test | ||
| run: uv run ./build.sh interop-data-test | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -322,7 +322,7 @@ def respond(self, call_request): | |||||
| else: | ||||||
| writers_schema = local_message.errors | ||||||
| self.write_error(writers_schema, error, buffer_encoder) | ||||||
| except schema.AvroException as e: | ||||||
| except avro.schema.AvroException as e: | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check if AvroException is defined or re-exported in avro/schema.py
echo "=== Definitions of AvroException in avro/schema.py ==="
rg -n "AvroException" --type py lang/py/avro/schema.py
echo ""
echo "=== All AvroException references in lang/py/avro/ipc.py ==="
rg -n "AvroException" --type py lang/py/avro/ipc.py
echo ""
echo "=== AvroException defined in avro/errors.py ==="
rg -n "class AvroException" --type py lang/py/avro/errors.py
echo ""
echo "=== Check imports at top of ipc.py ==="
head -35 lang/py/avro/ipc.py | grep -E "^(import|from)"Repository: martin-augment/avro Length of output: 1323 Change Every other Fix- except avro.schema.AvroException as e:
+ except avro.errors.AvroException as e:📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. value:useful; category:bug; feedback: The CodeRabbit AI reviewer is correct! The package name of the AvroException is wrong and it should be fixed to use |
||||||
| error = avro.errors.AvroRemoteException(str(e)) | ||||||
| buffer_encoder = avro.io.BinaryEncoder(io.BytesIO()) | ||||||
| META_WRITER.write(response_metadata, buffer_encoder) | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
astral-sh/setup-uv latest version GitHub releases 2025💡 Result:
setup-uvinstalls): the latest 2025 GitHub Release is 0.9.21 (released 2025-12-30, marked Latest). [2]Sources: [1] [2]
🌐 Web query:
astral-sh/setup-uv v7 changelog working-directory support improvements💡 Result:
In astral-sh/setup-uv v7, the notable working-directory improvement landed in v7.1.1 (Oct 19, 2024): it fixed a bug where the
working-directoryinput was not used when detecting an empty working directory (“empty workdir detection”). [1]As documented for v7,
working-directoryis intended to control where the action looks forpyproject.toml,uv.toml, and.python-version(used to decide which uv/Python to install), and it also controls where the venv gets created. [2]Sources: [1] [2]
🏁 Script executed:
Repository: martin-augment/avro
Length of output: 979
🌐 Web query:
astral-sh/setup-uv action recommended usage version input parameter best practice💡 Result:
Best practice: pin uv to a specific version in CI (don’t rely on “latest”) by setting the action’s
version:input. [1][1]
Recommended ways to manage the uv version (highest → lowest “policy as code”):
Prefer declaring the required uv version in-repo (so local dev + CI match). If you omit
with: version, the action will look forrequired-versioninuv.tomlorpyproject.toml(repo root); if none is found, it installs the latest uv. [2]If you need CI to read the version from a specific file/location, use
version-file:(otherwise it defaults to searchinguv.tomlthenpyproject.toml). [2]If you use a version range, control how it resolves with
resolution-strategy: "highest"(default) or"lowest". [2]astral-sh/setup-uv@v6is outdated — upgrade to@v7.The latest version is
v7.1.6(Dec 13, 2025). Additionally, best practice is to explicitly pin theuvtool version via theversion:input. This can be set directly in the action or declared inuv.toml/pyproject.tomlunderrequired-versionso that CI and local development use the same version:⬆️ Proposed update
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value:good-to-have; category:bug; feedback: The CodeRabbit AI reviewer is correct! The Github Action has a newer version that should be used instead of v6. v7 has some bug fixes and several improvements over v6.