snazy commented on code in PR #3036:
URL: https://github.com/apache/polaris/pull/3036#discussion_r2598150574


##########
.github/workflows/python-client-build-artifacts.yml:
##########
@@ -0,0 +1,122 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: "Python Client Build Artifacts"
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: 'Version to set (optional, e.g. 1.1.0 or 1.1.0rc1 or 
dev-20251202-abc1234)'
+        type: string
+        required: false
+  workflow_call:
+    inputs:
+      version:
+        description: 'Version to set (optional)'
+        type: string
+        required: false
+  pull_request:
+    paths:
+      - '.github/workflows/python-client-build-artifacts.yml'
+      - 'client/python/**'
+
+jobs:
+  build-artifacts:
+    name: Build artifacts on ${{ matrix.os }}
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ ubuntu-24.04, macos-14, macos-15] # current build script is not 
compatible with windows
+
+    steps:
+      - uses: actions/checkout@v5
+        with:
+          fetch-depth: 1
+
+      - name: Set up Python
+        uses: actions/setup-python@v6
+        with:
+          python-version: |
+            3.10
+            3.11
+            3.12
+            3.13
+      - name: Set up JDK for openapi-generator-cli
+        uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
+        with:
+          distribution: 'temurin'
+          java-version: '21'
+
+      - name: Set version (if provided)
+        if: inputs.version != ''
+        env:
+          VERSION: ${{ inputs.version }}
+        run: make client-set-version VERSION="${{ env.VERSION }}"
+
+      - name: Build source distribution
+        run: |
+          make client-build FORMAT=sdist
+
+      - name: Build wheels
+        uses: pypa/[email protected]
+        with:
+          output-dir: wheelhouse
+          package-dir: "./client/python"
+          config-file: "{package}/pyproject.toml"
+        env:
+          # Ignore 32 bit architectures
+          CIBW_ARCHS: "auto64"
+          CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10,<3.14"

Review Comment:
   How does this correlate to `actions/setup-python`  ?



##########
.github/workflows/python-client-build-artifacts.yml:
##########
@@ -0,0 +1,122 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: "Python Client Build Artifacts"
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: 'Version to set (optional, e.g. 1.1.0 or 1.1.0rc1 or 
dev-20251202-abc1234)'
+        type: string
+        required: false
+  workflow_call:
+    inputs:
+      version:
+        description: 'Version to set (optional)'
+        type: string
+        required: false
+  pull_request:
+    paths:
+      - '.github/workflows/python-client-build-artifacts.yml'
+      - 'client/python/**'
+
+jobs:
+  build-artifacts:
+    name: Build artifacts on ${{ matrix.os }}
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ ubuntu-24.04, macos-14, macos-15] # current build script is not 
compatible with windows
+
+    steps:
+      - uses: actions/checkout@v5
+        with:
+          fetch-depth: 1
+
+      - name: Set up Python
+        uses: actions/setup-python@v6
+        with:
+          python-version: |
+            3.10
+            3.11
+            3.12
+            3.13

Review Comment:
   The PR description mentions wheels built for Python 3.9.
   I'm confused seeing this one.



##########
client/python/generate_clients.py:
##########
@@ -369,6 +324,9 @@ def main():
     else:
         logging.basicConfig(level=logging.INFO, format="%(message)s")
 
+    if os.environ.get("POLARIS_CLI_SKIP_CLIENT_GENERATION", "false").lower() 
== "true":
+        logger.info("POLARIS_CLI_SKIP_CLIENT_GENERATION is set to true, 
skipping client generation.")

Review Comment:
   This worries me, as the build is not the same.



##########
.github/workflows/python-client-build-artifacts.yml:
##########
@@ -0,0 +1,122 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: "Python Client Build Artifacts"
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: 'Version to set (optional, e.g. 1.1.0 or 1.1.0rc1 or 
dev-20251202-abc1234)'
+        type: string
+        required: false
+  workflow_call:
+    inputs:
+      version:
+        description: 'Version to set (optional)'
+        type: string
+        required: false
+  pull_request:
+    paths:
+      - '.github/workflows/python-client-build-artifacts.yml'
+      - 'client/python/**'
+
+jobs:
+  build-artifacts:
+    name: Build artifacts on ${{ matrix.os }}
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ ubuntu-24.04, macos-14, macos-15] # current build script is not 
compatible with windows
+
+    steps:
+      - uses: actions/checkout@v5
+        with:
+          fetch-depth: 1
+
+      - name: Set up Python
+        uses: actions/setup-python@v6
+        with:
+          python-version: |
+            3.10
+            3.11
+            3.12
+            3.13
+      - name: Set up JDK for openapi-generator-cli
+        uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
+        with:
+          distribution: 'temurin'
+          java-version: '21'
+
+      - name: Set version (if provided)
+        if: inputs.version != ''
+        env:
+          VERSION: ${{ inputs.version }}
+        run: make client-set-version VERSION="${{ env.VERSION }}"
+
+      - name: Build source distribution
+        run: |
+          make client-build FORMAT=sdist
+
+      - name: Build wheels
+        uses: pypa/[email protected]

Review Comment:
   Actions in ASF workflows _must_ reference the Git SHA of an ASF-approved 
version of the action, see [this 
policy](https://infra.apache.org/github-actions-policy.html).



##########
.github/workflows/python-client-build-artifacts.yml:
##########
@@ -0,0 +1,122 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: "Python Client Build Artifacts"
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: 'Version to set (optional, e.g. 1.1.0 or 1.1.0rc1 or 
dev-20251202-abc1234)'
+        type: string
+        required: false
+  workflow_call:
+    inputs:
+      version:
+        description: 'Version to set (optional)'
+        type: string
+        required: false
+  pull_request:
+    paths:
+      - '.github/workflows/python-client-build-artifacts.yml'
+      - 'client/python/**'
+
+jobs:
+  build-artifacts:
+    name: Build artifacts on ${{ matrix.os }}
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ ubuntu-24.04, macos-14, macos-15] # current build script is not 
compatible with windows

