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 e97168a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 40 deletions.
57 changes: 24 additions & 33 deletions .github/workflows/pyo3-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ 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:
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 @@ -41,7 +41,7 @@ jobs:
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
Expand All @@ -51,18 +51,14 @@ jobs:
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 +68,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 +78,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 +93,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 +102,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 +117,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 +133,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
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

0 comments on commit e97168a

Please sign in to comment.