Skip to content

Commit

Permalink
regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
leoromanovsky committed Nov 27, 2024
1 parent f663954 commit af5ef12
Showing 1 changed file with 58 additions and 89 deletions.
147 changes: 58 additions & 89 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 }}
Expand Down

0 comments on commit af5ef12

Please sign in to comment.