This is an automated email from the ASF dual-hosted git repository.

fokko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/main by this push:
     new da76b873fa open-api: use uv and python virtual env (#14684)
da76b873fa is described below

commit da76b873fad9b87c76eed1e91185e7b9fcb9a7f8
Author: Kevin Liu <[email protected]>
AuthorDate: Tue Dec 2 10:49:07 2025 -0800

    open-api: use uv and python virtual env (#14684)
    
    * use uv
    
    * use 3.12
    
    * pin to python 3.12
    
    * fix github action
    
    * consolidate in make lint
---
 .github/workflows/open-api.yml | 10 +++-------
 open-api/Makefile              | 12 +++++++-----
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/open-api.yml b/.github/workflows/open-api.yml
index b20aef0fa6..dedae02067 100644
--- a/.github/workflows/open-api.yml
+++ b/.github/workflows/open-api.yml
@@ -42,10 +42,9 @@ jobs:
 
     steps:
       - uses: actions/checkout@v6
-      - uses: actions/setup-python@v6
-        with:
-          python-version: 3.9
-      - name: Install
+      - name: Install uv
+        uses: astral-sh/setup-uv@v7
+      - name: Install dependencies
         working-directory: ./open-api
         run: make install
       - name: Validate REST catalog spec
@@ -57,6 +56,3 @@ jobs:
       - name: Check if code is up to date
         working-directory: ./open-api
         run: git diff --exit-code
-      - name: Validate S3 REST Signer spec
-        working-directory: ./aws/src/main/resources
-        run: openapi-spec-validator s3-signer-open-api.yaml
diff --git a/open-api/Makefile b/open-api/Makefile
index 6bf7365f2a..c9795ac22a 100644
--- a/open-api/Makefile
+++ b/open-api/Makefile
@@ -16,15 +16,17 @@
 # under the License.
 
 install:
-       pip install -r requirements.txt
+       uv venv --python 3.12 --allow-existing  # Match --target-python-version 
in the `generate` target
+       uv pip install -r requirements.txt
 
 lint:
-       openapi-spec-validator --errors all rest-catalog-open-api.yaml
+       uv run openapi-spec-validator --errors all rest-catalog-open-api.yaml
+       uv run openapi-spec-validator --errors all 
../aws/src/main/resources/s3-signer-open-api.yaml
 
 generate:
-       datamodel-codegen \
-                --enum-field-as-literal all \
-               --target-python-version 3.9 \
+       uv run datamodel-codegen \
+                       --enum-field-as-literal all \
+               --target-python-version 3.12 \
                --use-schema-description \
                --field-constraints \
                --input rest-catalog-open-api.yaml \

Reply via email to