maturin 1.8.4__tar.gz → 1.8.6__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.

Potentially problematic release.


This version of maturin might be problematic. Click here for more details.

Files changed (61) hide show
  1. {maturin-1.8.4 → maturin-1.8.6}/.pre-commit-config.yaml +1 -1
  2. {maturin-1.8.4 → maturin-1.8.6}/Cargo.lock +1 -1
  3. {maturin-1.8.4 → maturin-1.8.6}/Cargo.toml +1 -1
  4. {maturin-1.8.4 → maturin-1.8.6}/Changelog.md +12 -1
  5. {maturin-1.8.4 → maturin-1.8.6}/PKG-INFO +1 -1
  6. {maturin-1.8.4 → maturin-1.8.6}/pyproject.toml +8 -10
  7. {maturin-1.8.4 → maturin-1.8.6}/src/bridge.rs +12 -2
  8. {maturin-1.8.4 → maturin-1.8.6}/src/build_context.rs +40 -2
  9. {maturin-1.8.4 → maturin-1.8.6}/src/build_options.rs +12 -14
  10. {maturin-1.8.4 → maturin-1.8.6}/src/ci.rs +3 -3
  11. {maturin-1.8.4 → maturin-1.8.6}/src/lib.rs +1 -1
  12. {maturin-1.8.4 → maturin-1.8.6}/src/main.rs +12 -3
  13. {maturin-1.8.4 → maturin-1.8.6}/.cirrus.yml +0 -0
  14. {maturin-1.8.4 → maturin-1.8.6}/.codespellrc +0 -0
  15. {maturin-1.8.4 → maturin-1.8.6}/.config/nextest.toml +0 -0
  16. {maturin-1.8.4 → maturin-1.8.6}/.gitignore +0 -0
  17. {maturin-1.8.4 → maturin-1.8.6}/MANIFEST.in +0 -0
  18. {maturin-1.8.4 → maturin-1.8.6}/README.md +0 -0
  19. {maturin-1.8.4 → maturin-1.8.6}/clippy.toml +0 -0
  20. {maturin-1.8.4 → maturin-1.8.6}/license-apache +0 -0
  21. {maturin-1.8.4 → maturin-1.8.6}/license-mit +0 -0
  22. {maturin-1.8.4 → maturin-1.8.6}/maturin/__init__.py +0 -0
  23. {maturin-1.8.4 → maturin-1.8.6}/maturin/__main__.py +0 -0
  24. {maturin-1.8.4 → maturin-1.8.6}/maturin/bootstrap.py +0 -0
  25. {maturin-1.8.4 → maturin-1.8.6}/maturin.schema.json +0 -0
  26. {maturin-1.8.4 → maturin-1.8.6}/netlify.toml +0 -0
  27. {maturin-1.8.4 → maturin-1.8.6}/setup.py +0 -0
  28. {maturin-1.8.4 → maturin-1.8.6}/src/auditwheel/audit.rs +0 -0
  29. {maturin-1.8.4 → maturin-1.8.6}/src/auditwheel/manylinux-policy.json +0 -0
  30. {maturin-1.8.4 → maturin-1.8.6}/src/auditwheel/mod.rs +0 -0
  31. {maturin-1.8.4 → maturin-1.8.6}/src/auditwheel/musllinux-policy.json +0 -0
  32. {maturin-1.8.4 → maturin-1.8.6}/src/auditwheel/musllinux.rs +0 -0
  33. {maturin-1.8.4 → maturin-1.8.6}/src/auditwheel/patchelf.rs +0 -0
  34. {maturin-1.8.4 → maturin-1.8.6}/src/auditwheel/platform_tag.rs +0 -0
  35. {maturin-1.8.4 → maturin-1.8.6}/src/auditwheel/policy.rs +0 -0
  36. {maturin-1.8.4 → maturin-1.8.6}/src/auditwheel/repair.rs +0 -0
  37. {maturin-1.8.4 → maturin-1.8.6}/src/cargo_toml.rs +0 -0
  38. {maturin-1.8.4 → maturin-1.8.6}/src/compile.rs +0 -0
  39. {maturin-1.8.4 → maturin-1.8.6}/src/cross_compile.rs +0 -0
  40. {maturin-1.8.4 → maturin-1.8.6}/src/develop.rs +0 -0
  41. {maturin-1.8.4 → maturin-1.8.6}/src/generate_json_schema.rs +0 -0
  42. {maturin-1.8.4 → maturin-1.8.6}/src/metadata.rs +0 -0
  43. {maturin-1.8.4 → maturin-1.8.6}/src/module_writer.rs +0 -0
  44. {maturin-1.8.4 → maturin-1.8.6}/src/new_project.rs +0 -0
  45. {maturin-1.8.4 → maturin-1.8.6}/src/project_layout.rs +0 -0
  46. {maturin-1.8.4 → maturin-1.8.6}/src/pyproject_toml.rs +0 -0
  47. {maturin-1.8.4 → maturin-1.8.6}/src/python_interpreter/config.rs +0 -0
  48. {maturin-1.8.4 → maturin-1.8.6}/src/python_interpreter/get_interpreter_metadata.py +0 -0
  49. {maturin-1.8.4 → maturin-1.8.6}/src/python_interpreter/mod.rs +0 -0
  50. {maturin-1.8.4 → maturin-1.8.6}/src/source_distribution.rs +0 -0
  51. {maturin-1.8.4 → maturin-1.8.6}/src/target.rs +0 -0
  52. {maturin-1.8.4 → maturin-1.8.6}/src/templates/.gitignore.j2 +0 -0
  53. {maturin-1.8.4 → maturin-1.8.6}/src/templates/Cargo.toml.j2 +0 -0
  54. {maturin-1.8.4 → maturin-1.8.6}/src/templates/__init__.py.j2 +0 -0
  55. {maturin-1.8.4 → maturin-1.8.6}/src/templates/build.rs.j2 +0 -0
  56. {maturin-1.8.4 → maturin-1.8.6}/src/templates/example.udl.j2 +0 -0
  57. {maturin-1.8.4 → maturin-1.8.6}/src/templates/lib.rs.j2 +0 -0
  58. {maturin-1.8.4 → maturin-1.8.6}/src/templates/main.rs.j2 +0 -0
  59. {maturin-1.8.4 → maturin-1.8.6}/src/templates/pyproject.toml.j2 +0 -0
  60. {maturin-1.8.4 → maturin-1.8.6}/src/templates/test_all.py.j2 +0 -0
  61. {maturin-1.8.4 → maturin-1.8.6}/src/upload.rs +0 -0
