Skip to content

Commit

Permalink
remove abi3 to see if that makes graal happier
Browse files Browse the repository at this point in the history
  • Loading branch information
masklinn committed Oct 5, 2024
1 parent ffe4fae commit 4b9eed1
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 47 deletions.
67 changes: 31 additions & 36 deletions .github/workflows/pyo3-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,51 +18,51 @@ on:
permissions:
contents: read

env:
BASE: --out dist -m ua-parser-py/Cargo.toml
COMMON: --release --out dist -m ua-parser-py/Cargo.toml

jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.x"
- "pypy-3.10"
- "graalpy"
platform:
- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
- runner: ubuntu-latest
target: armv7
- target: x86_64
#- target: x86
- target: aarch64
#- target: armv7
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
python-version: ${{ python-version }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --zig
args: ${{ env.COMMON }} --zig
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}
path: dist
name: wheels-linux-${{ matrix.platform.target }}-${{ matrix.python-version }}
path: dist/*

musllinux:
runs-on: ${{ matrix.platform.runner }}
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
- runner: ubuntu-latest
target: armv7
- target: x86_64
# - target: x86
- target: aarch64
#- target: armv7
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -72,7 +72,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist
args: ${{ env.COMMON }}
sccache: 'true'
manylinux: musllinux_1_2
- name: Upload wheels
Expand All @@ -82,14 +82,11 @@ jobs:
path: dist

windows:
runs-on: ${{ matrix.platform.runner }}
runs-on: windows-latest
strategy:
matrix:
platform:
- runner: windows-latest
target: x64
- runner: windows-latest
target: x86
- target: x64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -100,7 +97,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist
args: ${{ env.COMMON }}
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
Expand All @@ -109,14 +106,12 @@ jobs:
path: dist

macos:
runs-on: ${{ matrix.platform.runner }}
runs-on: macos-14
strategy:
matrix:
platform:
- runner: macos-12
target: x86_64
- runner: macos-14
target: aarch64
- target: x86_64
- target: aarch64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -126,7 +121,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist
args: ${{ env.COMMON }}
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
Expand All @@ -142,7 +137,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
args: ${{ env.BASE }}
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/pytests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "pypy-3.8"
- "pypy-3.9"
- "pypy-3.10"
- "graalpy-24"
steps:
Expand Down
2 changes: 1 addition & 1 deletion ua-parser-py/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ name = "ua_parser_rs"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.20.0", features = ["extension-module", "abi3", "abi3-py38"] }
pyo3 = { version = "0.22", features = ["extension-module", "abi3", "abi3-py38"] }
ua-parser = { version = "0.2.0", path = "../ua-parser" }
12 changes: 6 additions & 6 deletions ua-parser-py/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use pyo3::exceptions::PyValueError;
use pyo3::prelude::*;
/// An uap-python Resolver is a callable which returns a PartialResult
/// (~a triplet of optional user_agent, os, and domain). A resolver
/// has lists of matchers for user agents, os, and devices taken in as
Expand Down Expand Up @@ -27,6 +25,8 @@ use pyo3::prelude::*;
/// them to Parsers as well but that's still very confusing given the
/// global Parser object, unless *that* gets renamed to Extractor on
/// the python side, or something.
use pyo3::exceptions::PyValueError;
use pyo3::prelude::*;
use std::borrow::Cow::{self, Owned};

type UAParser = (
Expand Down Expand Up @@ -55,7 +55,7 @@ struct UserAgent {
#[pymethods]
impl UserAgentExtractor {
#[new]
fn new(it: &PyAny) -> PyResult<Self> {
fn new(it: &Bound<PyAny>) -> PyResult<Self> {
use ua_parser::user_agent::{Builder, Parser};
it.iter()?
.try_fold(Builder::new(), |s, p| {
Expand Down Expand Up @@ -111,7 +111,7 @@ struct OS {
#[pymethods]
impl OSExtractor {
#[new]
fn new(it: &PyAny) -> PyResult<Self> {
fn new(it: &Bound<PyAny>) -> PyResult<Self> {
use ua_parser::os::{Builder, Parser};
it.iter()?
.try_fold(Builder::new(), |s, p| {
Expand Down Expand Up @@ -162,7 +162,7 @@ struct Device {
#[pymethods]
impl DeviceExtractor {
#[new]
fn new(it: &PyAny) -> PyResult<Self> {
fn new(it: &Bound<PyAny>) -> PyResult<Self> {
use ua_parser::device::{Builder, Flag, Parser};
it.iter()?
.try_fold(Builder::new(), |s, p| {
Expand Down Expand Up @@ -194,7 +194,7 @@ impl DeviceExtractor {
}

#[pymodule]
fn ua_parser_rs(_py: Python, m: &PyModule) -> PyResult<()> {
fn ua_parser_rs(m: &Bound<PyModule>) -> PyResult<()> {
m.add_class::<UserAgentExtractor>()?;
m.add_class::<OSExtractor>()?;
m.add_class::<DeviceExtractor>()?;
Expand Down
2 changes: 1 addition & 1 deletion ua-parser-py/tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
env_list = py{38,39,310,311,312}, pypy3.{9,10}#, graalpy
env_list = py{39,310,311,312}, pypy3.10#, graalpy
, typecheck, format, lint
skip_missing_interpreters = true

Expand Down

0 comments on commit 4b9eed1

Please sign in to comment.