maturin 1.8.2__py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl → 1.8.4__py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
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.
Potentially problematic release.
This version of maturin might be problematic. Click here for more details.
- maturin/__init__.py +28 -8
- maturin/bootstrap.py +31 -0
- {maturin-1.8.2.data → maturin-1.8.4.data}/scripts/maturin +0 -0
- {maturin-1.8.2.dist-info → maturin-1.8.4.dist-info}/METADATA +18 -14
- maturin-1.8.4.dist-info/RECORD +7 -0
- {maturin-1.8.2.dist-info → maturin-1.8.4.dist-info}/WHEEL +1 -1
- maturin-1.8.2.dist-info/RECORD +0 -6
maturin/__init__.py
CHANGED
|
@@ -34,7 +34,10 @@ def get_config() -> Dict[str, str]:
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
def get_maturin_pep517_args(config_settings: Optional[Mapping[str, Any]] = None) -> List[str]:
|
|
37
|
-
build_args =
|
|
37
|
+
build_args = None
|
|
38
|
+
if config_settings:
|
|
39
|
+
# TODO: Deprecate and remove build-args in favor of maturin.build-args in maturin 2.0
|
|
40
|
+
build_args = config_settings.get("maturin.build-args", config_settings.get("build-args"))
|
|
38
41
|
if build_args is None:
|
|
39
42
|
env_args = os.getenv("MATURIN_PEP517_ARGS", "")
|
|
40
43
|
args = shlex.split(env_args)
|
|
@@ -65,6 +68,17 @@ def _additional_pep517_args() -> List[str]:
|
|
|
65
68
|
return []
|
|
66
69
|
|
|
67
70
|
|
|
71
|
+
def _get_env() -> Optional[Dict[str, str]]:
|
|
72
|
+
if not os.environ.get("MATURIN_NO_INSTALL_RUST") and not shutil.which("cargo"):
|
|
73
|
+
from puccinialin import setup_rust
|
|
74
|
+
|
|
75
|
+
print("Rust not found, installing into a temporary directory")
|
|
76
|
+
extra_env = setup_rust()
|
|
77
|
+
return {**os.environ, **extra_env}
|
|
78
|
+
else:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
|
|
68
82
|
# noinspection PyUnusedLocal
|
|
69
83
|
def _build_wheel(
|
|
70
84
|
wheel_directory: str,
|
|
@@ -97,7 +111,7 @@ def _build_wheel(
|
|
|
97
111
|
|
|
98
112
|
print("Running `{}`".format(" ".join(command)))
|
|
99
113
|
sys.stdout.flush()
|
|
100
|
-
result = subprocess.run(command, stdout=subprocess.PIPE)
|
|
114
|
+
result = subprocess.run(command, stdout=subprocess.PIPE, env=_get_env())
|
|
101
115
|
sys.stdout.buffer.write(result.stdout)
|
|
102
116
|
sys.stdout.flush()
|
|
103
117
|
if result.returncode != 0:
|
|
@@ -125,7 +139,7 @@ def build_sdist(sdist_directory: str, config_settings: Optional[Mapping[str, Any
|
|
|
125
139
|
|
|
126
140
|
print("Running `{}`".format(" ".join(command)))
|
|
127
141
|
sys.stdout.flush()
|
|
128
|
-
result = subprocess.run(command, stdout=subprocess.PIPE)
|
|
142
|
+
result = subprocess.run(command, stdout=subprocess.PIPE, env=_get_env())
|
|
129
143
|
sys.stdout.buffer.write(result.stdout)
|
|
130
144
|
sys.stdout.flush()
|
|
131
145
|
if result.returncode != 0:
|
|
@@ -138,9 +152,12 @@ def build_sdist(sdist_directory: str, config_settings: Optional[Mapping[str, Any
|
|
|
138
152
|
# noinspection PyUnusedLocal
|
|
139
153
|
def get_requires_for_build_wheel(config_settings: Optional[Mapping[str, Any]] = None) -> List[str]:
|
|
140
154
|
if get_config().get("bindings") == "cffi":
|
|
141
|
-
|
|
155
|
+
requirements = ["cffi"]
|
|
142
156
|
else:
|
|
143
|
-
|
|
157
|
+
requirements = []
|
|
158
|
+
if not os.environ.get("MATURIN_NO_INSTALL_RUST") and not shutil.which("cargo"):
|
|
159
|
+
requirements += ["puccinialin"]
|
|
160
|
+
return requirements
|
|
144
161
|
|
|
145
162
|
|
|
146
163
|
# noinspection PyUnusedLocal
|
|
@@ -158,7 +175,10 @@ get_requires_for_build_editable = get_requires_for_build_wheel
|
|
|
158
175
|
|
|
159
176
|
# noinspection PyUnusedLocal
|
|
160
177
|
def get_requires_for_build_sdist(config_settings: Optional[Mapping[str, Any]] = None) -> List[str]:
|
|
161
|
-
|
|
178
|
+
requirements = []
|
|
179
|
+
if not os.environ.get("MATURIN_NO_INSTALL_RUST") and not shutil.which("cargo"):
|
|
180
|
+
requirements += ["puccinialin"]
|
|
181
|
+
return requirements
|
|
162
182
|
|
|
163
183
|
|
|
164
184
|
# noinspection PyUnusedLocal
|
|
@@ -168,7 +188,7 @@ def prepare_metadata_for_build_wheel(
|
|
|
168
188
|
print("Checking for Rust toolchain....")
|
|
169
189
|
is_cargo_installed = False
|
|
170
190
|
try:
|
|
171
|
-
output = subprocess.check_output(["cargo", "--version"]).decode("utf-8", "ignore")
|
|
191
|
+
output = subprocess.check_output(["cargo", "--version"], env=_get_env()).decode("utf-8", "ignore")
|
|
172
192
|
if "cargo" in output:
|
|
173
193
|
is_cargo_installed = True
|
|
174
194
|
except (FileNotFoundError, SubprocessError):
|
|
@@ -200,7 +220,7 @@ def prepare_metadata_for_build_wheel(
|
|
|
200
220
|
|
|
201
221
|
print("Running `{}`".format(" ".join(command)))
|
|
202
222
|
try:
|
|
203
|
-
_output = subprocess.check_output(command)
|
|
223
|
+
_output = subprocess.check_output(command, env=_get_env())
|
|
204
224
|
except subprocess.CalledProcessError as e:
|
|
205
225
|
sys.stderr.write(f"Error running maturin: {e}\n")
|
|
206
226
|
sys.exit(1)
|
maturin/bootstrap.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""Support installing rust before compiling (bootstrapping) maturin.
|
|
2
|
+
|
|
3
|
+
Installing a package that uses maturin as build backend on a platform without maturin
|
|
4
|
+
binaries, we install rust in a cache directory if the user doesn't have a rust
|
|
5
|
+
installation already. Since this bootstrapping requires more dependencies but is only
|
|
6
|
+
required if rust is missing, we check if cargo is present before requesting those
|
|
7
|
+
dependencies.
|
|
8
|
+
|
|
9
|
+
https://setuptools.pypa.io/en/stable/build_meta.html#dynamic-build-dependencies-and-other-build-meta-tweaks
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import os
|
|
15
|
+
import shutil
|
|
16
|
+
from typing import Any
|
|
17
|
+
|
|
18
|
+
# noinspection PyUnresolvedReferences
|
|
19
|
+
from setuptools.build_meta import * # noqa:F403
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def get_requires_for_build_wheel(_config_settings: dict[str, Any] | None = None) -> list[str]:
|
|
23
|
+
if not os.environ.get("MATURIN_NO_INSTALL_RUST") and not shutil.which("cargo"):
|
|
24
|
+
return ["puccinialin>=0.1,<0.2"]
|
|
25
|
+
return []
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def get_requires_for_build_sdist(_config_settings: dict[str, Any] | None = None) -> list[str]:
|
|
29
|
+
if not os.environ.get("MATURIN_NO_INSTALL_RUST") and not shutil.which("cargo"):
|
|
30
|
+
return ["puccinialin>=0.1,<0.2"]
|
|
31
|
+
return []
|
|
Binary file
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maturin
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.4
|
|
4
4
|
Classifier: Topic :: Software Development :: Build Tools
|
|
5
5
|
Classifier: Programming Language :: Rust
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
7
7
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
8
|
-
Requires-Dist: tomli
|
|
9
|
-
Requires-Dist: ziglang
|
|
8
|
+
Requires-Dist: tomli>=1.1.0 ; python_full_version < '3.11'
|
|
9
|
+
Requires-Dist: ziglang>=0.10.0,<0.13.0 ; extra == 'zig'
|
|
10
10
|
Requires-Dist: patchelf ; extra == 'patchelf'
|
|
11
11
|
Provides-Extra: zig
|
|
12
12
|
Provides-Extra: patchelf
|
|
@@ -30,9 +30,7 @@ _formerly pyo3-pack_
|
|
|
30
30
|
[](https://maturin.rs)
|
|
31
31
|
[](https://crates.io/crates/maturin)
|
|
32
32
|
[](https://pypi.org/project/maturin)
|
|
33
|
-
[](https://cirrus-ci.com/github/PyO3/maturin)
|
|
35
|
-
[](https://discord.gg/33kcChzH7f)
|
|
33
|
+
[](https://discord.gg/33kcChzH7f)
|
|
36
34
|
|
|
37
35
|
Build and publish crates with [pyo3, cffi and uniffi bindings](https://maturin.rs/bindings) as well as rust binaries as python packages with minimal configuration.
|
|
38
36
|
It supports building wheels for python 3.8+ on Windows, Linux, macOS and FreeBSD, can upload them to [pypi](https://pypi.org/) and has basic PyPy and GraalPy support.
|
|
@@ -41,10 +39,13 @@ Check out the [User Guide](https://maturin.rs/)!
|
|
|
41
39
|
|
|
42
40
|
## Usage
|
|
43
41
|
|
|
44
|
-
You can either download binaries from the [latest release](https://github.com/PyO3/maturin/releases/latest) or install it with [pipx](https://pypa.github.io/pipx/):
|
|
42
|
+
You can either download binaries from the [latest release](https://github.com/PyO3/maturin/releases/latest) or install it with [pipx](https://pypa.github.io/pipx/) or [uv](https://github.com/astral-sh/uv):
|
|
45
43
|
|
|
46
44
|
```shell
|
|
45
|
+
# pipx
|
|
47
46
|
pipx install maturin
|
|
47
|
+
# uv
|
|
48
|
+
uv tool install maturin
|
|
48
49
|
```
|
|
49
50
|
|
|
50
51
|
> [!NOTE]
|
|
@@ -55,10 +56,10 @@ There are four main commands:
|
|
|
55
56
|
|
|
56
57
|
- `maturin new` creates a new cargo project with maturin configured.
|
|
57
58
|
- `maturin publish` builds the crate into python packages and publishes them to pypi.
|
|
58
|
-
- `maturin build` builds the wheels and stores them in a folder (`target/wheels` by default), but doesn't upload them. It's
|
|
59
|
+
- `maturin build` builds the wheels and stores them in a folder (`target/wheels` by default), but doesn't upload them. It's recommended to publish packages with [uv](https://github.com/astral-sh/uv) using `uv publish`.
|
|
59
60
|
- `maturin develop` builds the crate and installs it as a python module directly in the current virtualenv. Note that while `maturin develop` is faster, it doesn't support all the feature that running `pip install` after `maturin build` supports.
|
|
60
61
|
|
|
61
|
-
maturin doesn't need extra configuration files and doesn't clash with an existing setuptools-rust
|
|
62
|
+
maturin doesn't need extra configuration files and doesn't clash with an existing setuptools-rust configuration.
|
|
62
63
|
You can even integrate it with testing tools such as [tox](https://tox.readthedocs.io/en/latest/).
|
|
63
64
|
There are examples for the different bindings in the `test-crates` folder.
|
|
64
65
|
|
|
@@ -79,7 +80,7 @@ which requires the right compilers to be installed. Installing a wheel is much f
|
|
|
79
80
|
|
|
80
81
|
When you publish a package to be installable with `pip install`, you upload it to [pypi](https://pypi.org/), the official package repository.
|
|
81
82
|
For testing, you can use [test pypi](https://test.pypi.org/) instead, which you can use with `pip install --index-url https://test.pypi.org/simple/`.
|
|
82
|
-
Note that for publishing for linux,
|
|
83
|
+
Note that for [publishing for linux](#manylinux-and-auditwheel), you need to use the manylinux docker container or zig, while for publishing from your repository you can use the [PyO3/maturin-action](https://github.com/PyO3/maturin-action) github action.
|
|
83
84
|
|
|
84
85
|
## Mixed rust/python projects
|
|
85
86
|
|
|
@@ -149,7 +150,7 @@ When doing this also be sure to set the module name in your code to match the la
|
|
|
149
150
|
```rust
|
|
150
151
|
#[pymodule]
|
|
151
152
|
#[pyo3(name="_lib_name")]
|
|
152
|
-
fn my_lib_name(
|
|
153
|
+
fn my_lib_name(m: &Bound<'_, PyModule>) -> PyResult<()> {
|
|
153
154
|
m.add_class::<MyPythonRustClass>()?;
|
|
154
155
|
Ok(())
|
|
155
156
|
}
|
|
@@ -165,10 +166,10 @@ To specify python dependencies, add a list `dependencies` in a `[project]` secti
|
|
|
165
166
|
```toml
|
|
166
167
|
[project]
|
|
167
168
|
name = "my-project"
|
|
168
|
-
dependencies = ["flask~=1.1.0", "toml
|
|
169
|
+
dependencies = ["flask~=1.1.0", "toml>=0.10.2,<0.11.0"]
|
|
169
170
|
```
|
|
170
171
|
|
|
171
|
-
|
|
172
|
+
You can add so called console scripts, which are shell commands that execute some function in your program in the `[project.scripts]` section.
|
|
172
173
|
The keys are the script names while the values are the path to the function in the format `some.module.path:class.function`, where the `class` part is optional. The function is called with no arguments. Example:
|
|
173
174
|
|
|
174
175
|
```toml
|
|
@@ -229,7 +230,7 @@ There's a `maturin sdist` command for only building a source distribution as wor
|
|
|
229
230
|
|
|
230
231
|
For portability reasons, native python modules on linux must only dynamically link a set of very few libraries which are installed basically everywhere, hence the name manylinux.
|
|
231
232
|
The pypa offers special docker images and a tool called [auditwheel](https://github.com/pypa/auditwheel/) to ensure compliance with the [manylinux rules](https://peps.python.org/pep-0599/#the-manylinux2014-policy).
|
|
232
|
-
If you want to publish widely usable wheels for linux pypi, **you need to use a manylinux docker image or
|
|
233
|
+
If you want to publish widely usable wheels for linux pypi, **you need to use a manylinux docker image or build with zig**.
|
|
233
234
|
|
|
234
235
|
The Rust compiler since version 1.64 [requires at least glibc 2.17](https://blog.rust-lang.org/2022/08/01/Increasing-glibc-kernel-requirements.html), so you need to use at least manylinux2014.
|
|
235
236
|
For publishing, we recommend enforcing the same manylinux version as the image with the manylinux flag, e.g. use `--manylinux 2014` if you are building in `quay.io/pypa/manylinux2014_x86_64`.
|
|
@@ -268,7 +269,10 @@ maturin itself is manylinux compliant when compiled for the musl target.
|
|
|
268
269
|
- [roapi](https://github.com/roapi/roapi) - ROAPI automatically spins up read-only APIs for static datasets without requiring you to write a single line of code
|
|
269
270
|
- [robyn](https://github.com/sansyrox/robyn) - A fast and extensible async python web server with a Rust runtime
|
|
270
271
|
- [ruff](https://github.com/charliermarsh/ruff) - An extremely fast Python linter, written in Rust
|
|
272
|
+
- [rnet](https://github.com/0x676e67/rnet) - Asynchronous Python HTTP Client with Black Magic
|
|
273
|
+
- [rustpy-xlsxwriter](https://github.com/rahmadafandi/rustpy-xlsxwriter): A high-performance Python library for generating Excel files, utilizing the [rust_xlsxwriter](https://github.com/jmcnamara/rust_xlsxwriter) crate for efficient data handling.
|
|
271
274
|
- [tantivy-py](https://github.com/quickwit-oss/tantivy-py) - Python bindings for Tantivy
|
|
275
|
+
- [tpchgen-cli](https://github.com/clflushopt/tpchgen-rs/tree/main/tpchgen-cli) - Python CLI binding for `tpchgen`, a blazing fast TPC-H benchmark data generator built in pure Rust with zero dependencies.
|
|
272
276
|
- [watchfiles](https://github.com/samuelcolvin/watchfiles) - Simple, modern and high performance file watching and code reload in python
|
|
273
277
|
- [wonnx](https://github.com/webonnx/wonnx/tree/master/wonnx-py) - Wonnx is a GPU-accelerated ONNX inference run-time written 100% in Rust
|
|
274
278
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
maturin-1.8.4.dist-info/METADATA,sha256=Ha6b1eDSu5xy-T5rPnGL1fZ7vXRwbKPGqtdw15Tvmjg,16552
|
|
2
|
+
maturin-1.8.4.dist-info/WHEEL,sha256=1_TeTe6yJHN8zcGzZjCGOQukC1dMD-uJ_HEhPwINYZE,124
|
|
3
|
+
maturin/__init__.py,sha256=PnrUq1TbEWzMXTvshio2m5JzVy42DLFsjzsiRvPxC9M,8080
|
|
4
|
+
maturin/__main__.py,sha256=Fg40Rg6srWYrH0s2ZgbIOysRDnZf2tX-z5VJAPyOs4Y,1145
|
|
5
|
+
maturin/bootstrap.py,sha256=6IKq0Y-mDUTP19ziOT4TdPFYkcuWdDpNGzUj8FJ_5sQ,1174
|
|
6
|
+
maturin-1.8.4.data/scripts/maturin,sha256=XfdrvHW_HcfR4fmNVhZ1eb1RgMs1ovW3K-nqiCkK6pY,28915976
|
|
7
|
+
maturin-1.8.4.dist-info/RECORD,,
|
maturin-1.8.2.dist-info/RECORD
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
maturin-1.8.2.dist-info/METADATA,sha256=Wi7y_kYCiBDNy3GBzwGQhnsAFwjCRDlNu7G_FgqNWB0,16226
|
|
2
|
-
maturin-1.8.2.dist-info/WHEEL,sha256=Grm7Ya8zGf1WjxDGsL3FccJVX1HRdfa79z_FfohHjcY,124
|
|
3
|
-
maturin/__main__.py,sha256=Fg40Rg6srWYrH0s2ZgbIOysRDnZf2tX-z5VJAPyOs4Y,1145
|
|
4
|
-
maturin/__init__.py,sha256=S6HX3ljHfTCeA0ONi2M2or4QitPkT2wcU0D1b7YOUIk,7187
|
|
5
|
-
maturin-1.8.2.data/scripts/maturin,sha256=PrTBEfHaAIFYj90hju7-3AO7eADJ5H0tY_8eiSB8DOE,28488352
|
|
6
|
-
maturin-1.8.2.dist-info/RECORD,,
|