Skip to content

Commit e97168a

Browse files
committed
remove abi3 to see if that makes graal happier
1 parent ffe4fae commit e97168a

File tree

3 files changed

+31
-40
lines changed

3 files changed

+31
-40
lines changed

.github/workflows/pyo3-wheels.yml

+24-33
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ on:
1818
permissions:
1919
contents: read
2020

21+
env:
22+
BASE: --out dist -m ua-parser-py/Cargo.toml
23+
COMMON: --release --out dist -m ua-parser-py/Cargo.toml
24+
2125
jobs:
2226
linux:
23-
runs-on: ${{ matrix.platform.runner }}
27+
runs-on: ubuntu-latest
2428
strategy:
2529
matrix:
2630
platform:
27-
- runner: ubuntu-latest
28-
target: x86_64
29-
- runner: ubuntu-latest
30-
target: x86
31-
- runner: ubuntu-latest
32-
target: aarch64
33-
- runner: ubuntu-latest
34-
target: armv7
31+
- target: x86_64
32+
#- target: x86
33+
- target: aarch64
34+
#- target: armv7
3535
steps:
3636
- uses: actions/checkout@v4
3737
- uses: actions/setup-python@v5
@@ -41,7 +41,7 @@ jobs:
4141
uses: PyO3/maturin-action@v1
4242
with:
4343
target: ${{ matrix.platform.target }}
44-
args: --release --out dist --zig
44+
args: ${{ env.COMMON }} --zig
4545
sccache: 'true'
4646
manylinux: auto
4747
- name: Upload wheels
@@ -51,18 +51,14 @@ jobs:
5151
path: dist
5252

5353
musllinux:
54-
runs-on: ${{ matrix.platform.runner }}
54+
runs-on: ubuntu-latest
5555
strategy:
5656
matrix:
5757
platform:
58-
- runner: ubuntu-latest
59-
target: x86_64
60-
- runner: ubuntu-latest
61-
target: x86
62-
- runner: ubuntu-latest
63-
target: aarch64
64-
- runner: ubuntu-latest
65-
target: armv7
58+
- target: x86_64
59+
# - target: x86
60+
- target: aarch64
61+
#- target: armv7
6662
steps:
6763
- uses: actions/checkout@v4
6864
- uses: actions/setup-python@v5
@@ -72,7 +68,7 @@ jobs:
7268
uses: PyO3/maturin-action@v1
7369
with:
7470
target: ${{ matrix.platform.target }}
75-
args: --release --out dist
71+
args: ${{ env.COMMON }}
7672
sccache: 'true'
7773
manylinux: musllinux_1_2
7874
- name: Upload wheels
@@ -82,14 +78,11 @@ jobs:
8278
path: dist
8379

8480
windows:
85-
runs-on: ${{ matrix.platform.runner }}
81+
runs-on: windows-latest
8682
strategy:
8783
matrix:
8884
platform:
89-
- runner: windows-latest
90-
target: x64
91-
- runner: windows-latest
92-
target: x86
85+
- target: x64
9386
steps:
9487
- uses: actions/checkout@v4
9588
- uses: actions/setup-python@v5
@@ -100,7 +93,7 @@ jobs:
10093
uses: PyO3/maturin-action@v1
10194
with:
10295
target: ${{ matrix.platform.target }}
103-
args: --release --out dist
96+
args: ${{ env.COMMON }}
10497
sccache: 'true'
10598
- name: Upload wheels
10699
uses: actions/upload-artifact@v4
@@ -109,14 +102,12 @@ jobs:
109102
path: dist
110103

111104
macos:
112-
runs-on: ${{ matrix.platform.runner }}
105+
runs-on: macos-14
113106
strategy:
114107
matrix:
115108
platform:
116-
- runner: macos-12
117-
target: x86_64
118-
- runner: macos-14
119-
target: aarch64
109+
- target: x86_64
110+
- target: aarch64
120111
steps:
121112
- uses: actions/checkout@v4
122113
- uses: actions/setup-python@v5
@@ -126,7 +117,7 @@ jobs:
126117
uses: PyO3/maturin-action@v1
127118
with:
128119
target: ${{ matrix.platform.target }}
129-
args: --release --out dist
120+
args: ${{ env.COMMON }}
130121
sccache: 'true'
131122
- name: Upload wheels
132123
uses: actions/upload-artifact@v4
@@ -142,7 +133,7 @@ jobs:
142133
uses: PyO3/maturin-action@v1
143134
with:
144135
command: sdist
145-
args: --out dist
136+
args: ${{ env.BASE }}
146137
- name: Upload sdist
147138
uses: actions/upload-artifact@v4
148139
with:

ua-parser-py/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ name = "ua_parser_rs"
99
crate-type = ["cdylib"]
1010

1111
[dependencies]
12-
pyo3 = { version = "0.20.0", features = ["extension-module", "abi3", "abi3-py38"] }
12+
pyo3 = { version = "0.22", features = ["extension-module", "abi3", "abi3-py38"] }
1313
ua-parser = { version = "0.2.0", path = "../ua-parser" }

ua-parser-py/src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use pyo3::exceptions::PyValueError;
2-
use pyo3::prelude::*;
31
/// An uap-python Resolver is a callable which returns a PartialResult
42
/// (~a triplet of optional user_agent, os, and domain). A resolver
53
/// has lists of matchers for user agents, os, and devices taken in as
@@ -27,6 +25,8 @@ use pyo3::prelude::*;
2725
/// them to Parsers as well but that's still very confusing given the
2826
/// global Parser object, unless *that* gets renamed to Extractor on
2927
/// the python side, or something.
28+
use pyo3::exceptions::PyValueError;
29+
use pyo3::prelude::*;
3030
use std::borrow::Cow::{self, Owned};
3131

3232
type UAParser = (
@@ -55,7 +55,7 @@ struct UserAgent {
5555
#[pymethods]
5656
impl UserAgentExtractor {
5757
#[new]
58-
fn new(it: &PyAny) -> PyResult<Self> {
58+
fn new(it: &Bound<PyAny>) -> PyResult<Self> {
5959
use ua_parser::user_agent::{Builder, Parser};
6060
it.iter()?
6161
.try_fold(Builder::new(), |s, p| {
@@ -111,7 +111,7 @@ struct OS {
111111
#[pymethods]
112112
impl OSExtractor {
113113
#[new]
114-
fn new(it: &PyAny) -> PyResult<Self> {
114+
fn new(it: &Bound<PyAny>) -> PyResult<Self> {
115115
use ua_parser::os::{Builder, Parser};
116116
it.iter()?
117117
.try_fold(Builder::new(), |s, p| {
@@ -162,7 +162,7 @@ struct Device {
162162
#[pymethods]
163163
impl DeviceExtractor {
164164
#[new]
165-
fn new(it: &PyAny) -> PyResult<Self> {
165+
fn new(it: &Bound<PyAny>) -> PyResult<Self> {
166166
use ua_parser::device::{Builder, Flag, Parser};
167167
it.iter()?
168168
.try_fold(Builder::new(), |s, p| {
@@ -194,7 +194,7 @@ impl DeviceExtractor {
194194
}
195195

196196
#[pymodule]
197-
fn ua_parser_rs(_py: Python, m: &PyModule) -> PyResult<()> {
197+
fn ua_parser_rs(m: &Bound<PyModule>) -> PyResult<()> {
198198
m.add_class::<UserAgentExtractor>()?;
199199
m.add_class::<OSExtractor>()?;
200200
m.add_class::<DeviceExtractor>()?;

0 commit comments

Comments
 (0)