Skip to content

Commit

Permalink
Update and move Python CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sgreenbury committed Sep 5, 2024
1 parent 93e5a81 commit 9c02779
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
#
# maturin generate-ci github
#
name: CI
name: Python

on:
push:
branches:
- main
- master
tags:
- '*'
pull_request:
Expand All @@ -18,29 +17,39 @@ on:
permissions:
contents: read

defaults:
run:
working-directory: popgetter_py

jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
target: [x86_64, x86, aarch64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
- name: Install OpenSSL (dev)
run: |
sudo apt-get update
sudo apt-get install pkg-config libssl-dev
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
working-directory: popgetter_py
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.target }}
path: dist
working-directory: popgetter_py

windows:
runs-on: windows-latest
Expand All @@ -51,19 +60,21 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
working-directory: popgetter_py
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.target }}
path: dist
working-directory: popgetter_py

macos:
runs-on: macos-latest
Expand All @@ -74,18 +85,20 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
working-directory: popgetter_py
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.target }}
path: dist
working-directory: popgetter_py

sdist:
runs-on: ubuntu-latest
Expand All @@ -96,23 +109,26 @@ jobs:
with:
command: sdist
args: --out dist
working-directory: popgetter_py
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist
working-directory: popgetter_py

release:
name: Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [linux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v4
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*
# TODO: uncomment for release to PyPI
# release:
# name: Release
# runs-on: ubuntu-latest
# if: startsWith(github.ref, 'refs/tags/')
# needs: [linux, windows, macos, sdist]
# steps:
# - uses: actions/download-artifact@v4
# - name: Publish to PyPI
# uses: PyO3/maturin-action@v1
# env:
# MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
# with:
# command: upload
# args: --non-interactive --skip-existing wheels-*/*
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions popgetter_py/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ crate-type = ["cdylib"]

[dependencies]
anyhow = { workspace = true }
# Added directly with "vendored" feature for maturin-action to work: https://github.com/PyO3/maturin-action/discussions/78
openssl = { version = "0.10", features = ["vendored"] }
polars = { workspace = true, features = ["lazy", "is_in", "http", "streaming", "parquet", "polars-io", "regex", "strings", "rows"] }
popgetter = { path = "../popgetter" }
pyo3 = { workspace = true, features = ["experimental-async"] }
Expand Down

0 comments on commit 9c02779

Please sign in to comment.