maturin 1.5.0__py3-none-win_amd64.whl → 1.6.0__py3-none-win_amd64.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 CHANGED
@@ -8,6 +8,7 @@ On windows, apparently pip's subprocess handling sets stdout to some windows enc
8
8
  even though the terminal supports utf8. Writing directly to the binary stdout buffer avoids encoding errors due to
9
9
  maturin's emojis.
10
10
  """
11
+
11
12
  from __future__ import annotations
12
13
 
13
14
  import os
@@ -44,6 +45,15 @@ def get_maturin_pep517_args(config_settings: Optional[Mapping[str, Any]] = None)
44
45
  return args
45
46
 
46
47
 
48
+ def _get_sys_executable() -> str:
49
+ # Use the base interpreter path when running inside a venv to avoid recompilation
50
+ # when switching between venvs
51
+ executable = getattr(sys, "_base_executable", sys.executable)
52
+ if not os.path.exists(executable):
53
+ executable = sys.executable
54
+ return executable
55
+
56
+
47
57
  def _additional_pep517_args() -> List[str]:
48
58
  # Support building for 32-bit Python on x64 Windows
49
59
  if platform.system().lower() == "windows" and platform.machine().lower() == "amd64":
@@ -62,22 +72,26 @@ def _build_wheel(
62
72
  ) -> str:
63
73
  # PEP 517 specifies that only `sys.executable` points to the correct
64
74
  # python interpreter
65
- command = [
75
+ base_command = [
66
76
  "maturin",
67
77
  "pep517",
68
78
  "build-wheel",
69
79
  "-i",
70
- sys.executable,
71
- "--compatibility",
72
- "off",
80
+ _get_sys_executable(),
73
81
  ]
74
- command.extend(_additional_pep517_args())
82
+ options = _additional_pep517_args()
75
83
  if editable:
76
- command.append("--editable")
84
+ options.append("--editable")
77
85
 
78
86
  pep517_args = get_maturin_pep517_args(config_settings)
79
87
  if pep517_args:
80
- command.extend(pep517_args)
88
+ options.extend(pep517_args)
89
+
90
+ if "--compatibility" not in options and "--manylinux" not in options:
91
+ # default to off if not otherwise specified
92
+ options = ["--compatibility", "off", *options]
93
+
94
+ command = [*base_command, *options]
81
95
 
82
96
  print("Running `{}`".format(" ".join(command)))
83
97
  sys.stdout.flush()
@@ -175,7 +189,7 @@ def prepare_metadata_for_build_wheel(
175
189
  # PEP 517 specifies that only `sys.executable` points to the correct
176
190
  # python interpreter
177
191
  "--interpreter",
178
- sys.executable,
192
+ _get_sys_executable(),
179
193
  ]
180
194
  command.extend(_additional_pep517_args())
181
195
  pep517_args = get_maturin_pep517_args(config_settings)
maturin/__main__.py CHANGED
@@ -41,4 +41,10 @@ if __name__ == "__main__":
41
41
  print("Unable to find `maturin` script")
42
42
  exit(1)
43
43
 
44
- os.execv(maturin, [str(maturin)] + sys.argv[1:])
44
+ if sys.platform == "win32":
45
+ import subprocess
46
+
47
+ code = subprocess.call([str(maturin)] + sys.argv[1:])
48
+ sys.exit(code)
49
+ else:
50
+ os.execv(maturin, [str(maturin)] + sys.argv[1:])
maturin/import_hook.py CHANGED
@@ -11,6 +11,7 @@ import sys
11
11
  from contextvars import ContextVar
12
12
  from importlib import abc
13
13
  from importlib.machinery import ModuleSpec
14
+ import warnings
14
15
  from types import ModuleType
15
16
  from typing import Sequence
16
17
 
@@ -148,10 +149,15 @@ def install(bindings: str | None = None, release: bool = False) -> Importer | No
148
149
  Install the import hook.
149
150
 
150
151
  :param bindings: Which kind of bindings to use.
151
- Possible values are pyo3, rust-cpython and cffi
152
+ Possible values are pyo3, cffi and uniffi
152
153
 
153
154
  :param release: Build in release mode, otherwise debug mode by default
154
155
  """
