maturin 1.3.0__py3-none-linux_armv6l.whl → 1.3.2__py3-none-linux_armv6l.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 +8 -28
- maturin/import_hook.py +5 -16
- {maturin-1.3.0.data → maturin-1.3.2.data}/scripts/maturin +0 -0
- {maturin-1.3.0.dist-info → maturin-1.3.2.dist-info}/METADATA +1 -1
- maturin-1.3.2.dist-info/RECORD +7 -0
- {maturin-1.3.0.dist-info → maturin-1.3.2.dist-info}/WHEEL +1 -1
- maturin-1.3.0.dist-info/RECORD +0 -7
maturin/__init__.py
CHANGED
|
@@ -32,16 +32,10 @@ def get_config() -> Dict[str, str]:
|
|
|
32
32
|
return pyproject_toml.get("tool", {}).get("maturin", {})
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
def get_maturin_pep517_args(
|
|
36
|
-
config_settings: Optional[Mapping[str, Any]] = None
|
|
37
|
-
) -> List[str]:
|
|
35
|
+
def get_maturin_pep517_args(config_settings: Optional[Mapping[str, Any]] = None) -> List[str]:
|
|
38
36
|
build_args = config_settings.get("build-args") if config_settings else None
|
|
39
37
|
if build_args is None:
|
|
40
38
|
env_args = os.getenv("MATURIN_PEP517_ARGS", "")
|
|
41
|
-
if env_args:
|
|
42
|
-
print(
|
|
43
|
-
f"'MATURIN_PEP517_ARGS' is deprecated, use `--config-settings build-args='{env_args}'` instead."
|
|
44
|
-
)
|
|
45
39
|
args = shlex.split(env_args)
|
|
46
40
|
elif isinstance(build_args, str):
|
|
47
41
|
args = shlex.split(build_args)
|
|
@@ -91,9 +85,7 @@ def _build_wheel(
|
|
|
91
85
|
sys.stdout.buffer.write(result.stdout)
|
|
92
86
|
sys.stdout.flush()
|
|
93
87
|
if result.returncode != 0:
|
|
94
|
-
sys.stderr.write(
|
|
95
|
-
f"Error: command {command} returned non-zero exit status {result.returncode}\n"
|
|
96
|
-
)
|
|
88
|
+
sys.stderr.write(f"Error: command {command} returned non-zero exit status {result.returncode}\n")
|
|
97
89
|
sys.exit(1)
|
|
98
90
|
output = result.stdout.decode(errors="replace")
|
|
99
91
|
wheel_path = output.strip().splitlines()[-1]
|
|
@@ -112,9 +104,7 @@ def build_wheel(
|
|
|
112
104
|
|
|
113
105
|
|
|
114
106
|
# noinspection PyUnusedLocal
|
|
115
|
-
def build_sdist(
|
|
116
|
-
sdist_directory: str, config_settings: Optional[Mapping[str, Any]] = None
|
|
117
|
-
) -> str:
|
|
107
|
+
def build_sdist(sdist_directory: str, config_settings: Optional[Mapping[str, Any]] = None) -> str:
|
|
118
108
|
command = ["maturin", "pep517", "write-sdist", "--sdist-directory", sdist_directory]
|
|
119
109
|
|
|
120
110
|
print("Running `{}`".format(" ".join(command)))
|
|
@@ -123,18 +113,14 @@ def build_sdist(
|
|
|
123
113
|
sys.stdout.buffer.write(result.stdout)
|
|
124
114
|
sys.stdout.flush()
|
|
125
115
|
if result.returncode != 0:
|
|
126
|
-
sys.stderr.write(
|
|
127
|
-
f"Error: command {command} returned non-zero exit status {result.returncode}\n"
|
|
128
|
-
)
|
|
116
|
+
sys.stderr.write(f"Error: command {command} returned non-zero exit status {result.returncode}\n")
|
|
129
117
|
sys.exit(1)
|
|
130
118
|
output = result.stdout.decode(errors="replace")
|
|
131
119
|
return output.strip().splitlines()[-1]
|
|
132
120
|
|
|
133
121
|
|
|
134
122
|
# noinspection PyUnusedLocal
|
|
135
|
-
def get_requires_for_build_wheel(
|
|
136
|
-
config_settings: Optional[Mapping[str, Any]] = None
|
|
137
|
-
) -> List[str]:
|
|
123
|
+
def get_requires_for_build_wheel(config_settings: Optional[Mapping[str, Any]] = None) -> List[str]:
|
|
138
124
|
if get_config().get("bindings") == "cffi":
|
|
139
125
|
return ["cffi"]
|
|
140
126
|
else:
|
|
@@ -147,9 +133,7 @@ def build_editable(
|
|
|
147
133
|
config_settings: Optional[Mapping[str, Any]] = None,
|
|
148
134
|
metadata_directory: Optional[str] = None,
|
|
149
135
|
) -> str:
|
|
150
|
-
return _build_wheel(
|
|
151
|
-
wheel_directory, config_settings, metadata_directory, editable=True
|
|
152
|
-
)
|
|
136
|
+
return _build_wheel(wheel_directory, config_settings, metadata_directory, editable=True)
|
|
153
137
|
|
|
154
138
|
|
|
155
139
|
# Requirements to build an editable are the same as for a wheel
|
|
@@ -157,9 +141,7 @@ get_requires_for_build_editable = get_requires_for_build_wheel
|
|
|
157
141
|
|
|
158
142
|
|
|
159
143
|
# noinspection PyUnusedLocal
|
|
160
|
-
def get_requires_for_build_sdist(
|
|
161
|
-
config_settings: Optional[Mapping[str, Any]] = None
|
|
162
|
-
) -> List[str]:
|
|
144
|
+
def get_requires_for_build_sdist(config_settings: Optional[Mapping[str, Any]] = None) -> List[str]:
|
|
163
145
|
return []
|
|
164
146
|
|
|
165
147
|
|
|
@@ -170,9 +152,7 @@ def prepare_metadata_for_build_wheel(
|
|
|
170
152
|
print("Checking for Rust toolchain....")
|
|
171
153
|
is_cargo_installed = False
|
|
172
154
|
try:
|
|
173
|
-
output = subprocess.check_output(["cargo", "--version"]).decode(
|
|
174
|
-
"utf-8", "ignore"
|
|
175
|
-
)
|
|
155
|
+
output = subprocess.check_output(["cargo", "--version"]).decode("utf-8", "ignore")
|
|
176
156
|
if "cargo" in output:
|
|
177
157
|
is_cargo_installed = True
|
|
178
158
|
except (FileNotFoundError, SubprocessError):
|
maturin/import_hook.py
CHANGED
|
@@ -71,9 +71,7 @@ class Importer(abc.MetaPathFinder):
|
|
|
71
71
|
|
|
72
72
|
return None
|
|
73
73
|
|
|
74
|
-
def _build_and_load(
|
|
75
|
-
self, fullname: str, cargo_toml: pathlib.Path
|
|
76
|
-
) -> ModuleSpec | None:
|
|
74
|
+
def _build_and_load(self, fullname: str, cargo_toml: pathlib.Path) -> ModuleSpec | None:
|
|
77
75
|
build_module(cargo_toml, bindings=self.bindings)
|
|
78
76
|
loader = Loader(fullname)
|
|
79
77
|
return importlib.util.spec_from_loader(fullname, loader)
|
|
@@ -98,10 +96,7 @@ def _is_cargo_project(cargo_toml: pathlib.Path, module_name: str) -> bool:
|
|
|
98
96
|
with open(cargo_toml, "rb") as f:
|
|
99
97
|
cargo = tomllib.load(f)
|
|
100
98
|
package_name = cargo.get("package", {}).get("name")
|
|
101
|
-
if (
|
|
102
|
-
package_name == module_name
|
|
103
|
-
or package_name.replace("-", "_") == module_name
|
|
104
|
-
):
|
|
99
|
+
if package_name == module_name or package_name.replace("-", "_") == module_name:
|
|
105
100
|
return True
|
|
106
101
|
return False
|
|
107
102
|
|
|
@@ -115,9 +110,7 @@ def generate_project(rust_file: pathlib.Path, bindings: str = "pyo3") -> pathlib
|
|
|
115
110
|
command: list[str] = ["maturin", "new", "-b", bindings, str(project_dir)]
|
|
116
111
|
result = subprocess.run(command, stdout=subprocess.PIPE)
|
|
117
112
|
if result.returncode != 0:
|
|
118
|
-
sys.stderr.write(
|
|
119
|
-
f"Error: command {command} returned non-zero exit status {result.returncode}\n"
|
|
120
|
-
)
|
|
113
|
+
sys.stderr.write(f"Error: command {command} returned non-zero exit status {result.returncode}\n")
|
|
121
114
|
raise ImportError("Failed to generate cargo project")
|
|
122
115
|
|
|
123
116
|
with open(rust_file) as f:
|
|
@@ -128,9 +121,7 @@ def generate_project(rust_file: pathlib.Path, bindings: str = "pyo3") -> pathlib
|
|
|
128
121
|
return project_dir
|
|
129
122
|
|
|
130
123
|
|
|
131
|
-
def build_module(
|
|
132
|
-
manifest_path: pathlib.Path, bindings: str | None = None, release: bool = False
|
|
133
|
-
) -> None:
|
|
124
|
+
def build_module(manifest_path: pathlib.Path, bindings: str | None = None, release: bool = False) -> None:
|
|
134
125
|
command = ["maturin", "develop", "-m", str(manifest_path)]
|
|
135
126
|
if bindings:
|
|
136
127
|
command.append("-b")
|
|
@@ -141,9 +132,7 @@ def build_module(
|
|
|
141
132
|
sys.stdout.buffer.write(result.stdout)
|
|
142
133
|
sys.stdout.flush()
|
|
143
134
|
if result.returncode != 0:
|
|
144
|
-
sys.stderr.write(
|
|
145
|
-
f"Error: command {command} returned non-zero exit status {result.returncode}\n"
|
|
146
|
-
)
|
|
135
|
+
sys.stderr.write(f"Error: command {command} returned non-zero exit status {result.returncode}\n")
|
|
147
136
|
raise ImportError("Failed to build module with maturin")
|
|
148
137
|
|
|
149
138
|
|
|
Binary file
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
maturin-1.3.2.dist-info/METADATA,sha256=dSyIXuw5E4ENuFbUAkfbyaczPYVl2XeB1r78ME6FZ18,18256
|
|
2
|
+
maturin-1.3.2.dist-info/WHEEL,sha256=CnfX-GCMSyG9EerpP4-iAjMF4o_PU9rOs4sqH1RIMdM,96
|
|
3
|
+
maturin/import_hook.py,sha256=4Uwi4mBhMh3OlrWYpz2bwRU1mBG7HP2YObpo3vPcNYI,5602
|
|
4
|
+
maturin/__init__.py,sha256=aIJTh4e2q5Ixr3r7rZRKx6wz0iuPcGutvCqPaBCYVUA,6522
|
|
5
|
+
maturin/__main__.py,sha256=4CyZAGqzmFsCl0FMlxAcG4vHFepE2lRZiPu4MKXyY4Y,987
|
|
6
|
+
maturin-1.3.2.data/scripts/maturin,sha256=s0rqM_Plb8yzFO96p5UAjm0ZHZkbmV5R-uyzEfD5h7Q,27761360
|
|
7
|
+
maturin-1.3.2.dist-info/RECORD,,
|
maturin-1.3.0.dist-info/RECORD
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
maturin-1.3.0.dist-info/METADATA,sha256=OGjAEsKlj_W2eYotEMM-f6p5sp1wG7qLv7tz0z00zaA,18256
|
|
2
|
-
maturin-1.3.0.dist-info/WHEEL,sha256=27qWxfRNIYKGuqiTmR4CVfzw1_YC-AZKadv1iE_dj34,96
|
|
3
|
-
maturin/__init__.py,sha256=QL3acPHs2FW14092hdtGXVPPWfqHpnKE0ZwAbtpfQP0,6793
|
|
4
|
-
maturin/import_hook.py,sha256=hQ4DpJrpKqYWgiElpirnGwYUxdzE0c_Vq8jKnqasbeU,5714
|
|
5
|
-
maturin/__main__.py,sha256=4CyZAGqzmFsCl0FMlxAcG4vHFepE2lRZiPu4MKXyY4Y,987
|
|
6
|
-
maturin-1.3.0.data/scripts/maturin,sha256=QOpc3vAlVn2FXKfDBGH74ltLVQMKUkGKPyLPzBzi86g,26439624
|
|
7
|
-
maturin-1.3.0.dist-info/RECORD,,
|