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 2023-11-15 21:06:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-maturin (Old) and /work/SRC/openSUSE:Factory/.python-maturin.new.17445 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-maturin" Wed Nov 15 21:06:58 2023 rev:35 rq:1126453 version:1.3.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-maturin/python-maturin.changes 2023-11-07 21:25:13.064993225 +0100 +++ /work/SRC/openSUSE:Factory/.python-maturin.new.17445/python-maturin.changes 2023-11-15 21:07:31.449898810 +0100 @@ -1,0 +2,24 @@ +Tue Nov 14 18:51:32 UTC 2023 - Mia Herkt <m...@0x0.st> + +- Update to 1.3.2 + * Switch to Ruff formatter + gh#PyO3/maturin#1817 + * Upgrade ring to 0.17 + gh#PyO3/maturin#1819 + * Un-deprecate MATURIN_PEP517_ARGS env var + gh#PyO3/maturin#1820 + * Add support for uniffi library mode + gh#PyO3/maturin#1729 + * Fix missing member in Cargo.toml for sdist of nested workspace + layout + gh#PyO3/maturin#1828 + * Metadata: escape display name in email addresses + gh#PyO3/maturin#1832 + * Fix rewriting workspace Cargo.toml in sdist + gh#PyO3/maturin#1841 + * Fix glob workspace members matching in sdist + gh#PyO3/maturin#1846 + * Add sdist tests for well-known downstream repositories + gh#PyO3/maturin#1849 + +------------------------------------------------------------------- Old: ---- maturin-1.3.1.tar.gz New: ---- maturin-1.3.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-maturin.spec ++++++ --- /var/tmp/diff_new_pack.9NQuHo/_old 2023-11-15 21:07:33.861987806 +0100 +++ /var/tmp/diff_new_pack.9NQuHo/_new 2023-11-15 21:07:33.861987806 +0100 @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-maturin -Version: 1.3.1 +Version: 1.3.2 Release: 0 Summary: Rust/Python Interoperability License: Apache-2.0 OR MIT ++++++ maturin-1.3.1.tar.gz -> maturin-1.3.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.3.1/.cirrus.yml new/maturin-1.3.2/.cirrus.yml --- old/maturin-1.3.1/.cirrus.yml 2023-10-24 15:26:02.000000000 +0200 +++ new/maturin-1.3.2/.cirrus.yml 2023-11-14 13:29:20.000000000 +0100 @@ -45,7 +45,7 @@ - cat Cargo.lock install_script: - brew install python3 - - python3 -m pip install uniffi-bindgen==0.24.1 + - python3 -m pip install uniffi-bindgen==0.25.0 <<: *BUILD_AND_TEST linux_aarch64_task: @@ -62,5 +62,5 @@ - echo $CIRRUS_OS - cat Cargo.lock install_script: - - python3 -m pip install uniffi-bindgen==0.24.1 + - python3 -m pip install uniffi-bindgen==0.25.0 <<: *BUILD_AND_TEST diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.3.1/.pre-commit-config.yaml new/maturin-1.3.2/.pre-commit-config.yaml --- old/maturin-1.3.1/.pre-commit-config.yaml 2023-10-24 15:26:02.000000000 +0200 +++ new/maturin-1.3.2/.pre-commit-config.yaml 2023-11-14 13:29:20.000000000 +0100 @@ -55,16 +55,13 @@ (.*\.stdout) ) - id: mixed-line-ending - - repo: https://github.com/psf/black - rev: 23.10.0 - hooks: - - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.1 + rev: v0.1.5 hooks: + - id: ruff-format - id: ruff - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.6.1 + rev: v1.7.0 hooks: - id: mypy entry: mypy maturin/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.3.1/Cargo.lock new/maturin-1.3.2/Cargo.lock --- old/maturin-1.3.1/Cargo.lock 2023-10-24 15:26:02.000000000 +0200 +++ new/maturin-1.3.2/Cargo.lock 2023-11-14 13:29:20.000000000 +0100 @@ -10,9 +10,9 @@ [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ "getrandom", "once_cell", @@ -127,12 +127,6 @@ ] [[package]] -name = "bumpalo" -version = "3.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" - -[[package]] name = "byteorder" version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -246,9 +240,9 @@ [[package]] name = "cargo-zigbuild" -version = "0.17.3" +version = "0.17.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2307bb523befb01f7e8cf299c2219439339316964c3a4e95e29bd1c7831fae89" +checksum = "d5166694ea85c72f887293af72a665d7ac5a537649e607773bf834cb6303b1da" dependencies = [ "anyhow", "cargo-options", @@ -282,9 +276,9 @@ [[package]] name = "cbindgen" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faeaa693e5a727975a79211b8f35c0cb09b031fdb6eaa4a788bc6713d01488ca" +checksum = "da6bc11b07529f16944307272d5bd9b22530bc7d05751717c9d416586cedab49" dependencies = [ "heck", "indexmap", @@ -576,12 +570,13 @@ [[package]] name = "dialoguer" -version = "0.10.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +checksum = "658bce805d770f407bc62102fca7c2c64ceef2fbcb2b8bd19d2765ce093980de" dependencies = [ "console", "shell-words", + "thiserror", "zeroize", ] @@ -964,15 +959,6 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] -name = "js-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" -dependencies = [ - "wasm-bindgen", -] - -[[package]] name = "keyring" version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1068,7 +1054,7 @@ [[package]] name = "maturin" -version = "1.3.1" +version = "1.3.2" dependencies = [ "anyhow", "base64 0.21.2", @@ -1104,6 +1090,7 @@ "native-tls", "normpath", "once_cell", + "path-slash", "pep440_rs", "pep508_rs", "platform-info", @@ -1672,17 +1659,16 @@ [[package]] name = "ring" -version = "0.16.20" +version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e" dependencies = [ "cc", + "getrandom", "libc", - "once_cell", "spin", "untrusted", - "web-sys", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -1710,9 +1696,9 @@ [[package]] name = "rustls" -version = "0.21.2" +version = "0.21.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f" +checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" dependencies = [ "log", "ring", @@ -1731,9 +1717,9 @@ [[package]] name = "rustls-webpki" -version = "0.100.2" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98ff011474fa39949b7e5c0428f9b4937eda7da7848bbb947786b7be0b27dab" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ "ring", "untrusted", @@ -1797,9 +1783,9 @@ [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ "ring", "untrusted", @@ -1977,9 +1963,9 @@ [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "stacker" @@ -2356,15 +2342,15 @@ [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9" +checksum = "f5ccd538d4a604753ebc2f17cd9946e89b77bf87f6a8e2309667c6f2e87855e3" dependencies = [ "base64 0.21.2", "flate2", @@ -2382,9 +2368,9 @@ [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -2458,77 +2444,10 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "wasm-bindgen" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.29", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" - -[[package]] -name = "web-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] name = "webpki-roots" -version = "0.23.1" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" -dependencies = [ - "rustls-webpki", -] +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" [[package]] name = "which" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.3.1/Cargo.toml new/maturin-1.3.2/Cargo.toml --- old/maturin-1.3.1/Cargo.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/maturin-1.3.2/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.3.1" +version = "1.3.2" description = "Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries as python packages" exclude = [ "test-crates/**/*", @@ -41,7 +41,7 @@ cargo-config2 = "0.1.9" cargo_metadata = "0.18.0" cargo-options = "0.6.0" -cbindgen = { version = "0.25.0", default-features = false } +cbindgen = { version = "0.26.0", default-features = false } flate2 = "1.0.18" goblin = "0.7.1" platform-info = "2.0.2" @@ -71,6 +71,7 @@ cc = "1.0.72" dunce = "1.0.2" normpath = "1.0.0" +path-slash = "0.2.1" pep440_rs = { version = "0.3.6", features = ["serde"] } pep508_rs = { version = "0.2.1", features = ["serde"] } time = "0.3.17" @@ -80,7 +81,7 @@ clap_complete_command = { version = "0.5.1", optional = true } # cross compile -cargo-zigbuild = { version = "0.17.3", default-features = false, optional = true } +cargo-zigbuild = { version = "0.17.5", default-features = false, optional = true } cargo-xwin = { version = "0.14.7", default-features = false, optional = true } # log @@ -88,7 +89,7 @@ tracing-subscriber = { version = "0.3.15", features = ["env-filter"], optional = true } # project scaffolding, maturin new/init/generate-ci -dialoguer = { version = "0.10.2", default-features = false, optional = true } +dialoguer = { version = "0.11.0", default-features = false, optional = true } console = { version = "0.15.4", optional = true } minijinja = { version = "1.0.7", optional = true } @@ -99,11 +100,11 @@ multipart = { version = "0.18.0", features = ["client"], default-features = false, optional = true } ureq = { version = "2.7.0", features = ["gzip", "json", "socks-proxy"], default-features = false, optional = true } native-tls = { version = "0.2.8", optional = true } -rustls = { version = "0.21.2", optional = true } +rustls = { version = "0.21.8", optional = true } rustls-pemfile = { version = "1.0.1", optional = true } keyring = { version = "2.0.0", default-features = false, features = ["linux-no-secret-service"], optional = true } wild = { version = "2.1.0", optional = true } -url = { version = "2.3.1", optional = true } +url = { version = "2.4.1", optional = true } [dev-dependencies] expect-test = "1.4.1" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.3.1/Changelog.md new/maturin-1.3.2/Changelog.md --- old/maturin-1.3.1/Changelog.md 2023-10-24 15:26:02.000000000 +0200 +++ new/maturin-1.3.2/Changelog.md 2023-11-14 13:29:20.000000000 +0100 @@ -7,6 +7,15 @@ ## [Unreleased] +## [1.3.2] - 2023-11-14 + +* Add support for uniffi library mode in [#1729](https://github.com/PyO3/maturin/pull/1729) +* Un-deprecate `MATURIN_PEP517_ARGS` env var in [#1820](https://github.com/PyO3/maturin/pull/1820) +* Fix missing member in Cargo.toml for sdist of nested workspace layout in [#1828](https://github.com/PyO3/maturin/pull/1828) +* Escape display name in email addresses of wheel metadata in [#1832](https://github.com/PyO3/maturin/pull/1832) +* Fix rewriting workspace Cargo.toml in sdist in [#1841](https://github.com/PyO3/maturin/pull/1841) +* Fix glob workspace members matching in sdist in [#1846](https://github.com/PyO3/maturin/pull/1846) + ## [1.3.1] - 2023-10-24 * Use external `uniffi-bindgen` if no root package is configured in [#1797](https://github.com/PyO3/maturin/pull/1797) @@ -927,7 +936,8 @@ * Initial Release -[Unreleased]: https://github.com/pyo3/maturin/compare/v1.3.1...HEAD +[Unreleased]: https://github.com/pyo3/maturin/compare/v1.3.2...HEAD +[1.3.2]: https://github.com/pyo3/maturin/compare/v1.3.1...v1.3.2 [1.3.1]: https://github.com/pyo3/maturin/compare/v1.3.0...v1.3.1 [1.3.0]: https://github.com/pyo3/maturin/compare/v1.2.3...v1.3.0 [1.2.3]: https://github.com/pyo3/maturin/compare/v1.2.2...v1.2.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.3.1/PKG-INFO new/maturin-1.3.2/PKG-INFO --- old/maturin-1.3.1/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/maturin-1.3.2/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: maturin -Version: 1.3.1 +Version: 1.3.2 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.3.1/maturin/__init__.py new/maturin-1.3.2/maturin/__init__.py --- old/maturin-1.3.1/maturin/__init__.py 2023-10-24 15:26:02.000000000 +0200 +++ new/maturin-1.3.2/maturin/__init__.py 2023-11-14 13:29:20.000000000 +0100 @@ -32,16 +32,10 @@ return pyproject_toml.get("tool", {}).get("maturin", {}) -def get_maturin_pep517_args( - config_settings: Optional[Mapping[str, Any]] = None -) -> List[str]: +def get_maturin_pep517_args(config_settings: Optional[Mapping[str, Any]] = None) -> List[str]: build_args = config_settings.get("build-args") if config_settings else None if build_args is None: env_args = os.getenv("MATURIN_PEP517_ARGS", "") - if env_args: - print( - f"'MATURIN_PEP517_ARGS' is deprecated, use `--config-settings build-args='{env_args}'` instead." - ) args = shlex.split(env_args) elif isinstance(build_args, str): args = shlex.split(build_args) @@ -91,9 +85,7 @@ sys.stdout.buffer.write(result.stdout) sys.stdout.flush() if result.returncode != 0: - sys.stderr.write( - f"Error: command {command} returned non-zero exit status {result.returncode}\n" - ) + sys.stderr.write(f"Error: command {command} returned non-zero exit status {result.returncode}\n") sys.exit(1) output = result.stdout.decode(errors="replace") wheel_path = output.strip().splitlines()[-1] @@ -112,9 +104,7 @@ # noinspection PyUnusedLocal -def build_sdist( - sdist_directory: str, config_settings: Optional[Mapping[str, Any]] = None -) -> str: +def build_sdist(sdist_directory: str, config_settings: Optional[Mapping[str, Any]] = None) -> str: command = ["maturin", "pep517", "write-sdist", "--sdist-directory", sdist_directory] print("Running `{}`".format(" ".join(command))) @@ -123,18 +113,14 @@ sys.stdout.buffer.write(result.stdout) sys.stdout.flush() if result.returncode != 0: - sys.stderr.write( - f"Error: command {command} returned non-zero exit status {result.returncode}\n" - ) + sys.stderr.write(f"Error: command {command} returned non-zero exit status {result.returncode}\n") sys.exit(1) output = result.stdout.decode(errors="replace") return output.strip().splitlines()[-1] # noinspection PyUnusedLocal -def get_requires_for_build_wheel( - config_settings: Optional[Mapping[str, Any]] = None -) -> List[str]: +def get_requires_for_build_wheel(config_settings: Optional[Mapping[str, Any]] = None) -> List[str]: if get_config().get("bindings") == "cffi": return ["cffi"] else: @@ -147,9 +133,7 @@ config_settings: Optional[Mapping[str, Any]] = None, metadata_directory: Optional[str] = None, ) -> str: - return _build_wheel( - wheel_directory, config_settings, metadata_directory, editable=True - ) + return _build_wheel(wheel_directory, config_settings, metadata_directory, editable=True) # Requirements to build an editable are the same as for a wheel @@ -157,9 +141,7 @@ # noinspection PyUnusedLocal -def get_requires_for_build_sdist( - config_settings: Optional[Mapping[str, Any]] = None -) -> List[str]: +def get_requires_for_build_sdist(config_settings: Optional[Mapping[str, Any]] = None) -> List[str]: return [] @@ -170,9 +152,7 @@ print("Checking for Rust toolchain....") is_cargo_installed = False try: - output = subprocess.check_output(["cargo", "--version"]).decode( - "utf-8", "ignore" - ) + output = subprocess.check_output(["cargo", "--version"]).decode("utf-8", "ignore") if "cargo" in output: is_cargo_installed = True except (FileNotFoundError, SubprocessError): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.3.1/maturin/import_hook.py new/maturin-1.3.2/maturin/import_hook.py --- old/maturin-1.3.1/maturin/import_hook.py 2023-10-24 15:26:02.000000000 +0200 +++ new/maturin-1.3.2/maturin/import_hook.py 2023-11-14 13:29:20.000000000 +0100 @@ -71,9 +71,7 @@ return None - def _build_and_load( - self, fullname: str, cargo_toml: pathlib.Path - ) -> ModuleSpec | None: + def _build_and_load(self, fullname: str, cargo_toml: pathlib.Path) -> ModuleSpec | None: build_module(cargo_toml, bindings=self.bindings) loader = Loader(fullname) return importlib.util.spec_from_loader(fullname, loader) @@ -98,10 +96,7 @@ with open(cargo_toml, "rb") as f: cargo = tomllib.load(f) package_name = cargo.get("package", {}).get("name") - if ( - package_name == module_name - or package_name.replace("-", "_") == module_name - ): + if package_name == module_name or package_name.replace("-", "_") == module_name: return True return False @@ -115,9 +110,7 @@ command: list[str] = ["maturin", "new", "-b", bindings, str(project_dir)] result = subprocess.run(command, stdout=subprocess.PIPE) if result.returncode != 0: - sys.stderr.write( - f"Error: command {command} returned non-zero exit status {result.returncode}\n" - ) + sys.stderr.write(f"Error: command {command} returned non-zero exit status {result.returncode}\n") raise ImportError("Failed to generate cargo project") with open(rust_file) as f: @@ -128,9 +121,7 @@ return project_dir -def build_module( - manifest_path: pathlib.Path, bindings: str | None = None, release: bool = False -) -> None: +def build_module(manifest_path: pathlib.Path, bindings: str | None = None, release: bool = False) -> None: command = ["maturin", "develop", "-m", str(manifest_path)] if bindings: command.append("-b") @@ -141,9 +132,7 @@ sys.stdout.buffer.write(result.stdout) sys.stdout.flush() if result.returncode != 0: - sys.stderr.write( - f"Error: command {command} returned non-zero exit status {result.returncode}\n" - ) + sys.stderr.write(f"Error: command {command} returned non-zero exit status {result.returncode}\n") raise ImportError("Failed to build module with maturin") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.3.1/setup.py new/maturin-1.3.2/setup.py --- old/maturin-1.3.1/setup.py 2023-10-24 15:26:02.000000000 +0200 +++ new/maturin-1.3.2/setup.py 2023-11-14 13:29:20.000000000 +0100 @@ -64,9 +64,7 @@ python_requires=">=3.7", cmdclass={"bdist_wheel": bdist_wheel}, packages=["maturin"], - rust_extensions=[ - RustBin("maturin", args=cargo_args, cargo_manifest_args=["--locked"]) - ], + rust_extensions=[RustBin("maturin", args=cargo_args, cargo_manifest_args=["--locked"])], classifiers=[ "Topic :: Software Development :: Build Tools", "Programming Language :: Rust", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.3.1/src/metadata.rs new/maturin-1.3.2/src/metadata.rs --- old/maturin-1.3.1/src/metadata.rs 2023-10-24 15:26:02.000000000 +0200 +++ new/maturin-1.3.2/src/metadata.rs 2023-11-14 13:29:20.000000000 +0100 @@ -226,7 +226,7 @@ for author in authors { match (&author.name, &author.email) { (Some(name), Some(email)) => { - emails.push(format!("{name} <{email}>")); + emails.push(escape_email_with_display_name(name, email)); } (Some(name), None) => { names.push(name.as_str()); @@ -251,7 +251,7 @@ for maintainer in maintainers { match (&maintainer.name, &maintainer.email) { (Some(name), Some(email)) => { - emails.push(format!("{name} <{email}>")); + emails.push(escape_email_with_display_name(name, email)); } (Some(name), None) => { names.push(name.as_str()); @@ -555,6 +555,23 @@ } } +/// Escape email addresses with display name if necessary +/// according to RFC 822 Section 3.3. "specials". +fn escape_email_with_display_name(display_name: &str, email: &str) -> String { + if display_name.chars().any(|c| { + matches!( + c, + '(' | ')' | '<' | '>' | '@' | ',' | ';' | ':' | '\\' | '"' | '.' | '[' | ']' + ) + }) { + return format!( + "\"{}\" <{email}>", + display_name.replace('\\', "\\\\").replace('\"', "\\\"") + ); + } + format!("{display_name} <{email}>") +} + /// Fold long header field according to RFC 5322 section 2.2.3 /// https://datatracker.ietf.org/doc/html/rfc5322#section-2.2.3 fn fold_header(text: &str) -> String { @@ -811,4 +828,43 @@ assert_eq!(metadata.license_files[2], manifest_dir.join("NOTICE.md")); assert_eq!(metadata.license_files[3], manifest_dir.join("AUTHORS.txt")); } + + #[test] + fn test_escape_email_with_display_name_without_special_characters() { + let display_name = "Foo Bar !#$%&'*+-/=?^_`{|}~ 123"; + let email = "foobar-...@example.com"; + let result = escape_email_with_display_name(display_name, email); + assert_eq!( + result, + "Foo Bar !#$%&'*+-/=?^_`{|}~ 123 <foobar-...@example.com>" + ); + } + + #[test] + fn test_escape_email_with_display_name_with_special_characters() { + let tests = [ + ("Foo ( Bar", "\"Foo ( Bar\""), + ("Foo ) Bar", "\"Foo ) Bar\""), + ("Foo < Bar", "\"Foo < Bar\""), + ("Foo > Bar", "\"Foo > Bar\""), + ("Foo @ Bar", "\"Foo @ Bar\""), + ("Foo , Bar", "\"Foo , Bar\""), + ("Foo ; Bar", "\"Foo ; Bar\""), + ("Foo : Bar", "\"Foo : Bar\""), + ("Foo \\ Bar", "\"Foo \\\\ Bar\""), + ("Foo \" Bar", "\"Foo \\\" Bar\""), + ("Foo . Bar", "\"Foo . Bar\""), + ("Foo [ Bar", "\"Foo [ Bar\""), + ("Foo ] Bar", "\"Foo ] Bar\""), + ("Foo ) Bar", "\"Foo ) Bar\""), + ("Foo ) Bar", "\"Foo ) Bar\""), + ("Foo, Bar", "\"Foo, Bar\""), + ]; + for (display_name, expected_name) in tests { + let email = "foobar-...@example.com"; + let result = escape_email_with_display_name(display_name, email); + let expected = format!("{expected_name} <{email}>"); + assert_eq!(result, expected); + } + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.3.1/src/module_writer.rs new/maturin-1.3.2/src/module_writer.rs --- old/maturin-1.3.1/src/module_writer.rs 2023-10-24 15:26:02.000000000 +0200 +++ new/maturin-1.3.2/src/module_writer.rs 2023-11-14 13:29:20.000000000 +0100 @@ -921,13 +921,6 @@ false }; - // Disallow library mode without UDL files for now - // Should be removed in https://github.com/PyO3/maturin/pull/1729 - // once uniffi release a new version - if is_library { - bail!("No UDL files found in {}", crate_dir.join("src").display()); - } - let mut cmd = uniffi_bindgen_command(crate_dir)?; cmd.current_dir(crate_dir); cmd.args([ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.3.1/src/source_distribution.rs new/maturin-1.3.2/src/source_distribution.rs --- old/maturin-1.3.1/src/source_distribution.rs 2023-10-24 15:26:02.000000000 +0200 +++ new/maturin-1.3.2/src/source_distribution.rs 2023-11-14 13:29:20.000000000 +0100 @@ -6,6 +6,7 @@ use fs_err as fs; use ignore::overrides::Override; use normpath::PathExt as _; +use path_slash::PathExt as _; use std::collections::HashMap; use std::path::{Path, PathBuf}; use std::process::Command; @@ -48,6 +49,7 @@ known_path_deps: &HashMap<String, PathDependency>, ) -> Result<String> { let manifest_path = manifest_path.as_ref(); + debug!("Rewriting Cargo.toml at {}", manifest_path.display()); let mut document = parse_toml_file(manifest_path, "Cargo.toml")?; // Update workspace members @@ -65,23 +67,24 @@ for member in members { if let toml_edit::Value::String(ref s) = member { let member_path = s.value(); - let path = Path::new(member_path); - if let Some(name) = path.file_name().and_then(|x| x.to_str()) { - // See https://github.com/rust-lang/cargo/blob/0de91c89e6479016d0ed8719fdc2947044335b36/src/cargo/util/restricted_names.rs#L119-L122 - let is_glob_pattern = name.contains(['*', '?', '[', ']']); - if is_glob_pattern { - let pattern = glob::Pattern::new(name).context(format!( + // See https://github.com/rust-lang/cargo/blob/0de91c89e6479016d0ed8719fdc2947044335b36/src/cargo/util/restricted_names.rs#L119-L122 + let is_glob_pattern = member_path.contains(['*', '?', '[', ']']); + if is_glob_pattern { + let pattern = glob::Pattern::new(member_path).with_context(|| { + format!( "Invalid `workspace.members` glob pattern: {} in {}", - name, + member_path, manifest_path.display() - ))?; - if known_path_deps - .keys() - .any(|path_dep| pattern.matches(path_dep)) - { - new_members.push(member_path); - } - } else if known_path_deps.contains_key(member_path) { + ) + })?; + if known_path_deps.values().any(|path_dep| { + let relative_path = path_dep + .manifest_path + .strip_prefix(&path_dep.workspace_root) + .unwrap(); + let relative_path_str = relative_path.to_str().unwrap(); + pattern.matches(relative_path_str) + }) { new_members.push(member_path); } } else if known_path_deps.contains_key(member_path) { @@ -147,6 +150,7 @@ prefix: impl AsRef<Path>, known_path_deps: &HashMap<String, PathDependency>, root_crate: bool, + skip_cargo_toml: bool, ) -> Result<()> { let manifest_path = manifest_path.as_ref(); let output = Command::new("cargo") @@ -215,7 +219,7 @@ if root_crate { let rewritten_cargo_toml = rewrite_cargo_toml(manifest_path, known_path_deps)?; writer.add_bytes(cargo_toml_path, rewritten_cargo_toml.as_bytes())?; - } else { + } else if !skip_cargo_toml { writer.add_file(cargo_toml_path, manifest_path)?; } @@ -344,6 +348,10 @@ let workspace_manifest_path = workspace_root.join("Cargo.toml"); let known_path_deps = find_path_deps(&build_context.cargo_metadata)?; + debug!( + "Found path dependencies: {:?}", + known_path_deps.keys().collect::<Vec<_>>() + ); let mut sdist_root = common_path_prefix(workspace_root.as_std_path(), pyproject_toml_path).unwrap(); for path_dep in known_path_deps.values() { @@ -360,21 +368,31 @@ // Add local path dependencies for (name, path_dep) in known_path_deps.iter() { + debug!( + "Adding path dependency: {} at {}", + name, + path_dep.manifest_path.display() + ); let path_dep_manifest_dir = path_dep.manifest_path.parent().unwrap(); let relative_path_dep_manifest_dir = path_dep_manifest_dir.strip_prefix(&sdist_root).unwrap(); + // we may need to rewrite workspace Cargo.toml later so don't add it to sdist yet + let skip_cargo_toml = workspace_manifest_path == path_dep.manifest_path; add_crate_to_source_distribution( writer, &path_dep.manifest_path, &root_dir.join(relative_path_dep_manifest_dir), &known_path_deps, false, + skip_cargo_toml, ) - .context(format!( - "Failed to add local dependency {} at {} to the source distribution", - name, - path_dep.manifest_path.display() - ))?; + .with_context(|| { + format!( + "Failed to add local dependency {} at {} to the source distribution", + name, + path_dep.manifest_path.display() + ) + })?; // Handle possible relative readme field in Cargo.toml if let Some(readme) = path_dep.readme.as_ref() { let abs_readme = path_dep_manifest_dir @@ -416,6 +434,7 @@ root_dir.join(relative_main_crate_manifest_dir), &known_path_deps, true, + false, )?; // Handle possible relative readme field in Cargo.toml if let Some(readme) = main_crate.readme.as_ref() { @@ -456,9 +475,9 @@ let mut deps_to_keep = known_path_deps.clone(); // Also need to the main Python binding crate let main_member_name = abs_manifest_dir - .strip_prefix(&sdist_root) + .strip_prefix(workspace_root) .unwrap() - .to_str() + .to_slash() .unwrap() .to_string(); deps_to_keep.insert( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-1.3.1/src/templates/Cargo.toml.j2 new/maturin-1.3.2/src/templates/Cargo.toml.j2 --- old/maturin-1.3.1/src/templates/Cargo.toml.j2 2023-10-24 15:26:02.000000000 +0200 +++ new/maturin-1.3.2/src/templates/Cargo.toml.j2 2023-11-14 13:29:20.000000000 +0100 @@ -16,8 +16,8 @@ {% elif bindings == "rust-cpython" -%} cpython = "0.7.1" {% elif bindings == "uniffi" -%} -uniffi = "0.24.1" +uniffi = "0.25.0" [build-dependencies] -uniffi = { version = "0.24.1", features = ["build"] } +uniffi = { version = "0.25.0", features = ["build"] } {% endif -%} ++++++ vendor.tar.xz ++++++ /work/SRC/openSUSE:Factory/python-maturin/vendor.tar.xz /work/SRC/openSUSE:Factory/.python-maturin.new.17445/vendor.tar.xz differ: char 27, line 1