Skip to content

Commit 98399a2

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

File tree

3 files changed

+28
-24
lines changed

3 files changed

+28
-24
lines changed

.github/workflows/pyo3-wheels.yml

+21-17
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ on:
1818
permissions:
1919
contents: read
2020

21+
env:
22+
BASE: --out dist -m ua-parser-py/Cargo.toml
23+
COMMON: --release $BASE
24+
2125
jobs:
2226
linux:
2327
runs-on: ${{ matrix.platform.runner }}
@@ -26,12 +30,12 @@ jobs:
2630
platform:
2731
- runner: ubuntu-latest
2832
target: x86_64
29-
- runner: ubuntu-latest
30-
target: x86
33+
#- runner: ubuntu-latest
34+
# target: x86
3135
- runner: ubuntu-latest
3236
target: aarch64
33-
- runner: ubuntu-latest
34-
target: armv7
37+
#- runner: ubuntu-latest
38+
# target: armv7
3539
steps:
3640
- uses: actions/checkout@v4
3741
- uses: actions/setup-python@v5
@@ -41,7 +45,7 @@ jobs:
4145
uses: PyO3/maturin-action@v1
4246
with:
4347
target: ${{ matrix.platform.target }}
44-
args: --release --out dist --zig
48+
args: ${{ env.COMMON }} --zig
4549
sccache: 'true'
4650
manylinux: auto
4751
- name: Upload wheels
@@ -57,12 +61,12 @@ jobs:
5761
platform:
5862
- runner: ubuntu-latest
5963
target: x86_64
60-
- runner: ubuntu-latest
61-
target: x86
64+
#- runner: ubuntu-latest
65+
# target: x86
6266
- runner: ubuntu-latest
6367
target: aarch64
64-
- runner: ubuntu-latest
65-
target: armv7
68+
#- runner: ubuntu-latest
69+
# target: armv7
6670
steps:
6771
- uses: actions/checkout@v4
6872
- uses: actions/setup-python@v5
@@ -72,7 +76,7 @@ jobs:
7276
uses: PyO3/maturin-action@v1
7377
with:
7478
target: ${{ matrix.platform.target }}
75-
args: --release --out dist
79+
args: ${{ env.COMMON }}
7680
sccache: 'true'
7781
manylinux: musllinux_1_2
7882
- name: Upload wheels
@@ -88,8 +92,8 @@ jobs:
8892
platform:
8993
- runner: windows-latest
9094
target: x64
91-
- runner: windows-latest
92-
target: x86
95+
#- runner: windows-latest
96+
# target: x86
9397
steps:
9498
- uses: actions/checkout@v4
9599
- uses: actions/setup-python@v5
@@ -100,7 +104,7 @@ jobs:
100104
uses: PyO3/maturin-action@v1
101105
with:
102106
target: ${{ matrix.platform.target }}
103-
args: --release --out dist
107+
args: ${{ env.COMMON }}
104108
sccache: 'true'
105109
- name: Upload wheels
106110
uses: actions/upload-artifact@v4
@@ -113,9 +117,9 @@ jobs:
113117
strategy:
114118
matrix:
115119
platform:
116-
- runner: macos-12
120+
- runner: macos-13
117121
target: x86_64
118-
- runner: macos-14
122+
- runner: macos-13
119123
target: aarch64
120124
steps:
121125
- uses: actions/checkout@v4
@@ -126,7 +130,7 @@ jobs:
126130
uses: PyO3/maturin-action@v1
127131
with:
128132
target: ${{ matrix.platform.target }}
129-
args: --release --out dist
133+
args: ${{ env.COMMON }}
130134
sccache: 'true'
131135
- name: Upload wheels
132136
uses: actions/upload-artifact@v4
@@ -142,7 +146,7 @@ jobs:
142146
uses: PyO3/maturin-action@v1
143147
with:
144148
command: sdist
145-
args: --out dist
149+
args: ${{ env.BASE }}
146150
- name: Upload sdist
147151
uses: actions/upload-artifact@v4
148152
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)