uuid7-rs 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- uuid7_rs-0.0.1/.cargo/config.toml +4 -0
- uuid7_rs-0.0.1/.github/dependabot.yaml +14 -0
- uuid7_rs-0.0.1/.github/scripts/test_wasm_wheel.mjs +43 -0
- uuid7_rs-0.0.1/.github/workflows/ci.yaml +229 -0
- uuid7_rs-0.0.1/.github/workflows/linux.yaml +93 -0
- uuid7_rs-0.0.1/.github/workflows/macos.yaml +59 -0
- uuid7_rs-0.0.1/.github/workflows/musllinux.yaml +76 -0
- uuid7_rs-0.0.1/.github/workflows/tests.yaml +63 -0
- uuid7_rs-0.0.1/.github/workflows/wasm.yaml +137 -0
- uuid7_rs-0.0.1/.github/workflows/windows.yaml +68 -0
- uuid7_rs-0.0.1/.gitignore +21 -0
- uuid7_rs-0.0.1/.ruff.toml +63 -0
- uuid7_rs-0.0.1/.rumdl.toml +16 -0
- uuid7_rs-0.0.1/.rustfmt.nightly.toml +8 -0
- uuid7_rs-0.0.1/.typos.toml +0 -0
- uuid7_rs-0.0.1/Cargo.lock +509 -0
- uuid7_rs-0.0.1/Cargo.toml +55 -0
- uuid7_rs-0.0.1/PKG-INFO +82 -0
- uuid7_rs-0.0.1/README.md +57 -0
- uuid7_rs-0.0.1/benchmark/README.md +47 -0
- uuid7_rs-0.0.1/benchmark/run.py +179 -0
- uuid7_rs-0.0.1/benchmark/uuid7-compact.svg +1 -0
- uuid7_rs-0.0.1/benchmark/uuid7.svg +1 -0
- uuid7_rs-0.0.1/build.rs +3 -0
- uuid7_rs-0.0.1/py-src/uuid7_rs/__init__.py +23 -0
- uuid7_rs-0.0.1/py-src/uuid7_rs/_core.pyi +118 -0
- uuid7_rs-0.0.1/py-src/uuid7_rs/compat/__init__.py +56 -0
- uuid7_rs-0.0.1/py-src/uuid7_rs/py.typed +1 -0
- uuid7_rs-0.0.1/pyproject.toml +71 -0
- uuid7_rs-0.0.1/rust-toolchain.toml +2 -0
- uuid7_rs-0.0.1/src/hex/hex.rs +96 -0
- uuid7_rs-0.0.1/src/hex/table.rs +57 -0
- uuid7_rs-0.0.1/src/hex.rs +3 -0
- uuid7_rs-0.0.1/src/lib.rs +107 -0
- uuid7_rs-0.0.1/src/parse.rs +258 -0
- uuid7_rs-0.0.1/src/rng.rs +348 -0
- uuid7_rs-0.0.1/src/unix/time.rs +18 -0
- uuid7_rs-0.0.1/src/unix.rs +1 -0
- uuid7_rs-0.0.1/src/uuid/class.rs +409 -0
- uuid7_rs-0.0.1/src/uuid/dunder.rs +72 -0
- uuid7_rs-0.0.1/src/uuid/property.rs +164 -0
- uuid7_rs-0.0.1/src/uuid/uuid7.rs +195 -0
- uuid7_rs-0.0.1/src/uuid/uuid_obj.rs +6 -0
- uuid7_rs-0.0.1/src/uuid.rs +5 -0
- uuid7_rs-0.0.1/src/windows/time.rs +38 -0
- uuid7_rs-0.0.1/src/windows/win_api.rs +18 -0
- uuid7_rs-0.0.1/src/windows.rs +3 -0
- uuid7_rs-0.0.1/tests/__init__.py +0 -0
- uuid7_rs-0.0.1/tests/test_uuid7.py +407 -0
- uuid7_rs-0.0.1/ty.toml +10 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "github-actions" # zizmor: ignore[dependabot-cooldown]
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
target-branch: main
|
|
8
|
+
|
|
9
|
+
- package-ecosystem: "cargo" # zizmor: ignore[dependabot-cooldown]
|
|
10
|
+
directory: "/"
|
|
11
|
+
schedule:
|
|
12
|
+
interval: "cron"
|
|
13
|
+
cronjob: "0 12 * * *"
|
|
14
|
+
target-branch: main
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { basename, resolve } from "node:path";
|
|
3
|
+
|
|
4
|
+
const { WHEEL_PATH, PYODIDE_VERSION } = process.env;
|
|
5
|
+
|
|
6
|
+
if (!WHEEL_PATH) {
|
|
7
|
+
throw new Error("WHEEL_PATH is required");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
if (!PYODIDE_VERSION) {
|
|
11
|
+
throw new Error("PYODIDE_VERSION is required");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const { loadPyodide } = await import("pyodide");
|
|
16
|
+
const indexURL = `${resolve("node_modules/pyodide").replace(/\\/g, "/")}/`;
|
|
17
|
+
const pyodide = await loadPyodide({ indexURL });
|
|
18
|
+
await pyodide.loadPackage("micropip");
|
|
19
|
+
|
|
20
|
+
const wheelBytes = new Uint8Array(await readFile(WHEEL_PATH));
|
|
21
|
+
const wheelName = basename(WHEEL_PATH);
|
|
22
|
+
const wheelInFs = `/tmp/${wheelName}`;
|
|
23
|
+
pyodide.FS.writeFile(wheelInFs, wheelBytes);
|
|
24
|
+
|
|
25
|
+
const installed = await pyodide.runPythonAsync(`
|
|
26
|
+
import micropip
|
|
27
|
+
|
|
28
|
+
await micropip.install("emfs:${wheelInFs}")
|
|
29
|
+
|
|
30
|
+
import uuid7_rs
|
|
31
|
+
uuid7_rs.__version__
|
|
32
|
+
`);
|
|
33
|
+
|
|
34
|
+
if (!installed) {
|
|
35
|
+
throw new Error(`uuid7_rs.__version__ is empty for pyodide ${PYODIDE_VERSION}`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
console.log(`ok pyodide=${PYODIDE_VERSION} uuid7_rs=${installed}`);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
41
|
+
console.error(`fail pyodide=${PYODIDE_VERSION} message=${message}`);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
permissions: { }
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- main
|
|
9
|
+
tags:
|
|
10
|
+
- "*"
|
|
11
|
+
paths-ignore:
|
|
12
|
+
- "benchmark/*.svg"
|
|
13
|
+
|
|
14
|
+
pull_request:
|
|
15
|
+
paths-ignore:
|
|
16
|
+
- "benchmark/*.svg"
|
|
17
|
+
|
|
18
|
+
workflow_dispatch:
|
|
19
|
+
|
|
20
|
+
concurrency:
|
|
21
|
+
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
|
|
22
|
+
cancel-in-progress: true
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
cargo-fmt:
|
|
26
|
+
name: "cargo fmt"
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
timeout-minutes: 10
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
31
|
+
with:
|
|
32
|
+
persist-credentials: false
|
|
33
|
+
|
|
34
|
+
- name: "Install Rust nightly + rustfmt"
|
|
35
|
+
run: rustup toolchain install nightly --component rustfmt
|
|
36
|
+
|
|
37
|
+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
|
38
|
+
with:
|
|
39
|
+
lookup-only: true
|
|
40
|
+
- run: cargo fmt-nightly --check
|
|
41
|
+
|
|
42
|
+
cargo-clippy:
|
|
43
|
+
name: "cargo clippy"
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
timeout-minutes: 10
|
|
46
|
+
steps:
|
|
47
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
48
|
+
with:
|
|
49
|
+
persist-credentials: false
|
|
50
|
+
|
|
51
|
+
- name: "Install Rust nightly + clippy"
|
|
52
|
+
run: rustup toolchain install nightly --component clippy
|
|
53
|
+
|
|
54
|
+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
|
55
|
+
with:
|
|
56
|
+
lookup-only: true
|
|
57
|
+
- run: cargo clippy --all-targets
|
|
58
|
+
|
|
59
|
+
zizmor:
|
|
60
|
+
name: "zizmor"
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
64
|
+
with:
|
|
65
|
+
persist-credentials: false
|
|
66
|
+
|
|
67
|
+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
68
|
+
with:
|
|
69
|
+
python-version: "3.14"
|
|
70
|
+
|
|
71
|
+
- name: "Install uv"
|
|
72
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
|
73
|
+
with:
|
|
74
|
+
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
|
|
75
|
+
|
|
76
|
+
- name: "Install zizmor"
|
|
77
|
+
run: uv pip install --group zizmor --system
|
|
78
|
+
|
|
79
|
+
- name: "Run zizmor"
|
|
80
|
+
run: zizmor .github/
|
|
81
|
+
|
|
82
|
+
typos:
|
|
83
|
+
name: "typos"
|
|
84
|
+
runs-on: ubuntu-latest
|
|
85
|
+
steps:
|
|
86
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
87
|
+
with:
|
|
88
|
+
persist-credentials: false
|
|
89
|
+
|
|
90
|
+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
91
|
+
with:
|
|
92
|
+
python-version: "3.14"
|
|
93
|
+
|
|
94
|
+
- name: "Install uv"
|
|
95
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
|
96
|
+
with:
|
|
97
|
+
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
|
|
98
|
+
|
|
99
|
+
- name: "Install typos"
|
|
100
|
+
run: uv pip install --group typos --system
|
|
101
|
+
|
|
102
|
+
- name: "Run typos"
|
|
103
|
+
run: typos --config .typos.toml
|
|
104
|
+
|
|
105
|
+
rumdl:
|
|
106
|
+
name: "rumdl"
|
|
107
|
+
runs-on: ubuntu-latest
|
|
108
|
+
steps:
|
|
109
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
110
|
+
with:
|
|
111
|
+
persist-credentials: false
|
|
112
|
+
|
|
113
|
+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
114
|
+
with:
|
|
115
|
+
python-version: "3.14"
|
|
116
|
+
|
|
117
|
+
- name: "Install uv"
|
|
118
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
|
119
|
+
with:
|
|
120
|
+
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
|
|
121
|
+
|
|
122
|
+
- name: "Install rumdl"
|
|
123
|
+
run: uv pip install --group rumdl --system
|
|
124
|
+
|
|
125
|
+
- name: "Run rumdl"
|
|
126
|
+
run: rumdl check .
|
|
127
|
+
|
|
128
|
+
tests:
|
|
129
|
+
uses: ./.github/workflows/tests.yaml
|
|
130
|
+
|
|
131
|
+
linux:
|
|
132
|
+
needs: [ tests, cargo-fmt, cargo-clippy, zizmor, typos, rumdl ]
|
|
133
|
+
uses: ./.github/workflows/linux.yaml
|
|
134
|
+
|
|
135
|
+
musllinux:
|
|
136
|
+
needs: [ tests, cargo-fmt, cargo-clippy, zizmor, typos, rumdl ]
|
|
137
|
+
uses: ./.github/workflows/musllinux.yaml
|
|
138
|
+
|
|
139
|
+
windows:
|
|
140
|
+
needs: [ tests, cargo-fmt, cargo-clippy, zizmor, typos, rumdl ]
|
|
141
|
+
uses: ./.github/workflows/windows.yaml
|
|
142
|
+
|
|
143
|
+
macos:
|
|
144
|
+
needs: [ tests, cargo-fmt, cargo-clippy, zizmor, typos, rumdl ]
|
|
145
|
+
uses: ./.github/workflows/macos.yaml
|
|
146
|
+
|
|
147
|
+
wasm:
|
|
148
|
+
needs: [ tests, cargo-fmt, cargo-clippy, zizmor, typos, rumdl ]
|
|
149
|
+
uses: ./.github/workflows/wasm.yaml
|
|
150
|
+
|
|
151
|
+
build-sdist:
|
|
152
|
+
name: "build-sdist"
|
|
153
|
+
runs-on: ubuntu-latest
|
|
154
|
+
steps:
|
|
155
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
156
|
+
with:
|
|
157
|
+
persist-credentials: false
|
|
158
|
+
|
|
159
|
+
- name: "Build sdist"
|
|
160
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
161
|
+
with:
|
|
162
|
+
command: sdist
|
|
163
|
+
args: --out dist
|
|
164
|
+
rust-toolchain: nightly
|
|
165
|
+
|
|
166
|
+
- name: "Upload sdist"
|
|
167
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
168
|
+
with:
|
|
169
|
+
name: wheels-sdist
|
|
170
|
+
path: dist
|
|
171
|
+
|
|
172
|
+
release:
|
|
173
|
+
name: "Release"
|
|
174
|
+
runs-on: ubuntu-latest
|
|
175
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
|
|
176
|
+
environment: pypi
|
|
177
|
+
needs: [
|
|
178
|
+
build-sdist,
|
|
179
|
+
linux,
|
|
180
|
+
musllinux,
|
|
181
|
+
windows,
|
|
182
|
+
macos,
|
|
183
|
+
wasm,
|
|
184
|
+
]
|
|
185
|
+
permissions:
|
|
186
|
+
# Use to sign the release artifacts
|
|
187
|
+
id-token: write
|
|
188
|
+
# Used to upload release artifacts
|
|
189
|
+
contents: write
|
|
190
|
+
# Used to generate artifact attestation
|
|
191
|
+
attestations: write
|
|
192
|
+
steps:
|
|
193
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
194
|
+
|
|
195
|
+
- name: "Generate artifact attestation"
|
|
196
|
+
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
|
|
197
|
+
with:
|
|
198
|
+
subject-path: "wheels-*/*"
|
|
199
|
+
|
|
200
|
+
- name: "Install uv"
|
|
201
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
202
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
|
203
|
+
with:
|
|
204
|
+
enable-cache: false
|
|
205
|
+
|
|
206
|
+
- name: "Publish to PyPI"
|
|
207
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
208
|
+
run: uv publish 'wheels-*/*'
|
|
209
|
+
env:
|
|
210
|
+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
|
211
|
+
|
|
212
|
+
- name: "Download wasm artifacts"
|
|
213
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
214
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
215
|
+
with:
|
|
216
|
+
pattern: wasm-wheels-*
|
|
217
|
+
merge-multiple: true
|
|
218
|
+
path: wasm
|
|
219
|
+
|
|
220
|
+
- name: "Upload wasm wheels to GitHub Release"
|
|
221
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
222
|
+
run: |
|
|
223
|
+
tag="${GITHUB_REF#refs/tags/}"
|
|
224
|
+
gh release view "$tag" >/dev/null 2>&1 || \
|
|
225
|
+
gh release create "$tag" --title "$tag" --notes ""
|
|
226
|
+
gh release upload "$tag" wasm/*.whl --clobber
|
|
227
|
+
env:
|
|
228
|
+
GH_REPO: ${{ github.repository }}
|
|
229
|
+
GH_TOKEN: ${{ github.token }}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
name: "linux"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
linux:
|
|
8
|
+
name: "${{ matrix.platform.runner }} / ${{ matrix.platform.target }}"
|
|
9
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
10
|
+
strategy:
|
|
11
|
+
fail-fast: false
|
|
12
|
+
matrix:
|
|
13
|
+
# PyPI does not support Rust target `loongarch64-unknown-linux-gnu`
|
|
14
|
+
platform:
|
|
15
|
+
- {
|
|
16
|
+
# AMD64
|
|
17
|
+
runner: ubuntu-latest,
|
|
18
|
+
target: x86_64,
|
|
19
|
+
interpreter: "3.10 3.11 3.12 3.13 3.14 pypy3.11",
|
|
20
|
+
maturin-build-args: "--features mimalloc",
|
|
21
|
+
}
|
|
22
|
+
- {
|
|
23
|
+
# x86 (32-bit)
|
|
24
|
+
runner: ubuntu-latest,
|
|
25
|
+
target: x86,
|
|
26
|
+
interpreter: "3.10 3.11 3.12 3.13 3.14 pypy3.11",
|
|
27
|
+
maturin-build-args: "--features mimalloc",
|
|
28
|
+
}
|
|
29
|
+
- {
|
|
30
|
+
# ARM64
|
|
31
|
+
runner: ubuntu-24.04-arm,
|
|
32
|
+
target: aarch64,
|
|
33
|
+
interpreter: "3.10 3.11 3.12 3.13 3.14 pypy3.11",
|
|
34
|
+
maturin-build-args: "--features mimalloc",
|
|
35
|
+
}
|
|
36
|
+
- {
|
|
37
|
+
# ARMv7 (32-bit)
|
|
38
|
+
runner: ubuntu-latest,
|
|
39
|
+
target: armv7,
|
|
40
|
+
interpreter: "3.10 3.11 3.12 3.13 3.14 pypy3.11",
|
|
41
|
+
maturin-build-args: "",
|
|
42
|
+
}
|
|
43
|
+
- {
|
|
44
|
+
# IBM System z (s390x)
|
|
45
|
+
runner: ubuntu-latest,
|
|
46
|
+
target: s390x,
|
|
47
|
+
interpreter: "3.10 3.11 3.12 3.13 3.14 pypy3.11",
|
|
48
|
+
maturin-build-args: "",
|
|
49
|
+
}
|
|
50
|
+
- {
|
|
51
|
+
# PowerPC64 Little Endian
|
|
52
|
+
runner: ubuntu-latest,
|
|
53
|
+
target: ppc64le,
|
|
54
|
+
interpreter: "3.10 3.11 3.12 3.13 3.14 pypy3.11",
|
|
55
|
+
maturin-build-args: "",
|
|
56
|
+
}
|
|
57
|
+
- {
|
|
58
|
+
# RISC-V 64-bit
|
|
59
|
+
runner: ubuntu-latest,
|
|
60
|
+
target: riscv64,
|
|
61
|
+
interpreter: "3.10 3.11 3.12 3.13 3.14 pypy3.11",
|
|
62
|
+
maturin-build-args: "--features mimalloc",
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
steps:
|
|
66
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
67
|
+
with:
|
|
68
|
+
persist-credentials: false
|
|
69
|
+
|
|
70
|
+
- name: "Install uv"
|
|
71
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
|
72
|
+
with:
|
|
73
|
+
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
|
|
74
|
+
|
|
75
|
+
- name: "Build wheels"
|
|
76
|
+
if: matrix.platform.use-pgo == false
|
|
77
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
78
|
+
with:
|
|
79
|
+
target: ${{ matrix.platform.target }}
|
|
80
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
|
|
81
|
+
manylinux: auto
|
|
82
|
+
args: >
|
|
83
|
+
--release
|
|
84
|
+
--out dist
|
|
85
|
+
--interpreter ${{ matrix.platform.interpreter }}
|
|
86
|
+
${{ matrix.platform.maturin-build-args }}
|
|
87
|
+
--compatibility pypi
|
|
88
|
+
|
|
89
|
+
- name: "Upload wheels"
|
|
90
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
91
|
+
with:
|
|
92
|
+
name: wheels-linux-${{ matrix.platform.target }}
|
|
93
|
+
path: dist
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: "macOS"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
macos:
|
|
8
|
+
name: "macos-latest / ${{ matrix.platform.target }}"
|
|
9
|
+
runs-on: macos-latest
|
|
10
|
+
strategy:
|
|
11
|
+
fail-fast: false
|
|
12
|
+
matrix:
|
|
13
|
+
platform:
|
|
14
|
+
- {
|
|
15
|
+
# Intel Mac
|
|
16
|
+
target: x86_64,
|
|
17
|
+
interpreter: "3.10 3.11 3.12 3.13 3.14 pypy3.11",
|
|
18
|
+
maturin-build-args: "--features mimalloc",
|
|
19
|
+
}
|
|
20
|
+
- {
|
|
21
|
+
# Apple Silicon M1-M4
|
|
22
|
+
target: aarch64,
|
|
23
|
+
interpreter: "3.10 3.11 3.12 3.13 3.14 pypy3.11",
|
|
24
|
+
maturin-build-args: "--features mimalloc",
|
|
25
|
+
}
|
|
26
|
+
- {
|
|
27
|
+
# Universal binary (Intel + Apple Silicon)
|
|
28
|
+
target: universal2,
|
|
29
|
+
interpreter: "3.10 3.11 3.12 3.13 3.14 pypy3.11",
|
|
30
|
+
maturin-build-args: "--features mimalloc",
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
35
|
+
with:
|
|
36
|
+
persist-credentials: false
|
|
37
|
+
|
|
38
|
+
- name: "Install uv"
|
|
39
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
|
40
|
+
with:
|
|
41
|
+
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
|
|
42
|
+
|
|
43
|
+
- name: "Build wheels"
|
|
44
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
45
|
+
with:
|
|
46
|
+
target: ${{ matrix.platform.target }}
|
|
47
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
|
|
48
|
+
args: >
|
|
49
|
+
--release
|
|
50
|
+
--out dist
|
|
51
|
+
--interpreter ${{ matrix.platform.interpreter }}
|
|
52
|
+
${{ matrix.platform.maturin-build-args }}
|
|
53
|
+
--compatibility pypi
|
|
54
|
+
|
|
55
|
+
- name: "Upload wheels"
|
|
56
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
57
|
+
with:
|
|
58
|
+
name: wheels-macos-${{ matrix.platform.target }}
|
|
59
|
+
path: dist
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
name: "musllinux"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
musllinux:
|
|
8
|
+
name: "ubuntu-latest / ${{ matrix.platform.target }}"
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
strategy:
|
|
11
|
+
fail-fast: false
|
|
12
|
+
matrix:
|
|
13
|
+
# PyPI does not support Rust target `loongarch64-unknown-linux-gnu`
|
|
14
|
+
# `s390x-unknown-linux-musl` is not available as prebuilt target for cross-compilation
|
|
15
|
+
# `s390x` is only supported for manylinux (gnu), not musllinux
|
|
16
|
+
platform:
|
|
17
|
+
- {
|
|
18
|
+
# AMD64
|
|
19
|
+
target: x86_64,
|
|
20
|
+
interpreter: "3.10 3.11 3.12 3.13 3.14 pypy3.11",
|
|
21
|
+
maturin-build-args: "--features mimalloc"
|
|
22
|
+
}
|
|
23
|
+
- {
|
|
24
|
+
# x86 (32-bit)
|
|
25
|
+
target: x86,
|
|
26
|
+
interpreter: "3.10 3.11 3.12 3.13 3.14 pypy3.11",
|
|
27
|
+
maturin-build-args: "--features mimalloc"
|
|
28
|
+
}
|
|
29
|
+
- {
|
|
30
|
+
# ARM64
|
|
31
|
+
target: aarch64,
|
|
32
|
+
interpreter: "3.10 3.11 3.12 3.13 3.14 pypy3.11",
|
|
33
|
+
maturin-build-args: "--features mimalloc"
|
|
34
|
+
}
|
|
35
|
+
- {
|
|
36
|
+
# ARMv7 (32-bit)
|
|
37
|
+
target: armv7,
|
|
38
|
+
interpreter: "3.10 3.11 3.12 3.13 3.14 pypy3.11",
|
|
39
|
+
maturin-build-args: "--features mimalloc"
|
|
40
|
+
}
|
|
41
|
+
- {
|
|
42
|
+
# PowerPC64 Little Endian
|
|
43
|
+
target: ppc64le,
|
|
44
|
+
interpreter: "3.10 3.11 3.12 3.13 3.14 pypy3.11",
|
|
45
|
+
maturin-build-args: "--features mimalloc"
|
|
46
|
+
}
|
|
47
|
+
- {
|
|
48
|
+
# RISC-V 64-bit
|
|
49
|
+
target: riscv64,
|
|
50
|
+
interpreter: "3.10 3.11 3.12 3.13 3.14 pypy3.11",
|
|
51
|
+
maturin-build-args: "--features mimalloc"
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
steps:
|
|
55
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
56
|
+
with:
|
|
57
|
+
persist-credentials: false
|
|
58
|
+
|
|
59
|
+
- name: "Build wheels"
|
|
60
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
61
|
+
with:
|
|
62
|
+
target: ${{ matrix.platform.target }}
|
|
63
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
|
|
64
|
+
manylinux: musllinux_1_2
|
|
65
|
+
args: >
|
|
66
|
+
--release
|
|
67
|
+
--out dist
|
|
68
|
+
--interpreter ${{ matrix.platform.interpreter }}
|
|
69
|
+
${{ matrix.platform.maturin-build-args }}
|
|
70
|
+
--compatibility pypi
|
|
71
|
+
|
|
72
|
+
- name: "Upload wheels"
|
|
73
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
74
|
+
with:
|
|
75
|
+
name: wheels-musllinux-${{ matrix.platform.target }}
|
|
76
|
+
path: dist
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: "tests"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
tests:
|
|
8
|
+
name: "${{ matrix.os }} / python ${{ matrix.python-version }}"
|
|
9
|
+
runs-on: ${{ matrix.os }}
|
|
10
|
+
timeout-minutes: 10
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: [
|
|
15
|
+
"3.10",
|
|
16
|
+
"3.11",
|
|
17
|
+
"3.12",
|
|
18
|
+
"3.13",
|
|
19
|
+
"3.14",
|
|
20
|
+
"pypy3.11",
|
|
21
|
+
]
|
|
22
|
+
os: [
|
|
23
|
+
"ubuntu-latest",
|
|
24
|
+
"windows-latest",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
29
|
+
with:
|
|
30
|
+
persist-credentials: false
|
|
31
|
+
|
|
32
|
+
- name: "Install uv"
|
|
33
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
|
34
|
+
with:
|
|
35
|
+
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
|
|
36
|
+
|
|
37
|
+
- name: "Create and activate .venv"
|
|
38
|
+
shell: bash
|
|
39
|
+
run: |
|
|
40
|
+
uv venv .venv --python ${{ matrix.python-version }}
|
|
41
|
+
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
|
|
42
|
+
echo ".venv/Scripts" >> "$GITHUB_PATH"
|
|
43
|
+
echo "PYO3_PYTHON=.venv/Scripts/python" >> "$GITHUB_ENV"
|
|
44
|
+
else
|
|
45
|
+
echo ".venv/bin" >> "$GITHUB_PATH"
|
|
46
|
+
echo "PYO3_PYTHON=.venv/bin/python3" >> "$GITHUB_ENV"
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
- name: "Install dependencies"
|
|
50
|
+
run: uv pip install --group ci
|
|
51
|
+
|
|
52
|
+
- name: "Run maturin"
|
|
53
|
+
run: maturin build --out wheel --release
|
|
54
|
+
|
|
55
|
+
- name: "Install built wheel"
|
|
56
|
+
shell: bash
|
|
57
|
+
run: uv pip install wheel/*.whl
|
|
58
|
+
|
|
59
|
+
- name: "Run ruff"
|
|
60
|
+
run: ruff check
|
|
61
|
+
|
|
62
|
+
- name: "Run pytest"
|
|
63
|
+
run: pytest tests/
|