Skip to content

Commit

Permalink
Merge pull request #20 from TheTechromancer/multiple-python-versions
Browse files Browse the repository at this point in the history
Test Multiple Python Versions (+3.13 Support)
  • Loading branch information
nmammeri authored Dec 20, 2024
2 parents 3c8f451 + 4685f0a commit 214367b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
47 changes: 24 additions & 23 deletions .github/workflows/release_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
branches:
- main
tags:
- '*'
- "*"
pull_request:
workflow_dispatch:

Expand All @@ -31,11 +31,12 @@ jobs:
target: x86_64
#- runner: self-hosted-arm64
# target: aarch64
python-version: ["3.8", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: ${{ matrix.python-version }}

# On linux we don't use graalvm/[email protected] action to install graalvm because it will install it
# on the runner machine and on linux the build will happen inside a manylinux docker.
Expand All @@ -46,8 +47,8 @@ jobs:
with:
command: build
#working-directory: "bindings/extractous-python" # dont use working dir with docker fails to reapply permission on target dir
args: --manifest-path bindings/extractous-python/Cargo.toml --release --out bindings/extractous-python/dist -i python3.8 --compatibility manylinux_2_28
sccache: 'false'
args: --manifest-path bindings/extractous-python/Cargo.toml --release --out bindings/extractous-python/dist -i python${{ matrix.python-version }} --compatibility manylinux_2_28
sccache: "false"
target: ${{ matrix.platform.target }}
container: quay.io/pypa/manylinux_2_28_${{ matrix.platform.target }}:latest
before-script-linux: .github/workflows/install-graalvm-sdkman.sh 23.0.1-graalce
Expand All @@ -56,6 +57,7 @@ jobs:

# On linux we don't need to patch the wheel as the RPATH is set by the rustc compiler
- name: Upload wheels
if: ${{ matrix.python-version == '3.8' }}
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}
Expand Down Expand Up @@ -92,7 +94,6 @@ jobs:
cd bindings/extractous-python
pytest -s
windows:
runs-on: ${{ matrix.platform.runner }}
strategy:
Expand All @@ -104,20 +105,20 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: "3.8"
architecture: ${{ matrix.platform.target }}
- uses: graalvm/[email protected]
with:
java-version: '23'
distribution: 'graalvm-community'
set-java-home: 'true'
java-version: "23"
distribution: "graalvm-community"
set-java-home: "true"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
working-directory: "bindings/extractous-python"
args: --release --out dist --find-interpreter
sccache: 'true'
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -146,25 +147,25 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: "3.8"

# - uses: graalvm/[email protected]
# with:
# java-version: '23'
# distribution: 'liberica'
# set-java-home: 'true'
# - name: Install graalvm
# run: |
# set -e
# bash .github/workflows/install-graalvm-sdkman-macos.sh 24.1.1.r23-nik
# - uses: graalvm/[email protected]
# with:
# java-version: '23'
# distribution: 'liberica'
# set-java-home: 'true'
# - name: Install graalvm
# run: |
# set -e
# bash .github/workflows/install-graalvm-sdkman-macos.sh 24.1.1.r23-nik

- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
working-directory: "bindings/extractous-python"
args: --release --out dist --find-interpreter
sccache: 'true'
sccache: "true"

- name: Patch wheel lib
run: |
Expand Down Expand Up @@ -218,7 +219,7 @@ jobs:
url: https://pypi.org/p/extractous
permissions:
contents: read
id-token: write # IMPORTANT: mandatory for trusted publishing
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
Expand All @@ -242,7 +243,7 @@ jobs:
name: pypi
url: https://pypi.org/p/extractous
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions bindings/extractous-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ doc = false

[dependencies]
# "abi3-py310" tells pyo3 (and maturin) to build using the stable ABI with minimum Python version 3.10
pyo3 = { version = "0.22.2", features = ["abi3", "abi3-py38", "gil-refs"] }
extractous = { path = "../../extractous-core" }
pyo3 = { version = "0.23.3", features = ["abi3", "abi3-py38"] }
extractous = { path = "../../extractous-core" }
3 changes: 1 addition & 2 deletions bindings/extractous-python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ classifiers = [
description = "Extractous Python Binding"
license = { text = "Apache-2.0" }
readme = "README.md"
# PyO3 doesn't support python 3.13 yet.
requires-python = ">=3.8,<3.13"
requires-python = ">=3.8,<3.14"

[project.optional-dependencies]
# To generate python docs using pdoc we need to run:
Expand Down

0 comments on commit 214367b

Please sign in to comment.