156
+ warnings.warn(
157
+ "`maturin.import_hook` is deprecated in favour of a new "
158
+ "`maturin_import_hook` package and will be removed in a future release. See https://maturin.rs/import_hook",
159
+ DeprecationWarning,
160
+ )
155
161
  if _have_importer():
156
162
  return None
157
163
  importer = Importer(bindings=bindings, release=release)
@@ -1,16 +1,16 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: maturin
3
- Version: 1.5.0
3
+ Version: 1.6.0
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
8
  Requires-Dist: tomli >=1.1.0 ; python_version < '3.11'
9
- Requires-Dist: ziglang ~=0.10.0 ; extra == 'zig'
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
13
- Summary: Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries as python packages
13
+ Summary: Build and publish crates with pyo3, cffi and uniffi bindings as well as rust binaries as python packages
14
14
  Keywords: python,cffi,packaging,pypi,pyo3
15
15
  Home-Page: https://github.com/pyo3/maturin
16
16
  Author: konstin <konstin@mailbox.org>, messense <messense@icloud.com>
@@ -32,9 +32,9 @@ _formerly pyo3-pack_
32
32
  [![PyPI](https://img.shields.io/pypi/v/maturin.svg?logo=python&style=flat-square)](https://pypi.org/project/maturin)
33
33
  [![Actions Status](https://img.shields.io/github/actions/workflow/status/PyO3/maturin/test.yml?branch=main&logo=github&style=flat-square)](https://github.com/PyO3/maturin/actions)
34
34
  [![FreeBSD](https://img.shields.io/cirrus/github/PyO3/maturin/main?logo=CircleCI&style=flat-square)](https://cirrus-ci.com/github/PyO3/maturin)
35
- [![Chat on Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg?logo=gitter&style=flat-square)](https://gitter.im/PyO3/Lobby)
35
+ [![discord server](https://img.shields.io/discord/1209263839632424990?logo=discord)](https://discord.gg/33kcChzH7f)
36
36
 
37
- Build and publish crates with pyo3, rust-cpython, cffi and uniffi bindings as well as rust binaries as python packages with minimal configuration.
37
+ Build and publish crates with pyo3, cffi and uniffi bindings as well as rust binaries as python packages with minimal configuration.
38
38
  It supports building wheels for python 3.8+ on windows, linux, mac and freebsd, can upload them to [pypi](https://pypi.org/) and has basic pypy and graalpy support.
39
39
 
40
40
  Check out the [User Guide](https://maturin.rs/)!
@@ -53,12 +53,12 @@ pipx install maturin
53
53
 
54
54
  There are four main commands:
55
55
 
56
- * `maturin new` creates a new cargo project with maturin configured.
57
- * `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 possible to upload those with [twine](https://github.com/pypa/twine) or `maturin upload`.
59
- * `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.
56
+ - `maturin new` creates a new cargo project with maturin configured.
57
+ - `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 possible to upload those with [twine](https://github.com/pypa/twine) or `maturin upload`.
59
+ - `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
60
 
61
- `pyo3` and `rust-cpython` bindings are automatically detected. For cffi or binaries, you need to pass `-b cffi` or `-b bin`.
61
+ `pyo3` bindings are automatically detected. For cffi or binaries, you need to pass `-b cffi` or `-b bin`.
62
62
  maturin doesn't need extra configuration files and doesn't clash with an existing setuptools-rust or milksnake configuration.
63
63
  You can even integrate it with testing tools such as [tox](https://tox.readthedocs.io/en/latest/).
64
64
  There are examples for the different bindings in the `test-crates` folder.
@@ -71,7 +71,7 @@ The name of the module, which you are using when importing, will be the `name` v
71
71
  Python packages come in two formats:
72
72
  A built form called wheel and source distributions (sdist), both of which are archives.
73
73
  A wheel can be compatible with any python version, interpreter (cpython and pypy, mainly), operating system and hardware architecture (for pure python wheels),
74
- can be limited to a specific platform and architecture (e.g. when using ctypes or cffi) or to a specific python interpreter and version on a specific architecture and operating system (e.g. with pyo3 and rust-cpython).
74
+ can be limited to a specific platform and architecture (e.g. when using ctypes or cffi) or to a specific python interpreter and version on a specific architecture and operating system (e.g. with pyo3).
75
75
 
76
76
  When using `pip install` on a package, pip tries to find a matching wheel and install that. If it doesn't find one, it downloads the source distribution and builds a wheel for the current platform,
77
77
  which requires the right compilers to be installed. Installing a wheel is much faster than installing a source distribution as building wheels is generally slow.
@@ -80,9 +80,9 @@ When you publish a package to be installable with `pip install`, you upload it t
80
80
  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/`.
81
81
  Note that for publishing for linux, [you need to use the manylinux docker container](#manylinux-and-auditwheel), while for publishing from your repository you can use the [PyO3/maturin-action github action](https://github.com/PyO3/maturin-action).
82
82
 
83
- ## pyo3 and rust-cpython
83
+ ## pyo3
84
84
 
85
- For pyo3 and rust-cpython, maturin can only build packages for installed python versions. On linux and mac, all python versions in `PATH` are used.
85
+ For pyo3, maturin can only build packages for installed python versions. On linux and mac, all python versions in `PATH` are used.
86
86
  If you don't set your own interpreters with `-i`, a heuristic is used to search for python installations.
87
87
  On windows all versions from the python launcher (which is installed by default by the python.org installer) and all conda environments except base are used. You can check which versions are picked up with the `list-python` subcommand.
88
88
 
@@ -171,7 +171,7 @@ my-project
171
171
 
172
172
  maturin will add the native extension as a module in your python folder. When using develop, maturin will copy the native library and for cffi also the glue code to your python folder. You should add those files to your gitignore.
173
173
 
174
- With cffi you can do `from .my_project import lib` and then use `lib.my_native_function`, with pyo3/rust-cpython you can directly `from .my_project import my_native_function`.
174
+ With cffi you can do `from .my_project import lib` and then use `lib.my_native_function`, with pyo3 you can directly `from .my_project import my_native_function`.
175
175
 
176
176
  Example layout with pyo3 after `maturin develop`:
177
177
 
@@ -198,7 +198,6 @@ fn my_lib_name(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
198
198
  }
199
199
  ```
200
200
 
201
-
202
201
  ## Python metadata
203
202
 
204
203
  maturin supports [PEP 621](https://www.python.org/dev/peps/pep-0621/), you can specify python package metadata in `pyproject.toml`.
@@ -279,7 +278,7 @@ The Rust compiler since version 1.64 [requires at least glibc 2.17](https://blog
279
278
  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`.
280
279
  The [PyO3/maturin-action](https://github.com/PyO3/maturin-action) github action already takes care of this if you set e.g. `manylinux: 2014`.
281
280
 
282
- maturin contains a reimplementation of auditwheel automatically checks the generated library and gives the wheel the proper.
281
+ maturin contains a reimplementation of auditwheel automatically checks the generated library and gives the wheel the proper platform tag.
283
282
  If your system's glibc is too new or you link other shared libraries, it will assign the `linux` tag.
284
283
  You can also manually disable those checks and directly use native linux target with `--manylinux off`.
285
284
 
@@ -297,23 +296,24 @@ maturin itself is manylinux compliant when compiled for the musl target.
297
296
 
298
297
  ## Examples
299
298
 
300
- * [ballista-python](https://github.com/apache/arrow-ballista-python) - A Python library that binds to Apache Arrow distributed query engine Ballista
301
- * [chardetng-py](https://github.com/john-parton/chardetng-py) - Python binding for the chardetng character encoding detector.
302
- * [connector-x](https://github.com/sfu-db/connector-x/tree/main/connectorx-python) - ConnectorX enables you to load data from databases into Python in the fastest and most memory efficient way
303
- * [datafusion-python](https://github.com/apache/arrow-datafusion-python) - a Python library that binds to Apache Arrow in-memory query engine DataFusion
304
- * [deltalake-python](https://github.com/delta-io/delta-rs/tree/main/python) - Native Delta Lake Python binding based on delta-rs with Pandas integration
305
- * [opendal](https://github.com/apache/incubator-opendal/tree/main/bindings/python) - OpenDAL Python Binding to access data freely
306
- * [orjson](https://github.com/ijl/orjson) - A fast, correct JSON library for Python
307
- * [polars](https://github.com/pola-rs/polars/tree/master/py-polars) - Fast multi-threaded DataFrame library in Rust | Python | Node.js
308
- * [pydantic-core](https://github.com/pydantic/pydantic-core) - Core validation logic for pydantic written in Rust
309
- * [pyrus-cramjam](https://github.com/milesgranger/pyrus-cramjam) - Thin Python wrapper to de/compression algorithms in Rust
310
- * [pyxel](https://github.com/kitao/pyxel) - A retro game engine for Python
311
- * [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
312
- * [robyn](https://github.com/sansyrox/robyn) - A fast and extensible async python web server with a Rust runtime
313
- * [ruff](https://github.com/charliermarsh/ruff) - An extremely fast Python linter, written in Rust
314
- * [tantivy-py](https://github.com/quickwit-oss/tantivy-py) - Python bindings for Tantivy
315
- * [watchfiles](https://github.com/samuelcolvin/watchfiles) - Simple, modern and high performance file watching and code reload in python
316
- * [wonnx](https://github.com/webonnx/wonnx/tree/master/wonnx-py) - Wonnx is a GPU-accelerated ONNX inference run-time written 100% in Rust
299
+ - [ballista-python](https://github.com/apache/arrow-ballista-python) - A Python library that binds to Apache Arrow distributed query engine Ballista
300
+ - [bleuscore](https://github.com/shenxiangzhuang/bleuscore) - A BLEU score calculation library, written in pure Rust
301
+ - [chardetng-py](https://github.com/john-parton/chardetng-py) - Python binding for the chardetng character encoding detector.
302
+ - [connector-x](https://github.com/sfu-db/connector-x/tree/main/connectorx-python) - ConnectorX enables you to load data from databases into Python in the fastest and most memory efficient way
303
+ - [datafusion-python](https://github.com/apache/arrow-datafusion-python) - a Python library that binds to Apache Arrow in-memory query engine DataFusion
304
+ - [deltalake-python](https://github.com/delta-io/delta-rs/tree/main/python) - Native Delta Lake Python binding based on delta-rs with Pandas integration
305
+ - [opendal](https://github.com/apache/incubator-opendal/tree/main/bindings/python) - OpenDAL Python Binding to access data freely
306
+ - [orjson](https://github.com/ijl/orjson) - A fast, correct JSON library for Python
307
+ - [polars](https://github.com/pola-rs/polars/tree/master/py-polars) - Fast multi-threaded DataFrame library in Rust | Python | Node.js
308
+ - [pydantic-core](https://github.com/pydantic/pydantic-core) - Core validation logic for pydantic written in Rust
309
+ - [pyrus-cramjam](https://github.com/milesgranger/pyrus-cramjam) - Thin Python wrapper to de/compression algorithms in Rust
310
+ - [pyxel](https://github.com/kitao/pyxel) - A retro game engine for Python
311
+ - [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
312
+ - [robyn](https://github.com/sansyrox/robyn) - A fast and extensible async python web server with a Rust runtime
313
+ - [ruff](https://github.com/charliermarsh/ruff) - An extremely fast Python linter, written in Rust
314
+ - [tantivy-py](https://github.com/quickwit-oss/tantivy-py) - Python bindings for Tantivy
315
+ - [watchfiles](https://github.com/samuelcolvin/watchfiles) - Simple, modern and high performance file watching and code reload in python
316
+ - [wonnx](https://github.com/webonnx/wonnx/tree/master/wonnx-py) - Wonnx is a GPU-accelerated ONNX inference run-time written 100% in Rust
317
317
 
318
318
  ## Contributing
319
319
 
@@ -334,8 +334,8 @@ If you don't have time to contribute yourself but still wish to support the proj
334
334
 
335
335
  Licensed under either of:
336
336
 
337
- * Apache License, Version 2.0, ([LICENSE-APACHE](https://github.com/PyO3/maturin/blob/main/license-apache) or http://www.apache.org/licenses/LICENSE-2.0)
338
- * MIT license ([LICENSE-MIT](https://github.com/PyO3/maturin/blob/main/license-mit) or http://opensource.org/licenses/MIT)
337
+ - Apache License, Version 2.0, ([LICENSE-APACHE](https://github.com/PyO3/maturin/blob/main/license-apache) or http://www.apache.org/licenses/LICENSE-2.0)
338
+ - MIT license ([LICENSE-MIT](https://github.com/PyO3/maturin/blob/main/license-mit) or http://opensource.org/licenses/MIT)
339
339
 
340
340
  at your option.
341
341
 
@@ -0,0 +1,7 @@
1
+ maturin-1.6.0.dist-info/METADATA,sha256=sy4pV7KReDev5yNspLm4zxUhcPev_xdTx-rnH3-NBK8,18556
2
+ maturin-1.6.0.dist-info/WHEEL,sha256=brQLXivWHsAIY2DMrPTUlWsjdxS-4rnBjABBUz3bpIE,93
3
+ maturin/import_hook.py,sha256=fZHAZ7k75YZiWGY0lsxyDKYrGgfJ5jsxODNZTEVnMxE,6023
4
+ maturin/__init__.py,sha256=DVNu9_o_BoCOiJaJQFHbmbAEd6GLkeHpfZS7yQDrK7k,7249
5
+ maturin/__main__.py,sha256=UxDvFV1Hhu0gW_Jvb6Kzdc78gg7zjUUiZBhWrpLi5YU,1195
6
+ maturin-1.6.0.data/scripts/maturin.exe,sha256=Q48ZaP1W5TjNDWzN7Ea7BdzWaKYNAetrIuKolzzxV8Y,20446208
7
+ maturin-1.6.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: maturin (1.5.0)
2
+ Generator: maturin (1.6.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: py3-none-win_amd64
@@ -1,7 +0,0 @@
1
- maturin-1.5.0.dist-info/METADATA,sha256=4e7FuMq69VsiZpVprGSdL7CrWsE9UNkC92j2Ok5TV6w,18543
2
- maturin-1.5.0.dist-info/WHEEL,sha256=jZfbH5RrJxZIjwsw3ZZ_fbyahquRFiOMpGu1ZZltpjU,93
3
- maturin/import_hook.py,sha256=TsZzWauEAC-xPOnuvy3kn25GM2EGqmcuvzdzS-aAHTE,5771
4
- maturin/__init__.py,sha256=nues8BiqPJG1hBgdPTNKd8mlxJhV1H069Ez1G-C-MVU,6720
5
- maturin/__main__.py,sha256=pXjh1oJe1m1JmVwsRwvS22kS3qiGkcLD6r7jbNXTFKA,1031
6
- maturin-1.5.0.data/scripts/maturin.exe,sha256=sM9sEduMDiuzosQW82paVYnzG6sc3UK-zR6dzcRnnOs,20424704
7
- maturin-1.5.0.dist-info/RECORD,,