Review Comment:
   Is there anything that's performance critical in the Python package?
   I'd prefer to not build native code.



##########
.github/workflows/python-client-build-artifacts.yml:
##########
@@ -0,0 +1,122 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: "Python Client Build Artifacts"
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: 'Version to set (optional, e.g. 1.1.0 or 1.1.0rc1 or 
dev-20251202-abc1234)'
+        type: string
+        required: false
+  workflow_call:
+    inputs:
+      version:
+        description: 'Version to set (optional)'
+        type: string
+        required: false
+  pull_request:
+    paths:
+      - '.github/workflows/python-client-build-artifacts.yml'
+      - 'client/python/**'
+
+jobs:
+  build-artifacts:
+    name: Build artifacts on ${{ matrix.os }}
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ ubuntu-24.04, macos-14, macos-15] # current build script is not 
compatible with windows
+
+    steps:
+      - uses: actions/checkout@v5
+        with:
+          fetch-depth: 1
+
+      - name: Set up Python
+        uses: actions/setup-python@v6
+        with:
+          python-version: |
+            3.10
+            3.11
+            3.12
+            3.13
+      - name: Set up JDK for openapi-generator-cli
+        uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
+        with:
+          distribution: 'temurin'
+          java-version: '21'
+
+      - name: Set version (if provided)
+        if: inputs.version != ''
+        env:
+          VERSION: ${{ inputs.version }}
+        run: make client-set-version VERSION="${{ env.VERSION }}"
+
+      - name: Build source distribution
+        run: |
+          make client-build FORMAT=sdist
+
+      - name: Build wheels
+        uses: pypa/[email protected]
+        with:
+          output-dir: wheelhouse
+          package-dir: "./client/python"
+          config-file: "{package}/pyproject.toml"
+        env:
+          # Ignore 32 bit architectures
+          CIBW_ARCHS: "auto64"
+          CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10,<3.14"
+          CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" # Disable wheel repair since 
there will be no binary in the wheel
+          CIBW_REPAIR_WHEEL_COMMAND_LINUX: ""
+          CIBW_ENVIRONMENT: POLARIS_CLI_SKIP_CLIENT_GENERATION="true" # java 
is not available in linux containers during wheel build, skip client generation
+
+      - name: Add source distribution
+        if: startsWith(matrix.os, 'ubuntu-24.04')
+        run: ls -lah ./client/python/dist/* && cp ./client/python/dist/* 
wheelhouse/
+
+      - uses: actions/upload-artifact@v4
+        with:
+          name: "python-client-artifacts-${{ matrix.os }}"
+          path: ./wheelhouse/*
+
+  merge-artifacts:
+    runs-on: ubuntu-latest
+    needs:
+      - build-artifacts
+    steps:
+      - name: Generate artifact name
+        id: artifact-name
+        run: |
+          if [ -n "${{ inputs.version }}" ]; then
+            ARTIFACT_NAME="python-client-artifacts-${{ inputs.version }}"

Review Comment:
   What's the reason for this special case?



##########
.github/workflows/python-client-build-artifacts.yml:
##########
@@ -0,0 +1,122 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: "Python Client Build Artifacts"
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: 'Version to set (optional, e.g. 1.1.0 or 1.1.0rc1 or 
dev-20251202-abc1234)'
+        type: string
+        required: false
+  workflow_call:
+    inputs:
+      version:
+        description: 'Version to set (optional)'
+        type: string
+        required: false
+  pull_request:
+    paths:
+      - '.github/workflows/python-client-build-artifacts.yml'
+      - 'client/python/**'
+
+jobs:
+  build-artifacts:
+    name: Build artifacts on ${{ matrix.os }}
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ ubuntu-24.04, macos-14, macos-15] # current build script is not 
compatible with windows
+
+    steps:
+      - uses: actions/checkout@v5
+        with:
+          fetch-depth: 1
+
+      - name: Set up Python
+        uses: actions/setup-python@v6
+        with:
+          python-version: |
+            3.10
+            3.11
+            3.12
+            3.13
+      - name: Set up JDK for openapi-generator-cli
+        uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
+        with:
+          distribution: 'temurin'
+          java-version: '21'
+
+      - name: Set version (if provided)
+        if: inputs.version != ''
+        env:
+          VERSION: ${{ inputs.version }}
+        run: make client-set-version VERSION="${{ env.VERSION }}"
+
+      - name: Build source distribution
+        run: |
+          make client-build FORMAT=sdist
+
+      - name: Build wheels
+        uses: pypa/[email protected]

Review Comment:
   The action docs mention that the wheels can [contain libraries from the 
build 
container](https://github.com/pypa/cibuildwheel/?tab=readme-ov-file#legal-note).
   Which ones are included and what are the licenses for those libraries?
   



##########
.github/workflows/python-client-build-artifacts.yml:
##########
@@ -0,0 +1,122 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: "Python Client Build Artifacts"
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: 'Version to set (optional, e.g. 1.1.0 or 1.1.0rc1 or 
dev-20251202-abc1234)'
+        type: string
+        required: false
+  workflow_call:
+    inputs:
+      version:
+        description: 'Version to set (optional)'
+        type: string
+        required: false
+  pull_request:
+    paths:
+      - '.github/workflows/python-client-build-artifacts.yml'
+      - 'client/python/**'

Review Comment:
   I thought this WF is just for nightly builds?
   I'm confused about the need for a "version" input and that the WF is 
triggered by PRs.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to