Skip to content

Commit a0eafc4

Browse files
authored
migrate to version 1.1.0 (#7)
* migrate to version 1.1.0 1. Optimize the code and use the mimalloc memory allocator to improve the running speed of the Python binding. 2. The find_data and find_absolute_path methods have been added to Finder, which return the matching value and absolute path respectively. 3. test_bindings.py all tests passed, running on Windows 10 with python version 3.13.7. 4. Comments are added in lib.rs. * Add files via upload * Remove the cache and add support for Python 3.14 * add support for python 3.14 * Remove the cache * Update test.yml * Add files via upload * fix build errors * modify lib.rs * Update lib.rs * Update Cargo.toml * Add support for Python 3.14 * Add files via upload * Add support for Python 3.14 * Delete .github/workflows/workflows directory * Add support for Python 3.14 * Add support for Python 3.14 * Add support for Python 3.14 * Delete .github/workflows/CI.yml * Delete .github/workflows/test.yml * Delete .github/workflows directory * Add support for Python 3.14 * Delete github/workflows directory * Create .github * Delete .github * Add support for Python 3.14 * Add support for Python 3.14 * Add support for Python 3.14 * Add support for Python 3.14 and pypy3.11 * fix some problems * Optimize windows workflow
1 parent 70d1d80 commit a0eafc4

File tree

9 files changed

+726
-356
lines changed

9 files changed

+726
-356
lines changed

.github/workflows/CI.yml

Lines changed: 160 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
# This file is autogenerated by maturin v1.8.6
1+
# This file is autogenerated by maturin>=v1.9.4,<2.0
22
# To update, run
33
#
44
# maturin generate-ci github
55
#
6+
# After all Python versions are installed, the --find-interpreter parameter of maturin build still fails to
7+
# find all Python versions, resulting in some Python versions not being built. Therefore, the -i parameter
8+
# is needed to manually specify Python versions.
9+
#
10+
611
name: CI
712

813
on:
@@ -19,144 +24,239 @@ permissions:
1924
contents: read
2025

2126
jobs:
22-
linux:
27+
# Setup Python Environments Jobs
28+
# These jobs will set up the Python environments for the other jobs to use.
29+
setup-python-linux:
30+
name: Setup Python Environments (Linux)
2331
runs-on: ${{ matrix.platform.runner }}
2432
strategy:
2533
matrix:
2634
platform:
27-
- runner: ubuntu-22.04
35+
- runner: ubuntu-latest
2836
target: x86_64
29-
- runner: ubuntu-22.04
37+
- runner: ubuntu-latest
3038
target: x86
31-
- runner: ubuntu-22.04
39+
- runner: ubuntu-latest
3240
target: aarch64
33-
- runner: ubuntu-22.04
41+
- runner: ubuntu-latest
3442
target: armv7
35-
- runner: ubuntu-22.04
43+
- runner: ubuntu-latest
3644
target: s390x
37-
- runner: ubuntu-22.04
45+
- runner: ubuntu-latest
3846
target: ppc64le
47+
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.9", "pypy3.10", "pypy3.11" ]
3948
steps:
40-
- uses: actions/checkout@v4
41-
- uses: actions/setup-python@v5
49+
- uses: actions/checkout@v5
50+
- name: Set up Python
51+
uses: actions/setup-python@v6
4252
with:
43-
python-version: 3.x
44-
- name: Build wheels
53+
python-version: ${{ matrix.python-version }}
54+
allow-prereleases: true
55+
56+
setup-python-windows:
57+
name: Setup Python Environments (Windows)
58+
runs-on: ${{ matrix.platform.runner }}
59+
strategy:
60+
matrix:
61+
platform:
62+
- runner: windows-latest
63+
target: x64 # 64-bit Python interpreter, note that 32-bit Python interpreter is not supported on Windows x86
64+
# Other Python versions need to be installed separately to build correctly
65+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
66+
steps:
67+
- uses: actions/checkout@v5
68+
- name: Set up Python
69+
uses: actions/setup-python@v6
70+
with:
71+
python-version: ${{ matrix.python-version }}
72+
architecture: ${{ matrix.platform.target }}
73+
allow-prereleases: true
74+
75+
setup-python-macos:
76+
name: Setup Python Environments (macOS)
77+
runs-on: ${{ matrix.platform.runner }}
78+
strategy:
79+
matrix:
80+
platform:
81+
- runner: macos-latest
82+
target: x86_64
83+
- runner: macos-latest
84+
target: aarch64
85+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.9", "pypy3.10", "pypy3.11" ]
86+
steps:
87+
- uses: actions/checkout@v5
88+
- name: Set up Python
89+
uses: actions/setup-python@v6
90+
with:
91+
python-version: ${{ matrix.python-version }}
92+
allow-prereleases: true
93+
94+
# Build Jobs
95+
# These jobs will build the wheels for all Python versions and upload them as artifacts.
96+
linux:
97+
runs-on: ubuntu-latest
98+
needs: setup-python-linux
99+
strategy:
100+
matrix:
101+
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
102+
steps:
103+
- uses: actions/checkout@v5
104+
105+
- name: Build wheels for all Python versions
45106
uses: PyO3/maturin-action@v1
46107
with:
47-
target: ${{ matrix.platform.target }}
48-
args: --release --out dist --find-interpreter
108+
target: ${{ matrix.target }}
109+
args: |
110+
--release
111+
--out target/wheels
112+
-i python3.8 python3.9 python3.10 python3.11 python3.12 python3.13 python3.14 pypy3.9 pypy3.10 pypy3.11
49113
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
50114
manylinux: auto
115+
51116
- name: Upload wheels
52117
uses: actions/upload-artifact@v4
53118
with:
54-
name: wheels-linux-${{ matrix.platform.target }}
55-
path: dist
119+
name: wheels-linux-${{ matrix.target }}
120+
path: target/wheels
56121

57122
musllinux:
58-
runs-on: ${{ matrix.platform.runner }}
123+
runs-on: ubuntu-latest
124+
needs: setup-python-linux
59125
strategy:
60126
matrix:
61-
platform:
62-
- runner: ubuntu-22.04
63-
target: x86_64
64-
- runner: ubuntu-22.04
65-
target: x86
66-
- runner: ubuntu-22.04
67-
target: aarch64
68-
- runner: ubuntu-22.04
69-
target: armv7
127+
target: [x86_64, x86, aarch64, armv7]
70128
steps:
71-
- uses: actions/checkout@v4
72-
- uses: actions/setup-python@v5
73-
with:
74-
python-version: 3.x
75-
- name: Build wheels
129+
- uses: actions/checkout@v5
130+
131+
- name: Build wheels for all Python versions
76132
uses: PyO3/maturin-action@v1
77133
with:
78-
target: ${{ matrix.platform.target }}
79-
args: --release --out dist --find-interpreter
134+
target: ${{ matrix.target }}
135+
args: |
136+
--release
137+
--out target/wheels
138+
-i python3.8 python3.9 python3.10 python3.11 python3.12 python3.13 python3.14 pypy3.9 pypy3.10 pypy3.11
80139
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
81140
manylinux: musllinux_1_2
141+
82142
- name: Upload wheels
83143
uses: actions/upload-artifact@v4
84144
with:
85-
name: wheels-musllinux-${{ matrix.platform.target }}
86-
path: dist
145+
name: wheels-musllinux-${{ matrix.target }}
146+
path: target/wheels
87147

88148
windows:
89149
runs-on: ${{ matrix.platform.runner }}
150+
needs: setup-python-windows
90151
strategy:
91152
matrix:
92153
platform:
93154
- runner: windows-latest
94155
target: x64
95-
- runner: windows-latest
96-
target: x86
97156
steps:
98-
- uses: actions/checkout@v4
99-
- uses: actions/setup-python@v5
157+
- uses: actions/checkout@v5
158+
159+
- name: Install Python3.8、3.14 and multiple PyPy version
160+
uses: actions/setup-python@v6
100161
with:
101-
python-version: 3.x
162+
python-version: |
163+
3.8
164+
3.14
165+
pypy3.9
166+
pypy3.10
167+
pypy3.11
102168
architecture: ${{ matrix.platform.target }}
103-
- name: Build wheels
169+
allow-prereleases: true
170+
171+
- name: Set PyPy paths
172+
shell: pwsh
173+
run: |
174+
$PYPY_PATHS = @()
175+
$versions = @("3.9", "3.10", "3.11")
176+
177+
foreach ($version in $versions) {
178+
$command = "pypy$version"
179+
$pypyCommand = Get-Command $command -ErrorAction SilentlyContinue
180+
if ($pypyCommand) {
181+
$path = "$($pypyCommand.Source)"
182+
$PYPY_PATHS += $path
183+
Write-Host "Found PyPy$version : $path"
184+
} else {
185+
Write-Host "PyPy$version not found"
186+
}
187+
}
188+
189+
$PYPY_PATHS_STRING = $PYPY_PATHS -join " "
190+
Write-Host "All PyPy paths: $PYPY_PATHS_STRING"
191+
echo "PYPY_PATHS=$PYPY_PATHS_STRING" >> $env:GITHUB_ENV
192+
193+
- name: Build wheels for all Python versions
104194
uses: PyO3/maturin-action@v1
105195
with:
106196
target: ${{ matrix.platform.target }}
107-
args: --release --out dist --find-interpreter
197+
args: |
198+
--release
199+
--out target/wheels
200+
-i python3.8 python3.9 python3.10 python3.11 python3.12 python3.13 python3.14
201+
-i ${{ env.PYPY_PATHS }}
202+
108203
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
204+
109205
- name: Upload wheels
110206
uses: actions/upload-artifact@v4
111207
with:
112208
name: wheels-windows-${{ matrix.platform.target }}
113-
path: dist
209+
path: target/wheels
210+
114211

115212
macos:
116-
runs-on: ${{ matrix.platform.runner }}
213+
runs-on: ${{ matrix.runner }}
214+
needs: setup-python-macos
117215
strategy:
118216
matrix:
119-
platform:
120-
- runner: macos-13
217+
include:
218+
- runner: macos-latest
121219
target: x86_64
122-
- runner: macos-14
220+
- runner: macos-latest
123221
target: aarch64
124222
steps:
125-
- uses: actions/checkout@v4
126-
- uses: actions/setup-python@v5
127-
with:
128-
python-version: 3.x
129-
- name: Build wheels
223+
- uses: actions/checkout@v5
224+
225+
- name: Build wheels for all Python versions
130226
uses: PyO3/maturin-action@v1
131227
with:
132-
target: ${{ matrix.platform.target }}
133-
args: --release --out dist --find-interpreter
228+
target: ${{ matrix.target }}
229+
args: |
230+
--release
231+
--out target/wheels
232+
-i python3.8 python3.9 python3.10 python3.11 python3.12 python3.13 python3.14 pypy3.9 pypy3.10 pypy3.11
134233
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
234+
135235
- name: Upload wheels
136236
uses: actions/upload-artifact@v4
137237
with:
138-
name: wheels-macos-${{ matrix.platform.target }}
139-
path: dist
238+
name: wheels-macos-${{ matrix.target }}
239+
path: target/wheels
140240

141241
sdist:
142242
runs-on: ubuntu-latest
143243
steps:
144-
- uses: actions/checkout@v4
244+
- uses: actions/checkout@v5
145245
- name: Build sdist
146246
uses: PyO3/maturin-action@v1
147247
with:
148248
command: sdist
149-
args: --out dist
249+
args: --out target/wheels
150250
- name: Upload sdist
151251
uses: actions/upload-artifact@v4
152252
with:
153253
name: wheels-sdist
154-
path: dist
254+
path: target/wheels
155255

156256
release:
157257
name: Release
158258
runs-on: ubuntu-latest
159-
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
259+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'}}
160260
needs: [linux, musllinux, windows, macos, sdist]
161261
permissions:
162262
# Use to sign the release artifacts

.github/workflows/test.yml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,50 @@ jobs:
77
runs-on: ${{ matrix.os }}
88
strategy:
99
matrix:
10-
os: [ ubuntu-latest, macos-latest ]
11-
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10" ]
10+
os: [ ubuntu-latest, macos-latest, windows-latest ]
11+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.9", "pypy3.10", "pypy3.11" ]
12+
include:
13+
- os: ubuntu-latest
14+
python-version: "3.14"
15+
allow-failure: true
16+
- os: macos-latest
17+
python-version: "3.14"
18+
allow-failure: true
19+
- os: windows-latest
20+
python-version: "3.14"
21+
allow-failure: true
22+
continue-on-error: ${{ matrix.allow-failure || false }}
1223
steps:
13-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@v5
1425
- name: Set up Python
15-
uses: actions/setup-python@v4
26+
uses: actions/setup-python@v6
1627
with:
1728
python-version: ${{ matrix.python-version }}
29+
allow-prereleases: true
30+
cache: pip
31+
cache-dependency-path: pyproject.toml
1832
- name: Create virtualenv and install package
33+
shell: bash
1934
run: |
2035
python -m venv env
21-
source env/bin/activate
22-
pip install --upgrade pip setuptools wheel maturin pytest virtualenv
36+
if [[ "${{ matrix.python-version }}" == "pypy3.11" ]]; then
37+
echo "Skipping pip upgrade for PyPy3.11"
38+
else
39+
python -m pip install --upgrade pip
40+
fi
41+
if [ "$RUNNER_OS" == "Windows" ]; then
42+
source env/Scripts/activate
43+
else
44+
source env/bin/activate
45+
fi
46+
pip install -U setuptools wheel maturin pytest virtualenv
2347
maturin develop --release
2448
- name: Test
49+
shell: bash
2550
run: |
26-
source env/bin/activate
51+
if [ "$RUNNER_OS" == "Windows" ]; then
52+
source env/Scripts/activate
53+
else
54+
source env/bin/activate
55+
fi
2756
python -m pytest

0 commit comments

Comments
 (0)