From af5ef120d34c7648c1d3fa620e5cafcbb93375e4 Mon Sep 17 00:00:00 2001 From: Leo Romanovsky Date: Wed, 27 Nov 2024 01:19:56 -0800 Subject: [PATCH] regenerate --- .github/workflows/python.yml | 147 ++++++++++++++--------------------- 1 file changed, 58 insertions(+), 89 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 67fb1fa5..0345f718 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -1,20 +1,17 @@ -# This file is autogenerated by maturin v1.7.0 +# This file is autogenerated by maturin v1.7.5 # To update, run # # maturin generate-ci -o .github/workflows/python.yml --pytest --manifest-path ./python-sdk/Cargo.toml github # -# Manually modified: -# - tag filter in Release job to only trigger on python-sdk@ tags -# - added checkout with submodules -# - replaced `pytest` with `npm run with-server test:python` -name: Python SDK +name: CI on: push: branches: - main - release: - types: [published] + - master + tags: + - '*' pull_request: workflow_dispatch: @@ -27,65 +24,45 @@ jobs: strategy: matrix: platform: - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: x86_64 - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: x86 - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: aarch64 - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: armv7 - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: s390x - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: ppc64le steps: - uses: actions/checkout@v4 - with: - submodules: true - uses: actions/setup-python@v5 with: python-version: 3.x - - name: Build wheels uses: PyO3/maturin-action@v1 - if: ${{ startsWith(matrix.platform.target, 'x86') }} - with: - target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter --manifest-path ./python-sdk/Cargo.toml - sccache: 'true' - manylinux: auto - before-script-linux: | - yum install -y perl-IPC-Cmd devtoolset-10-libatomic-devel - - name: Build wheels - uses: PyO3/maturin-action@v1 - if: ${{ !startsWith(matrix.platform.target, 'x86') }} with: target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter --manifest-path ./python-sdk/Cargo.toml sccache: 'true' manylinux: auto - before-script-linux: | - apt-get update - apt-get install --no-install-recommends -y libssl-dev - - name: Upload wheels uses: actions/upload-artifact@v4 with: name: wheels-linux-${{ matrix.platform.target }} path: dist - - name: pytest if: ${{ startsWith(matrix.platform.target, 'x86_64') }} shell: bash run: | - set -ex + set -e python3 -m venv .venv source .venv/bin/activate - pip install eppo-server-sdk --no-index --find-links dist --force-reinstall - pip install pytest cachetools - npm ci - npm run with-server test:python + pip install eppo-server-sdk --find-links dist --force-reinstall + pip install pytest + cd ./python-sdk && pytest - name: pytest if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }} uses: uraimo/run-on-arch-action@v2 @@ -95,31 +72,28 @@ jobs: githubToken: ${{ github.token }} install: | apt-get update - apt-get install -y --no-install-recommends python3 python3-pip nodejs npm - pip3 install -U pip pytest cachetools + apt-get install -y --no-install-recommends python3 python3-pip + pip3 install -U pip pytest run: | - set -ex - pip3 install eppo-server-sdk --no-index --find-links dist --force-reinstall - npm ci - npm run with-server test:python + set -e + pip3 install eppo-server-sdk --find-links dist --force-reinstall + cd ./python-sdk && pytest musllinux: runs-on: ${{ matrix.platform.runner }} strategy: matrix: platform: - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: x86_64 - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: x86 - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: aarch64 - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: armv7 steps: - uses: actions/checkout@v4 - with: - submodules: true - uses: actions/setup-python@v5 with: python-version: 3.x @@ -142,34 +116,29 @@ jobs: image: alpine:latest options: -v ${{ github.workspace }}:/io -w /io run: | - set -ex - apk add py3-pip py3-virtualenv nodejs npm + set -e + apk add py3-pip py3-virtualenv python3 -m virtualenv .venv source .venv/bin/activate pip install eppo-server-sdk --no-index --find-links dist --force-reinstall - pip install pytest cachetools - npm ci - npm run with-server test:python + pip install pytest + cd ./python-sdk && pytest - name: pytest - # `npm ci` just hangs on Alpine armv7 now. - # Disabling tests until this issue is fixed: - # https://github.com/nodejs/docker-node/issues/1829 - if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'armv7' }} + if: ${{ !startsWith(matrix.platform.target, 'x86') }} uses: uraimo/run-on-arch-action@v2 with: arch: ${{ matrix.platform.target }} distro: alpine_latest githubToken: ${{ github.token }} install: | - apk add py3-virtualenv nodejs npm + apk add py3-virtualenv run: | - set -ex + set -e python3 -m virtualenv .venv source .venv/bin/activate - pip install pytest cachetools - pip install eppo-server-sdk --no-index --find-links dist --force-reinstall - npm ci - npm run with-server test:python + pip install pytest + pip install eppo-server-sdk --find-links dist --force-reinstall + cd ./python-sdk && pytest windows: runs-on: ${{ matrix.platform.runner }} @@ -182,8 +151,6 @@ jobs: target: x86 steps: - uses: actions/checkout@v4 - with: - submodules: true - uses: actions/setup-python@v5 with: python-version: 3.x @@ -203,18 +170,16 @@ jobs: if: ${{ !startsWith(matrix.platform.target, 'aarch64') }} shell: bash run: | - set -ex + set -e python3 -m venv .venv source .venv/Scripts/activate - pip install eppo-server-sdk --no-index --find-links dist --force-reinstall - pip install pytest cachetools - npm ci - npm run with-server test:python + pip install eppo-server-sdk --find-links dist --force-reinstall + pip install pytest + cd ./python-sdk && pytest macos: - runs-on: macos-${{ matrix.platform.target }} + runs-on: ${{ matrix.platform.runner }} strategy: - fail-fast: false matrix: platform: - runner: macos-14 @@ -223,36 +188,28 @@ jobs: target: aarch64 steps: - uses: actions/checkout@v4 - with: - submodules: true - # Install python to be able to run tests. - uses: actions/setup-python@v5 with: - python-version: '3.10' # Use locked version as maturin is not producing wheels for python 3.13 yet. + python-version: 3.x - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter --manifest-path ./python-sdk/Cargo.toml sccache: 'true' - - name: List dist directory - run: ls -l dist - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: wheels-${{ matrix.platform.runner }}-${{ matrix.platform.target }} + name: wheels-macos-${{ matrix.platform.target }} path: dist - if-no-files-found: error - name: pytest run: | - set -ex + set -e python3 -m venv .venv source .venv/bin/activate - pip install --upgrade pip - pip install eppo-server-sdk --no-index --find-links dist --force-reinstall -v - pip install pytest cachetools - npm ci - npm run with-server test:python + pip install eppo-server-sdk --find-links dist --force-reinstall + pip install pytest + cd ./python-sdk && pytest sdist: runs-on: ubuntu-latest @@ -272,11 +229,23 @@ jobs: release: name: Release runs-on: ubuntu-latest - if: "startsWith(github.ref, 'refs/tags/python-sdk@')" + if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} needs: [linux, musllinux, windows, macos, sdist] + permissions: + # Use to sign the release artifacts + id-token: write + # Used to upload release artifacts + contents: write + # Used to generate artifact attestation + attestations: write steps: - uses: actions/download-artifact@v4 + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-path: 'wheels-*/*' - name: Publish to PyPI + if: "startsWith(github.ref, 'refs/tags/')" uses: PyO3/maturin-action@v1 env: MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}