Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-maturin for openSUSE:Factory checked in at 2025-06-11 16:20:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-maturin (Old) and /work/SRC/openSUSE:Factory/.python-maturin.new.19631 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-maturin" Wed Jun 11 16:20:03 2025 rev:48 rq:1284232 version:1.8.7 Changes: -------- --- /work/SRC/openSUSE:Factory/python-maturin/python-maturin.changes 2025-05-13 20:12:58.593741396 +0200 +++ /work/SRC/openSUSE:Factory/.python-maturin.new.19631/python-maturin.changes 2025-06-11 16:20:38.781756717 +0200 @@ -1,0 +2,8 @@ +Mon Jun 9 14:34:52 UTC 2025 - Mia Herkt <m...@0x0.st> + +- Update to 1.8.7 + * Allow specifying compression method and level, in both `build` + and `develop` modes + gh#PyO3/maturin#2625 + +------------------------------------------------------------------- Old: ---- maturin-1.8.6.tar.gz New: ---- maturin-1.8.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-maturin.spec ++++++ --- /var/tmp/diff_new_pack.GH2QqO/_old 2025-06-11 16:20:40.217816572 +0200 +++ /var/tmp/diff_new_pack.GH2QqO/_new 2025-06-11 16:20:40.221816738 +0200 @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-maturin -Version: 1.8.6 +Version: 1.8.7 Release: 0 Summary: Rust/Python Interoperability License: Apache-2.0 OR MIT ++++++ maturin-1.8.6.tar.gz -> maturin-1.8.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.8.6/.pre-commit-config.yaml new/maturin-1.8.7/.pre-commit-config.yaml --- old/maturin-1.8.6/.pre-commit-config.yaml 2025-05-13 15:39:43.000000000 +0200 +++ new/maturin-1.8.7/.pre-commit-config.yaml 2025-06-09 15:35:18.000000000 +0200 @@ -56,12 +56,12 @@ ) - id: mixed-line-ending - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.9 + rev: v0.11.12 hooks: - id: ruff-format - id: ruff - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.15.0 + rev: v1.16.0 hooks: - id: mypy entry: mypy maturin/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.8.6/Cargo.lock new/maturin-1.8.7/Cargo.lock --- old/maturin-1.8.6/Cargo.lock 2025-05-13 15:39:43.000000000 +0200 +++ new/maturin-1.8.7/Cargo.lock 2025-06-09 15:35:18.000000000 +0200 @@ -262,9 +262,9 @@ [[package]] name = "cargo-xwin" -version = "0.18.4" +version = "0.18.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60f1954e4ffa0f4c47b3df5e6e9508706d8dcaa56152cd672dcee02930ba0326" +checksum = "5dff83aad332bd6ee29072dd874b48892cd22c58e233c25735eb4417b3999685" dependencies = [ "anyhow", "cargo-config2", @@ -330,11 +330,11 @@ [[package]] name = "cbindgen" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eadd868a2ce9ca38de7eeafdcec9c7065ef89b42b32f0839278d55f35c54d1ff" +checksum = "975982cdb7ad6a142be15bdf84aea7ec6a9e5d4d797c004d43185b24cfe4e684" dependencies = [ - "heck 0.4.1", + "heck", "indexmap", "log", "proc-macro2", @@ -352,6 +352,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ + "jobserver", + "libc", "shlex", ] @@ -451,7 +453,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn", @@ -951,7 +953,19 @@ dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] @@ -1002,12 +1016,6 @@ [[package]] name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" @@ -1253,6 +1261,16 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] +name = "jobserver" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" +dependencies = [ + "getrandom 0.3.3", + "libc", +] + +[[package]] name = "js-sys" version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1290,9 +1308,9 @@ [[package]] name = "libc" -version = "0.2.167" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "libmimalloc-sys" @@ -1359,6 +1377,16 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] +name = "lzma-rs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297e814c836ae64db86b36cf2a557ba54368d03f6afcd7d947c266692f71115e" +dependencies = [ + "byteorder", + "crc", +] + +[[package]] name = "lzma-sys" version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1397,7 +1425,7 @@ [[package]] name = "maturin" -version = "1.8.6" +version = "1.8.7" dependencies = [ "anyhow", "base64 0.21.7", @@ -1900,6 +1928,12 @@ checksum = "79ec282e887b434b68c18fe5c121d38e72a5cf35119b59e54ec5b992ea9c8eb0" [[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + +[[package]] name = "rand" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1926,7 +1960,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.15", ] [[package]] @@ -1973,7 +2007,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ - "getrandom", + "getrandom 0.2.15", "libredox", "thiserror 1.0.69", ] @@ -2050,7 +2084,7 @@ dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.15", "libc", "untrusted", "windows-sys 0.52.0", @@ -2974,6 +3008,15 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] name = "wasm-bindgen" version = "0.2.96" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3263,6 +3306,15 @@ checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" [[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.5.0", +] + +[[package]] name = "write16" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3440,10 +3492,12 @@ "displaydoc", "flate2", "indexmap", + "lzma-rs", "memchr", "thiserror 2.0.3", "time", "zopfli", + "zstd", ] [[package]] @@ -3459,3 +3513,31 @@ "once_cell", "simd-adler32", ] + +[[package]] +name = "zstd" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.15+zstd.1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" +dependencies = [ + "cc", + "pkg-config", +] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.8.6/Cargo.toml new/maturin-1.8.7/Cargo.toml --- old/maturin-1.8.6/Cargo.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/maturin-1.8.7/Cargo.toml 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +1,7 @@ [package] authors = ["konstin <kons...@mailbox.org>", "messense <messe...@icloud.com>"] name = "maturin" -version = "1.8.6" +version = "1.8.7" description = "Build and publish crates with pyo3, cffi and uniffi bindings as well as rust binaries as python packages" exclude = [ "test-crates/**/*", @@ -45,7 +45,7 @@ cargo-config2 = "0.1.24" cargo_metadata = "0.19.0" cargo-options = "0.7.2" -cbindgen = { version = "0.28.0", default-features = false } +cbindgen = { version = "0.29.0", default-features = false } flate2 = "1.0.18" goblin = "0.9.0" platform-info = "2.0.2" @@ -61,6 +61,8 @@ "bzip2", "deflate", "time", + "zstd", + "lzma" ] } thiserror = "2.0.3" fs-err = "3.0.0" @@ -98,7 +100,7 @@ # cross compile cargo-zigbuild = { version = "0.20.0", default-features = false, optional = true } -cargo-xwin = { version = "0.18.4", default-features = false, optional = true } +cargo-xwin = { version = "0.18.6", default-features = false, optional = true } # log tracing = "0.1.36" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.8.6/Changelog.md new/maturin-1.8.7/Changelog.md --- old/maturin-1.8.6/Changelog.md 2025-05-13 15:39:43.000000000 +0200 +++ new/maturin-1.8.7/Changelog.md 2025-06-09 15:35:18.000000000 +0200 @@ -1,5 +1,10 @@ # Changelog +## [1.8.7] + +- Allow specifying compression method and level, in both `build` and `develop` modes, in [#2625](https://github.com/PyO3/maturin/pull/2625). +- Fix Windows free-threaded builds on Python 3.14 in [#2632](https://github.com/PyO3/maturin/pull/2632) + ## [1.8.6] * Print a message when overriding platform tag from `_PYTHON_HOST_PLATFORM` in [#2594](https://github.com/PyO3/maturin/pull/2594) @@ -1069,7 +1074,8 @@ * Initial Release -[Unreleased]: https://github.com/pyo3/maturin/compare/v1.8.6...HEAD +[Unreleased]: https://github.com/pyo3/maturin/compare/v1.8.7...HEAD +[1.8.7]: https://github.com/pyo3/maturin/compare/v1.8.6...v1.8.7 [1.8.6]: https://github.com/pyo3/maturin/compare/v1.8.5...v1.8.6 [1.8.5]: https://github.com/pyo3/maturin/compare/v1.8.4...v1.8.5 [1.8.4]: https://github.com/pyo3/maturin/compare/v1.8.3...v1.8.4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.8.6/PKG-INFO new/maturin-1.8.7/PKG-INFO --- old/maturin-1.8.6/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/maturin-1.8.7/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: maturin -Version: 1.8.6 +Version: 1.8.7 Classifier: Topic :: Software Development :: Build Tools Classifier: Programming Language :: Rust Classifier: Programming Language :: Python :: Implementation :: CPython diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.8.6/maturin/bootstrap.py new/maturin-1.8.7/maturin/bootstrap.py --- old/maturin-1.8.6/maturin/bootstrap.py 2025-05-13 15:39:43.000000000 +0200 +++ new/maturin-1.8.7/maturin/bootstrap.py 2025-06-09 15:35:18.000000000 +0200 @@ -17,15 +17,23 @@ # noinspection PyUnresolvedReferences from setuptools.build_meta import * # noqa:F403 +from setuptools.build_meta import ( + get_requires_for_build_sdist as _orig_get_requires_for_build_sdist, +) +from setuptools.build_meta import ( + get_requires_for_build_wheel as _orig_get_requires_for_build_wheel, +) -def get_requires_for_build_wheel(_config_settings: dict[str, Any] | None = None) -> list[str]: +def get_requires_for_build_wheel(config_settings: dict[str, Any] | None = None) -> list[str]: + reqs = _orig_get_requires_for_build_wheel() if not os.environ.get("MATURIN_NO_INSTALL_RUST") and not shutil.which("cargo"): - return ["puccinialin>=0.1,<0.2"] - return [] + reqs.append("puccinialin>=0.1,<0.2") + return reqs -def get_requires_for_build_sdist(_config_settings: dict[str, Any] | None = None) -> list[str]: +def get_requires_for_build_sdist(config_settings: dict[str, Any] | None = None) -> list[str]: + reqs = _orig_get_requires_for_build_sdist() if not os.environ.get("MATURIN_NO_INSTALL_RUST") and not shutil.which("cargo"): - return ["puccinialin>=0.1,<0.2"] - return [] + reqs.append("puccinialin>=0.1,<0.2") + return reqs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.8.6/src/build_context.rs new/maturin-1.8.7/src/build_context.rs --- old/maturin-1.8.6/src/build_context.rs 2025-05-13 15:39:43.000000000 +0200 +++ new/maturin-1.8.7/src/build_context.rs 2025-06-09 15:35:18.000000000 +0200 @@ -3,6 +3,7 @@ use crate::bridge::Abi3Version; use crate::build_options::CargoOptions; use crate::compile::{warn_missing_py_init, CompileTarget}; +use crate::compression::CompressionOptions; use crate::module_writer::{ add_data, write_bin, write_bindings_module, write_cffi_module, write_python_part, write_uniffi_module, write_wasm_launcher, WheelWriter, @@ -132,8 +133,8 @@ pub editable: bool, /// Cargo build options pub cargo_options: CargoOptions, - /// Zip compression level - pub compression_level: u16, + /// Compression options + pub compression: CompressionOptions, } /// The wheel file location and its Python version tag (e.g. `py3`). @@ -671,7 +672,7 @@ &self.metadata24, &[tag.clone()], self.excludes(Format::Wheel)?, - self.compression_level, + self.compression, )?; self.add_external_libs(&mut writer, &[&artifact], &[ext_libs])?; @@ -749,7 +750,7 @@ &self.metadata24, &[tag.clone()], self.excludes(Format::Wheel)?, - self.compression_level, + self.compression, )?; self.add_external_libs(&mut writer, &[&artifact], &[ext_libs])?; @@ -872,7 +873,7 @@ &self.metadata24, &tags, self.excludes(Format::Wheel)?, - self.compression_level, + self.compression, )?; self.add_external_libs(&mut writer, &[&artifact], &[ext_libs])?; @@ -944,7 +945,7 @@ &self.metadata24, &tags, self.excludes(Format::Wheel)?, - self.compression_level, + self.compression, )?; self.add_external_libs(&mut writer, &[&artifact], &[ext_libs])?; @@ -1043,7 +1044,7 @@ &metadata24, &tags, self.excludes(Format::Wheel)?, - self.compression_level, + self.compression, )?; if self.project_layout.python_module.is_some() && self.target.is_wasi() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.8.6/src/build_options.rs new/maturin-1.8.7/src/build_options.rs --- old/maturin-1.8.6/src/build_options.rs 2025-05-13 15:39:43.000000000 +0200 +++ new/maturin-1.8.7/src/build_options.rs 2025-06-09 15:35:18.000000000 +0200 @@ -1,6 +1,7 @@ use crate::auditwheel::{AuditWheelMode, PlatformTag}; use crate::bridge::{Abi3Version, PyO3Crate}; use crate::compile::{CompileTarget, LIB_CRATE_TYPES}; +use crate::compression::CompressionOptions; use crate::cross_compile::{find_sysconfigdata, parse_sysconfigdata}; use crate::project_layout::ProjectResolver; use crate::pyproject_toml::ToolMaturin; @@ -217,10 +218,9 @@ #[command(flatten)] pub cargo: CargoOptions, - /// Zip compresson level to use - #[arg(long, value_parser = clap::value_parser!(u16).range(0..=264), hide = true, default_value="6" - )] - pub compression_level: u16, + /// Wheel compression options + #[command(flatten)] + pub compression: CompressionOptions, } impl Deref for BuildOptions { @@ -587,6 +587,7 @@ editable, sdist_only, } = self; + build_options.compression.validate(); let ProjectResolver { project_layout, cargo_toml_path, @@ -807,7 +808,7 @@ universal2, editable, cargo_options, - compression_level: build_options.compression_level, + compression: build_options.compression, }) } } @@ -1268,9 +1269,9 @@ if !interpreter.is_empty() { let mut missing = Vec::new(); for interp in interpreter { - match PythonInterpreter::check_executable(interp.clone(), target, bridge) { - Ok(Some(interp)) => found_interpreters.push(interp), - _ => missing.push(interp.clone()), + match PythonInterpreter::check_executable(interp.clone(), target, bridge)? { + Some(interp) => found_interpreters.push(interp), + None => missing.push(interp.clone()), } } if !missing.is_empty() { @@ -1401,8 +1402,8 @@ format!("Failed to find a {python_impl} {ver_major}.{ver_minor} interpreter in known sysconfig") })?; debug!( - "Found {} {}.{} in bundled sysconfig", - sysconfig.interpreter_kind, sysconfig.major, sysconfig.minor, + "Found {} {}.{}{} in bundled sysconfig", + sysconfig.interpreter_kind, sysconfig.major, sysconfig.minor, sysconfig.abiflags ); interpreters.push(PythonInterpreter::from_config(sysconfig.clone())); } @@ -1620,12 +1621,12 @@ let bridge = BridgeModel::PyO3(PyO3 { crate_name: PyO3Crate::PyO3, - version: semver::Version::new(0, 24, 1), + version: semver::Version::new(0, 25, 0), abi3: Some(Abi3Version::Version(3, 7)), metadata: Some(PyO3Metadata { cpython: PyO3VersionMetadata { min_minor: 7, - max_minor: 13, + max_minor: 14, }, pypy: PyO3VersionMetadata { min_minor: 9, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.8.6/src/compression.rs new/maturin-1.8.7/src/compression.rs --- old/maturin-1.8.6/src/compression.rs 1970-01-01 01:00:00.000000000 +0100 +++ new/maturin-1.8.7/src/compression.rs 2025-06-09 15:35:18.000000000 +0200 @@ -0,0 +1,88 @@ +use clap::{CommandFactory, ValueEnum}; +use serde::{Deserialize, Serialize}; + +#[derive(Serialize, Deserialize, Default, Debug, Copy, Clone, PartialEq, Eq, ValueEnum)] +/// Wheel ZIP compression method. May only be compatible with recent package manager versions. +// See https://docs.rs/zip/latest/zip/write/struct.FileOptions.html#method.compression_level +pub enum CompressionMethod { + #[default] + /// Deflate compression (levels 0-9, default 6) + // NOTE: The levels will change if we enable Zopfli! + Deflated, + /// No compression + Stored, + /// BZIP2 compression (levels 0-9, default 6) + Bzip2, + /// Zstandard compression (supported from Python 3.14; levels -7-22, default 3) + Zstd, +} +impl CompressionMethod { + /// Default level for this compression method + // NOTE: This should match the default from the `zip` crates. + pub fn default_level(self) -> i64 { + match self { + CompressionMethod::Deflated => 6, + CompressionMethod::Stored => 0, + CompressionMethod::Bzip2 => 6, + CompressionMethod::Zstd => 3, + } + } + /// Allowed levels for the method. + pub fn level_range(self) -> std::ops::RangeInclusive<i64> { + match self { + CompressionMethod::Deflated => 0..=9, + CompressionMethod::Stored => 0..=0, + CompressionMethod::Bzip2 => 0..=9, + CompressionMethod::Zstd => -7..=22, + } + } +} +impl From<CompressionMethod> for zip::CompressionMethod { + fn from(source: CompressionMethod) -> Self { + match source { + CompressionMethod::Deflated => zip::CompressionMethod::Deflated, + CompressionMethod::Stored => zip::CompressionMethod::Stored, + CompressionMethod::Bzip2 => zip::CompressionMethod::Bzip2, + CompressionMethod::Zstd => zip::CompressionMethod::ZSTD, + } + } +} +#[derive(Debug, Default, Serialize, Deserialize, clap::Parser, Clone, Copy, Eq, PartialEq)] +/// Wheel ZIP compression options. +pub struct CompressionOptions { + /// Zip compression method. Only Stored and Deflated are currently compatible with all + /// package managers. + #[arg(long, value_enum, default_value_t = CompressionMethod::default())] + pub compression_method: CompressionMethod, + + /// Zip compression level. Defaults to method default. + #[arg(long, allow_negative_numbers = true)] + pub compression_level: Option<i64>, +} +impl CompressionOptions { + /// Validate arguments, exit on error + pub fn validate(&self) { + if let Some(level) = self.compression_level { + let range = self.compression_method.level_range(); + if !range.contains(&level) { + let mut cmd = Self::command(); + cmd.error( + clap::error::ErrorKind::ArgumentConflict, + format!( + "Invalid level {} for compression method {:?}. Use a level in range {:?}", + level, self.compression_method, range + ), + ) + .exit(); + } + } + } + /// No compression + pub fn none() -> Self { + let method = CompressionMethod::Stored; + Self { + compression_method: method, + compression_level: Some(method.default_level()), + } + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.8.6/src/develop.rs new/maturin-1.8.7/src/develop.rs --- old/maturin-1.8.6/src/develop.rs 2025-05-13 15:39:43.000000000 +0200 +++ new/maturin-1.8.7/src/develop.rs 2025-06-09 15:35:18.000000000 +0200 @@ -1,5 +1,6 @@ use crate::auditwheel::AuditWheelMode; use crate::build_options::CargoOptions; +use crate::compression::CompressionOptions; use crate::target::detect_arch_from_python; use crate::BuildContext; use crate::BuildOptions; @@ -229,6 +230,10 @@ /// Use `uv` to install packages instead of `pip` #[arg(long)] pub uv: bool, + + /// Wheel compression options + #[command(flatten)] + pub compression: CompressionOptions, } #[instrument(skip_all)] @@ -387,7 +392,10 @@ pip_path, cargo_options, uv, + compression, } = develop_options; + compression.validate(); + let mut target_triple = cargo_options.target.clone(); let target = Target::from_target_triple(cargo_options.target.as_ref())?; let python = target.get_venv_python(venv_dir); @@ -416,7 +424,7 @@ target: target_triple, ..cargo_options }, - compression_level: 6, + compression, }; let build_context = build_options diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.8.6/src/lib.rs new/maturin-1.8.7/src/lib.rs --- old/maturin-1.8.6/src/lib.rs 2025-05-13 15:39:43.000000000 +0200 +++ new/maturin-1.8.7/src/lib.rs 2025-06-09 15:35:18.000000000 +0200 @@ -28,6 +28,7 @@ pub use crate::build_options::{BuildOptions, CargoOptions, TargetTriple}; pub use crate::cargo_toml::CargoToml; pub use crate::compile::{compile, BuildArtifact}; +pub use crate::compression::{CompressionMethod, CompressionOptions}; pub use crate::develop::{develop, DevelopOptions}; #[cfg(feature = "schemars")] pub use crate::generate_json_schema::{generate_json_schema, GenerateJsonSchemaOptions, Mode}; @@ -53,6 +54,7 @@ /// Generate CI configuration pub mod ci; mod compile; +mod compression; mod cross_compile; mod develop; mod generate_json_schema; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.8.6/src/metadata.rs new/maturin-1.8.7/src/metadata.rs --- old/maturin-1.8.6/src/metadata.rs 2025-05-13 15:39:43.000000000 +0200 +++ new/maturin-1.8.7/src/metadata.rs 2025-06-09 15:35:18.000000000 +0200 @@ -416,7 +416,7 @@ let metadata = Metadata24 { // name, version and metadata_version are added through metadata24::new() // Mapped from cargo metadata - summary: package.description.clone(), + summary: package.description.as_ref().map(|d| d.trim().into()), description, description_content_type, keywords: if package.keywords.is_empty() { @@ -688,7 +688,9 @@ authors = ["konstin <kons...@mailbox.org>"] name = "info-project" version = "0.1.0" - description = "A test project" + description = """ +A test project + """ homepage = "https://example.org" readme = "REPLACE_README_PATH" keywords = ["ffi", "test"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.8.6/src/module_writer.rs new/maturin-1.8.7/src/module_writer.rs --- old/maturin-1.8.6/src/module_writer.rs 2025-05-13 15:39:43.000000000 +0200 +++ new/maturin-1.8.7/src/module_writer.rs 2025-06-09 15:35:18.000000000 +0200 @@ -1,4 +1,5 @@ //! The wheel format is (mostly) specified in PEP 427 +use crate::compression::{CompressionMethod, CompressionOptions}; use crate::project_layout::ProjectLayout; use crate::target::Os; use crate::{ @@ -239,7 +240,27 @@ wheel_path: PathBuf, file_tracker: FileTracker, excludes: Override, - compression_level: u16, + compression: CompressionOptions, +} +impl CompressionOptions { + fn get_file_options(&self) -> zip::write::FileOptions<()> { + let method = if cfg!(feature = "faster-tests") { + // Unlike users which can use the develop subcommand, the tests have to go through + // packing a zip which pip than has to unpack. This makes this 2-3 times faster + CompressionMethod::Stored + } else { + self.compression_method + }; + + let mut options = + zip::write::SimpleFileOptions::default().compression_method(method.into()); + // `zip` also has default compression levels, which should match our own, but we pass them + // explicitly to ensure consistency. + options = options.compression_level(Some( + self.compression_level.unwrap_or(method.default_level()), + )); + options + } } impl ModuleWriter for WheelWriter { @@ -267,20 +288,11 @@ // The zip standard mandates using unix style paths let target = target.to_str().unwrap().replace('\\', "/"); - // Unlike users which can use the develop subcommand, the tests have to go through - // packing a zip which pip than has to unpack. This makes this 2-3 times faster - let compression_method = if cfg!(feature = "faster-tests") || self.compression_level == 0 { - zip::CompressionMethod::Stored - } else { - zip::CompressionMethod::Deflated - }; + let mut options = self + .compression + .get_file_options() + .unix_permissions(permissions); - let mut options = zip::write::SimpleFileOptions::default() - .unix_permissions(permissions) - .compression_method(compression_method); - if self.compression_level != 0 { - options = options.compression_level(Some(self.compression_level as i64)); - } let mtime = self.mtime().ok(); if let Some(mtime) = mtime { options = options.last_modified_time(mtime); @@ -306,7 +318,7 @@ metadata24: &Metadata24, tags: &[String], excludes: Override, - compression_level: u16, + compression: CompressionOptions, ) -> Result<WheelWriter> { let wheel_path = wheel_dir.join(format!( "{}-{}-{}.whl", @@ -324,7 +336,7 @@ wheel_path, file_tracker: FileTracker::default(), excludes, - compression_level, + compression, }; write_dist_info(&mut builder, metadata24, tags)?; @@ -383,17 +395,7 @@ /// Creates the record file and finishes the zip pub fn finish(mut self) -> Result<PathBuf, io::Error> { - let compression_method = if cfg!(feature = "faster-tests") || self.compression_level == 0 { - zip::CompressionMethod::Stored - } else { - zip::CompressionMethod::Deflated - }; - - let mut options = - zip::write::SimpleFileOptions::default().compression_method(compression_method); - if self.compression_level != 0 { - options = options.compression_level(Some(self.compression_level as i64)); - } + let mut options = self.compression.get_file_options(); let mtime = self.mtime().ok(); if let Some(mtime) = mtime { options = options.last_modified_time(mtime); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.8.6/src/python_interpreter/mod.rs new/maturin-1.8.7/src/python_interpreter/mod.rs --- old/maturin-1.8.6/src/python_interpreter/mod.rs 2025-05-13 15:39:43.000000000 +0200 +++ new/maturin-1.8.7/src/python_interpreter/mod.rs 2025-06-09 15:35:18.000000000 +0200 @@ -427,7 +427,7 @@ if message.interpreter == "pypy" || message.interpreter == "graalvm" { // pypy and graalpy do not specify abi flags Ok("".to_string()) - } else if message.system == "windows" { + } else if message.system == "windows" && message.minor < 14 { if matches!(message.abiflags.as_deref(), Some("") | None) { // windows has a few annoying cases, but its abiflags in sysconfig always empty // python <= 3.7 has "m" @@ -443,7 +443,7 @@ Ok("".to_string()) } } else { - bail!("A python 3 interpreter on Windows does not define abiflags in its sysconfig ಠ_ಠ") + bail!("A python 3 interpreter on Windows does not define abiflags in its sysconfig before Python 3.14 ಠ_ಠ") } } else if let Some(ref abiflags) = message.abiflags { if message.minor >= 8 { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.8.6/src/templates/Cargo.toml.j2 new/maturin-1.8.7/src/templates/Cargo.toml.j2 --- old/maturin-1.8.6/src/templates/Cargo.toml.j2 2025-05-13 15:39:43.000000000 +0200 +++ new/maturin-1.8.7/src/templates/Cargo.toml.j2 2025-06-09 15:35:18.000000000 +0200 @@ -12,7 +12,7 @@ [dependencies] {% if bindings == "pyo3" -%} -pyo3 = "0.24.0" +pyo3 = "0.25.0" {% elif bindings == "uniffi" -%} uniffi = "0.28.0" ++++++ vendor.tar.xz ++++++ /work/SRC/openSUSE:Factory/python-maturin/vendor.tar.xz /work/SRC/openSUSE:Factory/.python-maturin.new.19631/vendor.tar.xz differ: char 15, line 1