@@ -56,7 +56,7 @@ repos:
56
56
  )
57
57
  - id: mixed-line-ending
58
58
  - repo: https://github.com/astral-sh/ruff-pre-commit
59
- rev: v0.11.8
59
+ rev: v0.11.9
60
60
  hooks:
61
61
  - id: ruff-format
62
62
  - id: ruff
@@ -1397,7 +1397,7 @@ dependencies = [
1397
1397
 
1398
1398
  [[package]]
1399
1399
  name = "maturin"
1400
- version = "1.8.4"
1400
+ version = "1.8.6"
1401
1401
  dependencies = [
1402
1402
  "anyhow",
1403
1403
  "base64 0.21.7",
@@ -1,7 +1,7 @@
1
1
  [package]
2
2
  authors = ["konstin <konstin@mailbox.org>", "messense <messense@icloud.com>"]
3
3
  name = "maturin"
4
- version = "1.8.4"
4
+ version = "1.8.6"
5
5
  description = "Build and publish crates with pyo3, cffi and uniffi bindings as well as rust binaries as python packages"
6
6
  exclude = [
7
7
  "test-crates/**/*",
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.8.6]
4
+
5
+ * Print a message when overriding platform tag from `_PYTHON_HOST_PLATFORM` in [#2594](https://github.com/PyO3/maturin/pull/2594)
6
+ * Use the current python interpreter's version when the abi3 feature is set with no explicit version in [#2597](https://github.com/PyO3/maturin/pull/2597)
7
+
8
+ ## [1.8.5]
9
+
10
+ * Fix release CI build
11
+
3
12
  ## [1.8.4]
4
13
 
5
14
  * Install a Rust toolchain into a temporary directory when building maturin itself or a package and a Rust toolchain is
@@ -1060,7 +1069,9 @@ points-0.1.0-py2.py3-none-manylinux1_x86_64.whl | 2,8M | 752K | 85K
1060
1069
 
1061
1070
  * Initial Release
1062
1071
 
1063
- [Unreleased]: https://github.com/pyo3/maturin/compare/v1.8.4...HEAD
1072
+ [Unreleased]: https://github.com/pyo3/maturin/compare/v1.8.6...HEAD
1073
+ [1.8.6]: https://github.com/pyo3/maturin/compare/v1.8.5...v1.8.6
1074
+ [1.8.5]: https://github.com/pyo3/maturin/compare/v1.8.4...v1.8.5
1064
1075
  [1.8.4]: https://github.com/pyo3/maturin/compare/v1.8.3...v1.8.4
1065
1076
  [1.8.3]: https://github.com/pyo3/maturin/compare/v1.8.2...v1.8.3
1066
1077
  [1.8.2]: https://github.com/pyo3/maturin/compare/v1.8.1...v1.8.2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maturin
3
- Version: 1.8.4
3
+ Version: 1.8.6
4
4
  Classifier: Topic :: Software Development :: Build Tools
5
5
  Classifier: Programming Language :: Rust
6
6
  Classifier: Programming Language :: Python :: Implementation :: CPython
@@ -1,6 +1,10 @@
1
1
  # Workaround to bootstrap maturin on non-manylinux platforms
2
2
  [build-system]
3
- requires = ["setuptools", "tomli>=1.1.0 ; python_version<'3.11'", "setuptools-rust"]
3
+ requires = [
4
+ "setuptools",
5
+ "tomli>=1.1.0 ; python_version<'3.11'",
6
+ "setuptools-rust>=1.11.0",
7
+ ]
4
8
  backend-path = ["maturin"]
5
9
  build-backend = "bootstrap"
6
10
 
@@ -18,17 +22,11 @@ classifiers = [
18
22
  "Programming Language :: Python :: Implementation :: PyPy",
19
23
  ]
20
24
  dependencies = ["tomli>=1.1.0 ; python_version<'3.11'"]
21
- dynamic = [
22
- "version"
23
- ]
25
+ dynamic = ["version"]
24
26
 
25
27
  [project.optional-dependencies]
26
- zig = [
27
- "ziglang>=0.10.0,<0.13.0",
28
- ]
29
- patchelf = [
30
- "patchelf",
31
- ]
28
+ zig = ["ziglang>=0.10.0,<0.13.0"]
29
+ patchelf = ["patchelf"]
32
30
 
33
31
  [project.urls]
34
32
  "Source Code" = "https://github.com/PyO3/maturin"
@@ -110,6 +110,16 @@ impl TryFrom<PyO3MetadataRaw> for PyO3Metadata {
110
110
  }
111
111
  }
112
112
 
113
+ /// Python version to use as the abi3 target.
114
+ #[derive(Clone, Debug, PartialEq, Eq)]
115
+ pub enum Abi3Version {
116
+ /// abi3 wheels will have a minimum Python version matching the version of
117
+ /// the current Python interpreter
118
+ CurrentPython,
119
+ /// abi3 wheels will have a fixed minimum Python version
120
+ Version(u8, u8),
121
+ }
122
+
113
123
  /// The name and version of the pyo3 bindings crate
114
124
  #[derive(Clone, Debug, PartialEq, Eq)]
115
125
  pub struct PyO3 {
@@ -118,7 +128,7 @@ pub struct PyO3 {
118
128
  /// pyo3 bindings crate version
119
129
  pub version: semver::Version,
120
130
  /// abi3 support
121
- pub abi3: Option<(u8, u8)>,
131
+ pub abi3: Option<Abi3Version>,
122
132
  /// pyo3 metadata
123
133
  pub metadata: Option<PyO3Metadata>,
124
134
  }
@@ -136,7 +146,7 @@ impl PyO3 {
136
146
  } else {
137
147
  MINIMUM_PYTHON_MINOR
138
148
  };
139
- if let Some((_, abi3_minor)) = self.abi3.as_ref() {
149
+ if let Some(Abi3Version::Version(_, abi3_minor)) = self.abi3.as_ref() {
140
150
  min_minor.max(*abi3_minor as usize)
141
151
  } else {
142
152
  min_minor
@@ -1,5 +1,6 @@
1
1
  use crate::auditwheel::{get_policy_and_libs, patchelf, relpath, AuditWheelMode};
2
2
  use crate::auditwheel::{PlatformTag, Policy};
3
+ use crate::bridge::Abi3Version;
3
4
  use crate::build_options::CargoOptions;
4
5
  use crate::compile::{warn_missing_py_init, CompileTarget};
5
6
  use crate::module_writer::{
@@ -155,7 +156,7 @@ impl BuildContext {
155
156
  BridgeModel::Bin(None) => self.build_bin_wheel(None)?,
156
157
  BridgeModel::Bin(Some(..)) => self.build_bin_wheels(&self.interpreter)?,
157
158
  BridgeModel::PyO3(crate::PyO3 { abi3, .. }) => match abi3 {
158
- Some((major, minor)) => {
159
+ Some(Abi3Version::Version(major, minor)) => {
159
160
  let abi3_interps: Vec<_> = self
160
161
  .interpreter
161
162
  .iter()
@@ -189,6 +190,41 @@ impl BuildContext {
189
190
  }
190
191
  built_wheels
191
192
  }
193
+ Some(Abi3Version::CurrentPython) => {
194
+ let abi3_interps: Vec<_> = self
195
+ .interpreter
196
+ .iter()
197
+ .filter(|interp| interp.has_stable_api())
198
+ .cloned()
199
+ .collect();
200
+ let non_abi3_interps: Vec<_> = self
201
+ .interpreter
202
+ .iter()
203
+ .filter(|interp| !interp.has_stable_api())
204
+ .cloned()
205
+ .collect();
206
+ let mut built_wheels = Vec::new();
207
+ if !abi3_interps.is_empty() {
208
+ let interp = abi3_interps.first().unwrap();
209
+ built_wheels.extend(self.build_pyo3_wheel_abi3(
210
+ &abi3_interps,
211
+ interp.major as u8,
212
+ interp.minor as u8,
213
+ )?);
214
+ }
215
+ if !non_abi3_interps.is_empty() {
216
+ let interp_names: HashSet<_> = non_abi3_interps
217
+ .iter()
218
+ .map(|interp| interp.to_string())
219
+ .collect();
220
+ eprintln!(
221
+ "⚠️ Warning: {} does not yet support abi3 so the build artifacts will be version-specific.",
222
+ interp_names.iter().join(", ")
223
+ );
224
+ built_wheels.extend(self.build_pyo3_wheels(&non_abi3_interps)?);
225
+ }
226
+ built_wheels
227
+ }
192
228
  None => self.build_pyo3_wheels(&self.interpreter)?,
193
229
  },
194
230
  BridgeModel::Cffi => self.build_cffi_wheel()?,
@@ -485,7 +521,9 @@ impl BuildContext {
485
521
  /// Returns the platform part of the tag for the wheel name
486
522
  pub fn get_platform_tag(&self, platform_tags: &[PlatformTag]) -> Result<String> {
487
523
  if let Ok(host_platform) = env::var("_PYTHON_HOST_PLATFORM") {
488
- return Ok(host_platform.replace(['.', '-'], "_"));
524
+ let override_platform = host_platform.replace(['.', '-'], "_");
525
+ eprintln!("🚉 Overriding platform tag from _PYTHON_HOST_PLATFORM environment variable as {override_platform}.");
526
+ return Ok(override_platform);
489
527
  }
490
528
 
491
529
  let target = &self.target;
@@ -1,5 +1,5 @@
1
1
  use crate::auditwheel::{AuditWheelMode, PlatformTag};
2
- use crate::bridge::PyO3Crate;
2
+ use crate::bridge::{Abi3Version, PyO3Crate};
3
3
  use crate::compile::{CompileTarget, LIB_CRATE_TYPES};
4
4
  use crate::cross_compile::{find_sysconfigdata, parse_sysconfigdata};
5
5
  use crate::project_layout::ProjectResolver;
@@ -250,7 +250,7 @@ impl BuildOptions {
250
250
  match bridge {
251
251
  BridgeModel::PyO3(PyO3 { abi3, .. }) | BridgeModel::Bin(Some(PyO3 { abi3, .. })) => {
252
252
  match abi3 {
253
- None => {
253
+ None | Some(Abi3Version::CurrentPython) => {
254
254
  let mut interpreters = Vec::new();
255
255
  if let Some(config_file) = env::var_os("PYO3_CONFIG_FILE") {
256
256
  let interpreter_config =
@@ -385,7 +385,7 @@ impl BuildOptions {
385
385
 
386
386
  Ok(interpreters)
387
387
  }
388
- Some((major, minor)) => {
388
+ Some(Abi3Version::Version(major, minor)) => {
389
389
  let found_interpreters =
390
390
  find_interpreter_in_host(bridge, interpreter, target, requires_python)
391
391
  .or_else(|err| {
@@ -990,7 +990,7 @@ fn filter_cargo_targets(
990
990
  }
991
991
 
992
992
  /// pyo3 supports building abi3 wheels if the unstable-api feature is not selected
993
- fn has_abi3(deps: &HashMap<&str, &Node>) -> Result<Option<(u8, u8)>> {
993
+ fn has_abi3(deps: &HashMap<&str, &Node>) -> Result<Option<Abi3Version>> {
994
994
  for &lib in PYO3_BINDING_CRATES.iter() {
995
995
  let lib = lib.as_str();
996
996
  if let Some(pyo3_crate) = deps.get(lib) {
@@ -1012,13 +1012,11 @@ fn has_abi3(deps: &HashMap<&str, &Node>) -> Result<Option<(u8, u8)>> {
1012
1012
  .context(format!("Bogus {lib} cargo features"))?
1013
1013
  .into_iter()
1014
1014
  .min();
1015
- if abi3_selected && min_abi3_version.is_none() {
1016
- bail!(
1017
- "You have selected the `abi3` feature but not a minimum version (e.g. the `abi3-py36` feature). \
1018
- maturin needs a minimum version feature to build abi3 wheels."
1019
- )
1015
+ match min_abi3_version {
1016
+ Some((major, minor)) => return Ok(Some(Abi3Version::Version(major, minor))),
1017
+ None if abi3_selected => return Ok(Some(Abi3Version::CurrentPython)),
1018
+ None => {}
1020
1019
  }
1021
- return Ok(min_abi3_version);
1022
1020
  }
1023
1021
  }
1024
1022
  Ok(None)
@@ -1212,13 +1210,13 @@ pub fn find_bridge(cargo_metadata: &Metadata, bridge: Option<&str>) -> Result<Br
1212
1210
  );
1213
1211
  }
1214
1212
 
1215
- return if let Some((major, minor)) = has_abi3(&deps)? {
1216
- eprintln!("🔗 Found {lib} bindings with abi3 support for Python ≥ {major}.{minor}");
1213
+ return if let Some(abi3_version) = has_abi3(&deps)? {
1214
+ eprintln!("🔗 Found {lib} bindings with abi3 support");
1217
1215
  let pyo3 = bridge.pyo3().expect("should be pyo3 bindings");
1218
1216
  let bindings = PyO3 {
1219
1217
  crate_name: lib,
1220
1218
  version: pyo3.version.clone(),
1221
- abi3: Some((major, minor)),
1219
+ abi3: Some(abi3_version),
1222
1220
  metadata: pyo3.metadata.clone(),
1223
1221
  };
1224
1222
  Ok(BridgeModel::PyO3(bindings))
@@ -1623,7 +1621,7 @@ mod test {
1623
1621
  let bridge = BridgeModel::PyO3(PyO3 {
1624
1622
  crate_name: PyO3Crate::PyO3,
1625
1623
  version: semver::Version::new(0, 24, 1),
1626
- abi3: Some((3, 7)),
1624
+ abi3: Some(Abi3Version::Version(3, 7)),
1627
1625
  metadata: Some(PyO3Metadata {
1628
1626
  cpython: PyO3VersionMetadata {
1629
1627
  min_minor: 7,
@@ -664,7 +664,7 @@ jobs:\n",
664
664
  #[cfg(test)]
665
665
  mod tests {
666
666
  use super::GenerateCI;
667
- use crate::{bridge::PyO3Crate, BridgeModel, PyO3};
667
+ use crate::{bridge::PyO3Crate, Abi3Version, BridgeModel, PyO3};
668
668
  use expect_test::expect;
669
669
  use semver::Version;
670
670
 
@@ -874,7 +874,7 @@ mod tests {
874
874
  &BridgeModel::PyO3(PyO3 {
875
875
  crate_name: PyO3Crate::PyO3,
876
876
  version: Version::new(0, 23, 0),
877
- abi3: Some((3, 7)),
877
+ abi3: Some(Abi3Version::Version(3, 7)),
878
878
  metadata: None,
879
879
  }),
880
880
  false,
@@ -1086,7 +1086,7 @@ mod tests {
1086
1086
  &BridgeModel::PyO3(PyO3 {
1087
1087
  crate_name: PyO3Crate::PyO3,
1088
1088
  version: Version::new(0, 23, 0),
1089
- abi3: Some((3, 7)),
1089
+ abi3: Some(Abi3Version::Version(3, 7)),
1090
1090
  metadata: None,
1091
1091
  }),
1092
1092
  false,
@@ -23,7 +23,7 @@
23
23
 
24
24
  #![deny(missing_docs)]
25
25
 
26
- pub use crate::bridge::{BridgeModel, PyO3, PyO3Crate};
26
+ pub use crate::bridge::{Abi3Version, BridgeModel, PyO3, PyO3Crate};
27
27
  pub use crate::build_context::{BuildContext, BuiltWheelMetadata};
28
28
  pub use crate::build_options::{BuildOptions, CargoOptions, TargetTriple};
29
29
  pub use crate::cargo_toml::CargoToml;
@@ -13,8 +13,8 @@ use clap::{Parser, Subcommand};
13
13
  #[cfg(feature = "scaffolding")]
14
14
  use maturin::{ci::GenerateCI, init_project, new_project, GenerateProjectOptions};
15
15
  use maturin::{
16
- develop, write_dist_info, BridgeModel, BuildOptions, CargoOptions, DevelopOptions, PathWriter,
17
- PlatformTag, PythonInterpreter, Target, TargetTriple,
16
+ develop, write_dist_info, Abi3Version, BridgeModel, BuildOptions, CargoOptions, DevelopOptions,
17
+ PathWriter, PlatformTag, PythonInterpreter, Target, TargetTriple,
18
18
  };
19
19
  #[cfg(feature = "schemars")]
20
20
  use maturin::{generate_json_schema, GenerateJsonSchemaOptions};
@@ -284,10 +284,19 @@ fn pep517(subcommand: Pep517Command) -> Result<()> {
284
284
  let tags = match context.bridge() {
285
285
  BridgeModel::PyO3(bindings) | BridgeModel::Bin(Some(bindings)) => {
286
286
  match bindings.abi3 {
287
- Some((major, minor)) => {
287
+ Some(Abi3Version::Version(major, minor)) => {
288
288
  let platform = context.get_platform_tag(&[PlatformTag::Linux])?;
289
289
  vec![format!("cp{major}{minor}-abi3-{platform}")]
290
290
  }
291
+ Some(Abi3Version::CurrentPython) => {
292
+ let interp = &context.interpreter[0];
293
+ let platform = context.get_platform_tag(&[PlatformTag::Linux])?;
294
+ vec![format!(
295
+ "cp{major}{minor}-abi3-{platform}",
296
+ major = interp.major,
297
+ minor = interp.minor
298
+ )]
299
+ }
291
300
  None => {
292
301
  vec![context.interpreter[0].get_tag(&context, &[PlatformTag::Linux])?]
293
302
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes