From 79fdef416d443605e1abaa2e966cd0b87d49399d Mon Sep 17 00:00:00 2001 From: Honah J Date: Tue, 11 Nov 2025 15:49:08 -0600 Subject: [PATCH 01/11] Add artifact build pipeline --- .../python-client-release-pypi-artifact.yml | 107 +++++++++++++++ .../python-client-release-svn-artifact.yml | 99 ++++++++++++++ .github/workflows/python-release-build.yml | 128 ++++++++++++++++++ Makefile | 10 ++ client/python/apache_polaris/sdk/__init__.py | 19 --- client/python/generate_clients.py | 3 + 6 files changed, 347 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/python-client-release-pypi-artifact.yml create mode 100644 .github/workflows/python-client-release-svn-artifact.yml create mode 100644 .github/workflows/python-release-build.yml diff --git a/.github/workflows/python-client-release-pypi-artifact.yml b/.github/workflows/python-client-release-pypi-artifact.yml new file mode 100644 index 0000000000..4c72e2c4b5 --- /dev/null +++ b/.github/workflows/python-client-release-pypi-artifact.yml @@ -0,0 +1,107 @@ +# +# 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. +# + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: "Build Python Client Release Pypi Artifacts" + +on: + workflow_call: + inputs: + VERSION: + required: true + type: string + +jobs: + pypi-build-artifacts: + name: Build artifacts for SVN 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 with RC + run: + + - name: Set version with RC + 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/cibuildwheel@v3.1.4 + 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.9,<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-pypi-release-candidate-${{ matrix.os }}" + path: ./wheelhouse/* + + pypi-merge-artifacts: + runs-on: ubuntu-latest + needs: + - pypi-build-artifacts + steps: + - name: Merge Artifacts + uses: actions/upload-artifact/merge@v4 + with: + name: "python-client-pypi-release-candidate-${{ inputs.VERSION }}" + pattern: python-client-pypi-release-candidate* + delete-merged: true diff --git a/.github/workflows/python-client-release-svn-artifact.yml b/.github/workflows/python-client-release-svn-artifact.yml new file mode 100644 index 0000000000..15dcc14ed5 --- /dev/null +++ b/.github/workflows/python-client-release-svn-artifact.yml @@ -0,0 +1,99 @@ +# +# 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. +# + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: "Build Python Client Release SVN Artifacts" + +on: + workflow_call: + inputs: + VERSION: + required: true + type: string + +jobs: + svn-build-artifacts: + name: Build artifacts for SVN 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: Build source distribution + run: | + make client-build FORMAT=sdist + + - name: Build wheels + uses: pypa/cibuildwheel@v3.1.4 + 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.9,<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-svn-release-candidate-${{ matrix.os }}" + path: ./wheelhouse/* + + svn-merge-artifacts: + runs-on: ubuntu-latest + needs: + - svn-build-artifacts + steps: + - name: Merge Artifacts + uses: actions/upload-artifact/merge@v4 + with: + name: "python-client-svn-release-candidate-${{ inputs.VERSION }}" + pattern: python-client-svn-release-candidate* + delete-merged: true diff --git a/.github/workflows/python-release-build.yml b/.github/workflows/python-release-build.yml new file mode 100644 index 0000000000..cd0b22207b --- /dev/null +++ b/.github/workflows/python-release-build.yml @@ -0,0 +1,128 @@ +# +# 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. +# + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: "Python Client Build Release Candidate" + +on: + workflow_dispatch: + inputs: + version: + description: 'Version (e.g. 1.1.0)' + type: string + required: true + rc: + description: 'Release Candidate (RC) (e.g. 1)' + type: number + required: true + pull_request: + paths: + - '.github/workflows/python-release-build.yml' + - '.github/workflows/python-client-release-svn-artifact.yml' + - 'client/python/**' + +jobs: + validate-inputs: + runs-on: ubuntu-latest + outputs: + VERSION: ${{ steps.validate-inputs.outputs.VERSION }} + RC: ${{ steps.validate-inputs.outputs.RC }} + steps: + - name: Validate Version and RC + id: validate-inputs + run: | + # Use test values for pull_request trigger, actual inputs for workflow_dispatch + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + echo "Workflow triggered by pull_request - using test values" + VERSION="1.2.0" + RC="1" + else + echo "Workflow triggered manually via workflow_dispatch." + VERSION="${{ github.event.inputs.version }}" + RC="${{ github.event.inputs.rc }}" + fi + + # Validate version (e.g., 1.0.0) + if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Error: version ($VERSION) must be in the format: .." + exit 1 + fi + # Validate rc (e.g., 1) + if [[ ! "$RC" =~ ^[0-9]+$ ]]; then + echo "Error: rc ($RC) must be in the format: " + exit 1 + fi + + # Export variables for future steps + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + echo "RC=$RC" >> $GITHUB_OUTPUT + - name: Display Extracted Version and RC + run: | + echo "Using Version: ${{ steps.validate-inputs.outputs.VERSION }}" + echo "Using RC: ${{ steps.validate-inputs.outputs.RC }}" + validate-client-version: + runs-on: ubuntu-latest + needs: + - validate-inputs + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 1 + + - uses: actions/setup-python@v6 + with: + python-version: 3.12 + + - name: Setup Environment + run: | + export POETRY_VERSION=$(cat client/python/pyproject.toml | grep requires-poetry | sed 's/requires-poetry *= *"\(.*\)"/\1/') + python3 -m pip install poetry$POETRY_VERSION + - name: Validate Current Client Version + working-directory: ./client/python + env: + VERSION: ${{ needs.validate-inputs.outputs.VERSION }} + run: | + current_polaris_client_version=$(poetry version --short) + echo "Detected Poetry version: $current_polaris_client_version" + + # Compare the input version with the Poetry version + if [[ "$VERSION" != "$current_polaris_client_version" ]]; then + echo "Error: Input version ($VERSION) does not match the Poetry version ($current_polaris_client_version)" + exit 1 + fi + + svn-build-artifacts: + needs: + - validate-inputs + - validate-client-version + uses: ./.github/workflows/python-client-release-svn-artifact.yml + with: + VERSION: ${{ needs.validate-inputs.outputs.VERSION }}rc${{ needs.validate-inputs.outputs.RC }} + + pypi-build-artifacts: + needs: + - validate-inputs + - validate-client-version + uses: ./.github/workflows/python-client-release-pypi-artifact.yml + with: + VERSION: ${{ needs.validate-inputs.outputs.VERSION }}rc${{ needs.validate-inputs.outputs.RC }} diff --git a/Makefile b/Makefile index 64ee9756fc..a203897910 100644 --- a/Makefile +++ b/Makefile @@ -131,6 +131,16 @@ client-lint: client-setup-env ## Run linting checks for Polaris client @$(ACTIVATE_AND_CD) && poetry run pre-commit run --files integration_tests/* generate_clients.py apache_polaris/cli/* apache_polaris/cli/command/* apache_polaris/cli/options/* test/* @echo "--- Client linting checks complete ---" +.PHONY: client-set-version +client-set-version: client-setup-env ## Set Python client version using poetry. Usage: make client-set-version VERSION= + @echo "--- Setting client version ---" + @if [ -z "$(VERSION)" ]; then \ + echo "Error: VERSION is required. Usage: make client-set-version VERSION=" >&2; \ + exit 1; \ + fi + @$(ACTIVATE_AND_CD) && poetry version "$(VERSION)" + @echo "--- Client version set to $(VERSION) ---" + .PHONY: client-regenerate client-regenerate: client-setup-env ## Regenerate the client code @echo "--- Regenerating client code ---" diff --git a/client/python/apache_polaris/sdk/__init__.py b/client/python/apache_polaris/sdk/__init__.py index d8a500d9d8..e69de29bb2 100644 --- a/client/python/apache_polaris/sdk/__init__.py +++ b/client/python/apache_polaris/sdk/__init__.py @@ -1,19 +0,0 @@ -# -# 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. -# - diff --git a/client/python/generate_clients.py b/client/python/generate_clients.py index 2fe0245647..88bfc9cbb2 100644 --- a/client/python/generate_clients.py +++ b/client/python/generate_clients.py @@ -363,6 +363,9 @@ def main() -> None: 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.") + return build() From 2b1d3dceee6703cda5ccfd18c444bba8769d5245 Mon Sep 17 00:00:00 2001 From: Honah J Date: Wed, 12 Nov 2025 19:05:07 -0600 Subject: [PATCH 02/11] fix license --- .../python-client-release-pypi-artifact.yml | 5 ----- .../python-client-release-svn-artifact.yml | 5 ----- .github/workflows/python-release-build.yml | 5 ----- client/python/apache_polaris/sdk/__init__.py | 18 ++++++++++++++++++ 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/python-client-release-pypi-artifact.yml b/.github/workflows/python-client-release-pypi-artifact.yml index 4c72e2c4b5..75b6795a60 100644 --- a/.github/workflows/python-client-release-pypi-artifact.yml +++ b/.github/workflows/python-client-release-pypi-artifact.yml @@ -17,11 +17,6 @@ # under the License. # -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - name: "Build Python Client Release Pypi Artifacts" on: diff --git a/.github/workflows/python-client-release-svn-artifact.yml b/.github/workflows/python-client-release-svn-artifact.yml index 15dcc14ed5..e72ce8051c 100644 --- a/.github/workflows/python-client-release-svn-artifact.yml +++ b/.github/workflows/python-client-release-svn-artifact.yml @@ -17,11 +17,6 @@ # under the License. # -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - name: "Build Python Client Release SVN Artifacts" on: diff --git a/.github/workflows/python-release-build.yml b/.github/workflows/python-release-build.yml index cd0b22207b..538b7168e9 100644 --- a/.github/workflows/python-release-build.yml +++ b/.github/workflows/python-release-build.yml @@ -17,11 +17,6 @@ # under the License. # -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - name: "Python Client Build Release Candidate" on: diff --git a/client/python/apache_polaris/sdk/__init__.py b/client/python/apache_polaris/sdk/__init__.py index e69de29bb2..fe95886d5c 100644 --- a/client/python/apache_polaris/sdk/__init__.py +++ b/client/python/apache_polaris/sdk/__init__.py @@ -0,0 +1,18 @@ +# +# 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. +# From 46d1e7746f74ef0185ce94aaface1d40559a50c2 Mon Sep 17 00:00:00 2001 From: Honah J Date: Tue, 18 Nov 2025 22:05:56 -0600 Subject: [PATCH 03/11] Fix format --- client/python/apache_polaris/sdk/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/python/apache_polaris/sdk/__init__.py b/client/python/apache_polaris/sdk/__init__.py index fe95886d5c..d8a500d9d8 100644 --- a/client/python/apache_polaris/sdk/__init__.py +++ b/client/python/apache_polaris/sdk/__init__.py @@ -16,3 +16,4 @@ # specific language governing permissions and limitations # under the License. # + From 87d64098f6866be4e2aca59501d319faf59d2e68 Mon Sep 17 00:00:00 2001 From: Honah J Date: Wed, 19 Nov 2025 21:38:26 -0600 Subject: [PATCH 04/11] Fix nit and format issue --- .github/workflows/python-client-release-pypi-artifact.yml | 8 ++------ .github/workflows/python-client-release-svn-artifact.yml | 3 +-- .github/workflows/python-release-build.yml | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python-client-release-pypi-artifact.yml b/.github/workflows/python-client-release-pypi-artifact.yml index 75b6795a60..4874d998bb 100644 --- a/.github/workflows/python-client-release-pypi-artifact.yml +++ b/.github/workflows/python-client-release-pypi-artifact.yml @@ -17,7 +17,7 @@ # under the License. # -name: "Build Python Client Release Pypi Artifacts" +name: "Build Python Client Release PyPI Artifacts" on: workflow_call: @@ -53,9 +53,6 @@ jobs: distribution: 'temurin' java-version: '21' - - name: Set version with RC - run: - - name: Set version with RC env: VERSION: ${{ inputs.VERSION }} @@ -74,7 +71,7 @@ jobs: env: # Ignore 32 bit architectures CIBW_ARCHS: "auto64" - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9,<3.14" + 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 @@ -83,7 +80,6 @@ jobs: 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-pypi-release-candidate-${{ matrix.os }}" diff --git a/.github/workflows/python-client-release-svn-artifact.yml b/.github/workflows/python-client-release-svn-artifact.yml index e72ce8051c..e6602a5adb 100644 --- a/.github/workflows/python-client-release-svn-artifact.yml +++ b/.github/workflows/python-client-release-svn-artifact.yml @@ -66,7 +66,7 @@ jobs: env: # Ignore 32 bit architectures CIBW_ARCHS: "auto64" - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9,<3.14" + 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 @@ -75,7 +75,6 @@ jobs: 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-svn-release-candidate-${{ matrix.os }}" diff --git a/.github/workflows/python-release-build.yml b/.github/workflows/python-release-build.yml index 538b7168e9..0034422af0 100644 --- a/.github/workflows/python-release-build.yml +++ b/.github/workflows/python-release-build.yml @@ -101,7 +101,7 @@ jobs: echo "Detected Poetry version: $current_polaris_client_version" # Compare the input version with the Poetry version - if [[ "$VERSION" != "$current_polaris_client_version" ]]; then + if [[ "$VERSION" != "$current_polaris_client_version" && "${github_event_name}" != "pull_request" ]]; then echo "Error: Input version ($VERSION) does not match the Poetry version ($current_polaris_client_version)" exit 1 fi From de01a6c49f45ce85f987cda6abc9d81707fa1eab Mon Sep 17 00:00:00 2001 From: Honah J Date: Mon, 1 Dec 2025 21:13:55 -0600 Subject: [PATCH 05/11] Simplify build file --- ....yml => python-client-build-artifacts.yml} | 48 +++++-- .../python-client-release-svn-artifact.yml | 93 ------------- .github/workflows/python-release-build.yml | 123 ------------------ 3 files changed, 36 insertions(+), 228 deletions(-) rename .github/workflows/{python-client-release-pypi-artifact.yml => python-client-build-artifacts.yml} (68%) delete mode 100644 .github/workflows/python-client-release-svn-artifact.yml delete mode 100644 .github/workflows/python-release-build.yml diff --git a/.github/workflows/python-client-release-pypi-artifact.yml b/.github/workflows/python-client-build-artifacts.yml similarity index 68% rename from .github/workflows/python-client-release-pypi-artifact.yml rename to .github/workflows/python-client-build-artifacts.yml index 4874d998bb..a9df8a9e08 100644 --- a/.github/workflows/python-client-release-pypi-artifact.yml +++ b/.github/workflows/python-client-build-artifacts.yml @@ -17,18 +17,29 @@ # under the License. # -name: "Build Python Client Release PyPI Artifacts" +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: - required: true + version: + description: 'Version to set (optional)' type: string + required: false + pull_request: + paths: + - '.github/workflows/python-client-build-artifacts.yml' + - 'client/python/**' jobs: - pypi-build-artifacts: - name: Build artifacts for SVN on ${{ matrix.os }} + build-artifacts: + name: Build artifacts on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -53,9 +64,10 @@ jobs: distribution: 'temurin' java-version: '21' - - name: Set version with RC + - name: Set version (if provided) + if: inputs.version != '' env: - VERSION: ${{ inputs.VERSION }} + VERSION: ${{ inputs.version }} run: make client-set-version VERSION="${{ env.VERSION }}" - name: Build source distribution @@ -82,17 +94,29 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: "python-client-pypi-release-candidate-${{ matrix.os }}" + name: "python-client-artifacts-${{ matrix.os }}" path: ./wheelhouse/* - pypi-merge-artifacts: + merge-artifacts: runs-on: ubuntu-latest needs: - - pypi-build-artifacts + - build-artifacts steps: + - name: Generate artifact name + id: artifact-name + run: | + if [ -n "${{ inputs.version }}" ]; then + ARTIFACT_NAME="python-client-artifacts-${{ inputs.version }}" + else + ARTIFACT_NAME="python-client-artifacts-${{ github.run_id }}" + fi + echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_OUTPUT + echo "Using artifact name: $ARTIFACT_NAME" + - name: Merge Artifacts uses: actions/upload-artifact/merge@v4 with: - name: "python-client-pypi-release-candidate-${{ inputs.VERSION }}" - pattern: python-client-pypi-release-candidate* + name: ${{ steps.artifact-name.outputs.ARTIFACT_NAME }} + pattern: python-client-artifacts-* delete-merged: true + diff --git a/.github/workflows/python-client-release-svn-artifact.yml b/.github/workflows/python-client-release-svn-artifact.yml deleted file mode 100644 index e6602a5adb..0000000000 --- a/.github/workflows/python-client-release-svn-artifact.yml +++ /dev/null @@ -1,93 +0,0 @@ -# -# 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: "Build Python Client Release SVN Artifacts" - -on: - workflow_call: - inputs: - VERSION: - required: true - type: string - -jobs: - svn-build-artifacts: - name: Build artifacts for SVN 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: Build source distribution - run: | - make client-build FORMAT=sdist - - - name: Build wheels - uses: pypa/cibuildwheel@v3.1.4 - 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-svn-release-candidate-${{ matrix.os }}" - path: ./wheelhouse/* - - svn-merge-artifacts: - runs-on: ubuntu-latest - needs: - - svn-build-artifacts - steps: - - name: Merge Artifacts - uses: actions/upload-artifact/merge@v4 - with: - name: "python-client-svn-release-candidate-${{ inputs.VERSION }}" - pattern: python-client-svn-release-candidate* - delete-merged: true diff --git a/.github/workflows/python-release-build.yml b/.github/workflows/python-release-build.yml deleted file mode 100644 index 0034422af0..0000000000 --- a/.github/workflows/python-release-build.yml +++ /dev/null @@ -1,123 +0,0 @@ -# -# 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 Release Candidate" - -on: - workflow_dispatch: - inputs: - version: - description: 'Version (e.g. 1.1.0)' - type: string - required: true - rc: - description: 'Release Candidate (RC) (e.g. 1)' - type: number - required: true - pull_request: - paths: - - '.github/workflows/python-release-build.yml' - - '.github/workflows/python-client-release-svn-artifact.yml' - - 'client/python/**' - -jobs: - validate-inputs: - runs-on: ubuntu-latest - outputs: - VERSION: ${{ steps.validate-inputs.outputs.VERSION }} - RC: ${{ steps.validate-inputs.outputs.RC }} - steps: - - name: Validate Version and RC - id: validate-inputs - run: | - # Use test values for pull_request trigger, actual inputs for workflow_dispatch - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - echo "Workflow triggered by pull_request - using test values" - VERSION="1.2.0" - RC="1" - else - echo "Workflow triggered manually via workflow_dispatch." - VERSION="${{ github.event.inputs.version }}" - RC="${{ github.event.inputs.rc }}" - fi - - # Validate version (e.g., 1.0.0) - if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Error: version ($VERSION) must be in the format: .." - exit 1 - fi - # Validate rc (e.g., 1) - if [[ ! "$RC" =~ ^[0-9]+$ ]]; then - echo "Error: rc ($RC) must be in the format: " - exit 1 - fi - - # Export variables for future steps - echo "VERSION=$VERSION" >> $GITHUB_OUTPUT - echo "RC=$RC" >> $GITHUB_OUTPUT - - name: Display Extracted Version and RC - run: | - echo "Using Version: ${{ steps.validate-inputs.outputs.VERSION }}" - echo "Using RC: ${{ steps.validate-inputs.outputs.RC }}" - validate-client-version: - runs-on: ubuntu-latest - needs: - - validate-inputs - steps: - - uses: actions/checkout@v5 - with: - fetch-depth: 1 - - - uses: actions/setup-python@v6 - with: - python-version: 3.12 - - - name: Setup Environment - run: | - export POETRY_VERSION=$(cat client/python/pyproject.toml | grep requires-poetry | sed 's/requires-poetry *= *"\(.*\)"/\1/') - python3 -m pip install poetry$POETRY_VERSION - - name: Validate Current Client Version - working-directory: ./client/python - env: - VERSION: ${{ needs.validate-inputs.outputs.VERSION }} - run: | - current_polaris_client_version=$(poetry version --short) - echo "Detected Poetry version: $current_polaris_client_version" - - # Compare the input version with the Poetry version - if [[ "$VERSION" != "$current_polaris_client_version" && "${github_event_name}" != "pull_request" ]]; then - echo "Error: Input version ($VERSION) does not match the Poetry version ($current_polaris_client_version)" - exit 1 - fi - - svn-build-artifacts: - needs: - - validate-inputs - - validate-client-version - uses: ./.github/workflows/python-client-release-svn-artifact.yml - with: - VERSION: ${{ needs.validate-inputs.outputs.VERSION }}rc${{ needs.validate-inputs.outputs.RC }} - - pypi-build-artifacts: - needs: - - validate-inputs - - validate-client-version - uses: ./.github/workflows/python-client-release-pypi-artifact.yml - with: - VERSION: ${{ needs.validate-inputs.outputs.VERSION }}rc${{ needs.validate-inputs.outputs.RC }} From 6557cce746ccbcf1f8a98d1dc75c050881ce3b89 Mon Sep 17 00:00:00 2001 From: Honah J Date: Thu, 11 Dec 2025 10:56:23 -0600 Subject: [PATCH 06/11] Remove the need of cibuildwheel --- .../python-client-build-artifacts.yml | 40 ++++++++----------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/.github/workflows/python-client-build-artifacts.yml b/.github/workflows/python-client-build-artifacts.yml index a9df8a9e08..19db296c5b 100644 --- a/.github/workflows/python-client-build-artifacts.yml +++ b/.github/workflows/python-client-build-artifacts.yml @@ -39,25 +39,23 @@ on: jobs: build-artifacts: - name: Build artifacts on ${{ matrix.os }} + name: Build artifacts on ${{ matrix.os }} with Python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} strategy: matrix: os: [ ubuntu-24.04, macos-14, macos-15] # current build script is not compatible with windows + python-version: [ "3.10", "3.11", "3.12", "3.13" ] steps: - uses: actions/checkout@v5 with: fetch-depth: 1 - - name: Set up Python + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v6 with: - python-version: | - 3.10 - 3.11 - 3.12 - 3.13 + python-version: ${{ matrix.python-version }} + - name: Set up JDK for openapi-generator-cli uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5 with: @@ -71,30 +69,26 @@ jobs: run: make client-set-version VERSION="${{ env.VERSION }}" - name: Build source distribution + if: matrix.python-version == '3.13' && startsWith(matrix.os, 'ubuntu-24.04') run: | make client-build FORMAT=sdist - - name: Build wheels - uses: pypa/cibuildwheel@v3.1.4 - 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: Build wheel + run: | + make client-build FORMAT=wheel + + - name: Prepare artifacts directory + run: | + mkdir -p wheelhouse + cp ./client/python/dist/*.whl wheelhouse/ - name: Add source distribution - if: startsWith(matrix.os, 'ubuntu-24.04') - run: ls -lah ./client/python/dist/* && cp ./client/python/dist/* wheelhouse/ + if: matrix.python-version == '3.13' && startsWith(matrix.os, 'ubuntu-24.04') + run: cp ./client/python/dist/*.tar.gz wheelhouse/ - uses: actions/upload-artifact@v4 with: - name: "python-client-artifacts-${{ matrix.os }}" + name: "python-client-artifacts-${{ matrix.os }}-py${{ matrix.python-version }}" path: ./wheelhouse/* merge-artifacts: From 927782e84f23c76eb52b0c1e0ac2b3dd8239833b Mon Sep 17 00:00:00 2001 From: Honah J Date: Thu, 11 Dec 2025 11:59:57 -0600 Subject: [PATCH 07/11] Remove unnecessary step --- client/python/generate_clients.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/client/python/generate_clients.py b/client/python/generate_clients.py index 88bfc9cbb2..2fe0245647 100644 --- a/client/python/generate_clients.py +++ b/client/python/generate_clients.py @@ -363,9 +363,6 @@ def main() -> None: 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.") - return build() From f5c52e3f52b2578ae2fd7df0a487c83568c20b08 Mon Sep 17 00:00:00 2001 From: Honah J Date: Wed, 7 Jan 2026 14:15:21 -0600 Subject: [PATCH 08/11] Simplify workflow to focus on snapshot builds only - Remove version input - auto-generate PEP 440 compliant dev version Format: {base_version}.devYYYYMMDDHHMMSS+commitshort - Generate version once and share across all build jobs - Include version in final merged artifact name - Rename workflow to "Python Client Build Snapshot Artifacts" --- .../python-client-build-artifacts.yml | 63 +++++++++---------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/.github/workflows/python-client-build-artifacts.yml b/.github/workflows/python-client-build-artifacts.yml index 19db296c5b..b8905c8a60 100644 --- a/.github/workflows/python-client-build-artifacts.yml +++ b/.github/workflows/python-client-build-artifacts.yml @@ -17,34 +17,45 @@ # under the License. # -name: "Python Client Build Artifacts" +name: "Python Client Build Snapshot 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: + generate-version: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 1 + + - name: Generate snapshot version + id: version + run: | + TIMESTAMP=$(date -u +%Y%m%d%H%M%S) + COMMIT_SHORT=$(git rev-parse --short=7 HEAD) + BASE_VERSION=$(grep -E '^version = ' client/python/pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/') + # PEP 440 compliant dev version + DEV_VERSION="${BASE_VERSION}.dev${TIMESTAMP}+${COMMIT_SHORT}" + echo "version=$DEV_VERSION" >> $GITHUB_OUTPUT + echo "Generated snapshot version: $DEV_VERSION" + build-artifacts: name: Build artifacts on ${{ matrix.os }} with Python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} + needs: generate-version strategy: matrix: - os: [ ubuntu-24.04, macos-14, macos-15] # current build script is not compatible with windows - python-version: [ "3.10", "3.11", "3.12", "3.13" ] + os: [ubuntu-24.04, macos-14, macos-15] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v5 @@ -62,11 +73,10 @@ jobs: 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: Set snapshot version + run: | + echo "Setting version to: ${{ needs.generate-version.outputs.version }}" + make client-set-version VERSION="${{ needs.generate-version.outputs.version }}" - name: Build source distribution if: matrix.python-version == '3.13' && startsWith(matrix.os, 'ubuntu-24.04') @@ -88,29 +98,18 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: "python-client-artifacts-${{ matrix.os }}-py${{ matrix.python-version }}" + name: python-client-artifacts-${{ matrix.os }}-${{ matrix.python-version }} path: ./wheelhouse/* merge-artifacts: runs-on: ubuntu-latest needs: + - generate-version - build-artifacts steps: - - name: Generate artifact name - id: artifact-name - run: | - if [ -n "${{ inputs.version }}" ]; then - ARTIFACT_NAME="python-client-artifacts-${{ inputs.version }}" - else - ARTIFACT_NAME="python-client-artifacts-${{ github.run_id }}" - fi - echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_OUTPUT - echo "Using artifact name: $ARTIFACT_NAME" - - name: Merge Artifacts uses: actions/upload-artifact/merge@v4 with: - name: ${{ steps.artifact-name.outputs.ARTIFACT_NAME }} + name: python-client-artifacts-${{ needs.generate-version.outputs.version }} pattern: python-client-artifacts-* delete-merged: true - From 96ef5b5652bb8cc18809648b54c969a91065e963 Mon Sep 17 00:00:00 2001 From: Honah J Date: Thu, 8 Jan 2026 16:55:17 -0600 Subject: [PATCH 09/11] Simplify snapshot version generation - Add client-get-version Makefile target to get current version - Use make client-get-version instead of grep/sed parsing - Simpler version format: {version}.dev{timestamp} - Add artifact-name output for nightly workflow integration --- .../python-client-build-artifacts.yml | 27 ++++++++++++++----- Makefile | 4 +++ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-client-build-artifacts.yml b/.github/workflows/python-client-build-artifacts.yml index b8905c8a60..7779badc5f 100644 --- a/.github/workflows/python-client-build-artifacts.yml +++ b/.github/workflows/python-client-build-artifacts.yml @@ -22,6 +22,10 @@ name: "Python Client Build Snapshot Artifacts" on: workflow_dispatch: workflow_call: + outputs: + artifact-name: + description: "Name of the merged artifact containing all wheels and sdist" + value: ${{ jobs.merge-artifacts.outputs.artifact-name }} pull_request: paths: - '.github/workflows/python-client-build-artifacts.yml' @@ -37,16 +41,19 @@ jobs: with: fetch-depth: 1 + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.13" + - name: Generate snapshot version id: version run: | - TIMESTAMP=$(date -u +%Y%m%d%H%M%S) - COMMIT_SHORT=$(git rev-parse --short=7 HEAD) - BASE_VERSION=$(grep -E '^version = ' client/python/pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/') - # PEP 440 compliant dev version - DEV_VERSION="${BASE_VERSION}.dev${TIMESTAMP}+${COMMIT_SHORT}" - echo "version=$DEV_VERSION" >> $GITHUB_OUTPUT - echo "Generated snapshot version: $DEV_VERSION" + CURRENT_VERSION=$(make client-get-version) + DATE_SUFFIX=$(date -u +%Y%m%d%H%M%S) + NIGHTLY_VERSION="${CURRENT_VERSION}.dev${DATE_SUFFIX}" + echo "version=$NIGHTLY_VERSION" >> $GITHUB_OUTPUT + echo "Generated snapshot version: $NIGHTLY_VERSION" build-artifacts: name: Build artifacts on ${{ matrix.os }} with Python ${{ matrix.python-version }} @@ -106,6 +113,8 @@ jobs: needs: - generate-version - build-artifacts + outputs: + artifact-name: ${{ steps.output-name.outputs.artifact-name }} steps: - name: Merge Artifacts uses: actions/upload-artifact/merge@v4 @@ -113,3 +122,7 @@ jobs: name: python-client-artifacts-${{ needs.generate-version.outputs.version }} pattern: python-client-artifacts-* delete-merged: true + + - name: Output artifact name + id: output-name + run: echo "artifact-name=python-client-artifacts-${{ needs.generate-version.outputs.version }}" >> $GITHUB_OUTPUT diff --git a/Makefile b/Makefile index a203897910..2a01b5eb25 100644 --- a/Makefile +++ b/Makefile @@ -131,6 +131,10 @@ client-lint: client-setup-env ## Run linting checks for Polaris client @$(ACTIVATE_AND_CD) && poetry run pre-commit run --files integration_tests/* generate_clients.py apache_polaris/cli/* apache_polaris/cli/command/* apache_polaris/cli/options/* test/* @echo "--- Client linting checks complete ---" +.PHONY: client-get-version +client-get-version: client-setup-env ## Get Python client version + @$(ACTIVATE_AND_CD) && poetry version --short + .PHONY: client-set-version client-set-version: client-setup-env ## Set Python client version using poetry. Usage: make client-set-version VERSION= @echo "--- Setting client version ---" From eca2d97207bcb08db36ad5c84c4a11dfb7074e9b Mon Sep 17 00:00:00 2001 From: Honah J Date: Thu, 8 Jan 2026 18:16:47 -0600 Subject: [PATCH 10/11] Fix the github action commits --- .github/workflows/python-client-build-artifacts.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-client-build-artifacts.yml b/.github/workflows/python-client-build-artifacts.yml index 7779badc5f..8087f24b23 100644 --- a/.github/workflows/python-client-build-artifacts.yml +++ b/.github/workflows/python-client-build-artifacts.yml @@ -37,12 +37,12 @@ jobs: outputs: version: ${{ steps.version.outputs.version }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 with: fetch-depth: 1 - name: Set up Python - uses: actions/setup-python@v6 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6 with: python-version: "3.13" @@ -65,12 +65,12 @@ jobs: python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 with: fetch-depth: 1 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6 with: python-version: ${{ matrix.python-version }} @@ -103,7 +103,7 @@ jobs: if: matrix.python-version == '3.13' && startsWith(matrix.os, 'ubuntu-24.04') run: cp ./client/python/dist/*.tar.gz wheelhouse/ - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 with: name: python-client-artifacts-${{ matrix.os }}-${{ matrix.python-version }} path: ./wheelhouse/* @@ -117,7 +117,7 @@ jobs: artifact-name: ${{ steps.output-name.outputs.artifact-name }} steps: - name: Merge Artifacts - uses: actions/upload-artifact/merge@v4 + uses: actions/upload-artifact/merge@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 with: name: python-client-artifacts-${{ needs.generate-version.outputs.version }} pattern: python-client-artifacts-* From 15c4274f4e46ad6fa38cea8d00b9b5e9cef43949 Mon Sep 17 00:00:00 2001 From: Honah J Date: Thu, 8 Jan 2026 18:45:34 -0600 Subject: [PATCH 11/11] Fix version issue --- .../workflows/python-client-build-artifacts.yml | 3 +++ Makefile | 15 +++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-client-build-artifacts.yml b/.github/workflows/python-client-build-artifacts.yml index 8087f24b23..bbdb8d5ca4 100644 --- a/.github/workflows/python-client-build-artifacts.yml +++ b/.github/workflows/python-client-build-artifacts.yml @@ -46,6 +46,9 @@ jobs: with: python-version: "3.13" + - name: Install Poetry + run: make client-install-poetry + - name: Generate snapshot version id: version run: | diff --git a/Makefile b/Makefile index 2a01b5eb25..57e9e7314e 100644 --- a/Makefile +++ b/Makefile @@ -112,13 +112,16 @@ $(VENV_DIR): @python3 -m venv $(VENV_DIR) @echo "Virtual environment created." -.PHONY: client-install-dependencies -client-install-dependencies: $(VENV_DIR) - @echo "Installing Poetry and project dependencies into $(VENV_DIR)..." - @$(VENV_DIR)/bin/pip install --upgrade pip +.PHONY: client-install-poetry +client-install-poetry: $(VENV_DIR) ## Install Poetry into the virtual environment + @$(VENV_DIR)/bin/pip install --upgrade pip -q @if [ ! -f "$(VENV_DIR)/bin/poetry" ]; then \ - $(VENV_DIR)/bin/pip install --upgrade "poetry$(POETRY_VERSION)"; \ + $(VENV_DIR)/bin/pip install --upgrade "poetry$(POETRY_VERSION)" -q; \ fi + +.PHONY: client-install-dependencies +client-install-dependencies: client-install-poetry + @echo "Installing project dependencies into $(VENV_DIR)..." @$(ACTIVATE_AND_CD) && poetry lock && poetry install --all-extras @echo "Poetry and dependencies installed." @@ -132,7 +135,7 @@ client-lint: client-setup-env ## Run linting checks for Polaris client @echo "--- Client linting checks complete ---" .PHONY: client-get-version -client-get-version: client-setup-env ## Get Python client version +client-get-version: ## Get Python client version (requires poetry to be installed) @$(ACTIVATE_AND_CD) && poetry version --short .PHONY: client-set-version