maturin 1.3.1__tar.gz → 1.3.2__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 (58) hide show
  1. {maturin-1.3.1 → maturin-1.3.2}/.cirrus.yml +2 -2
  2. {maturin-1.3.1 → maturin-1.3.2}/.pre-commit-config.yaml +3 -6
  3. {maturin-1.3.1 → maturin-1.3.2}/Cargo.lock +31 -112
  4. {maturin-1.3.1 → maturin-1.3.2}/Cargo.toml +7 -6
  5. {maturin-1.3.1 → maturin-1.3.2}/Changelog.md +11 -1
  6. {maturin-1.3.1 → maturin-1.3.2}/PKG-INFO +1 -1
  7. {maturin-1.3.1 → maturin-1.3.2}/maturin/__init__.py +8 -28
  8. {maturin-1.3.1 → maturin-1.3.2}/maturin/import_hook.py +5 -16
  9. {maturin-1.3.1 → maturin-1.3.2}/setup.py +1 -3
  10. {maturin-1.3.1 → maturin-1.3.2}/src/metadata.rs +58 -2
  11. {maturin-1.3.1 → maturin-1.3.2}/src/module_writer.rs +0 -7
  12. {maturin-1.3.1 → maturin-1.3.2}/src/source_distribution.rs +42 -23
  13. {maturin-1.3.1 → maturin-1.3.2}/src/templates/Cargo.toml.j2 +2 -2
  14. {maturin-1.3.1 → maturin-1.3.2}/.codespellrc +0 -0
  15. {maturin-1.3.1 → maturin-1.3.2}/.config/nextest.toml +0 -0
  16. {maturin-1.3.1 → maturin-1.3.2}/.gitignore +0 -0
  17. {maturin-1.3.1 → maturin-1.3.2}/MANIFEST.in +0 -0
  18. {maturin-1.3.1 → maturin-1.3.2}/README.md +0 -0
  19. {maturin-1.3.1 → maturin-1.3.2}/clippy.toml +0 -0
  20. {maturin-1.3.1 → maturin-1.3.2}/license-apache +0 -0
  21. {maturin-1.3.1 → maturin-1.3.2}/license-mit +0 -0
  22. {maturin-1.3.1 → maturin-1.3.2}/maturin/__main__.py +0 -0
  23. {maturin-1.3.1 → maturin-1.3.2}/netlify.toml +0 -0
  24. {maturin-1.3.1 → maturin-1.3.2}/pyproject.toml +0 -0
  25. {maturin-1.3.1 → maturin-1.3.2}/src/auditwheel/audit.rs +0 -0
  26. {maturin-1.3.1 → maturin-1.3.2}/src/auditwheel/manylinux-policy.json +0 -0
  27. {maturin-1.3.1 → maturin-1.3.2}/src/auditwheel/mod.rs +0 -0
  28. {maturin-1.3.1 → maturin-1.3.2}/src/auditwheel/musllinux-policy.json +0 -0
  29. {maturin-1.3.1 → maturin-1.3.2}/src/auditwheel/musllinux.rs +0 -0
  30. {maturin-1.3.1 → maturin-1.3.2}/src/auditwheel/patchelf.rs +0 -0
  31. {maturin-1.3.1 → maturin-1.3.2}/src/auditwheel/platform_tag.rs +0 -0
  32. {maturin-1.3.1 → maturin-1.3.2}/src/auditwheel/policy.rs +0 -0
  33. {maturin-1.3.1 → maturin-1.3.2}/src/auditwheel/repair.rs +0 -0
  34. {maturin-1.3.1 → maturin-1.3.2}/src/build_context.rs +0 -0
  35. {maturin-1.3.1 → maturin-1.3.2}/src/build_options.rs +0 -0
  36. {maturin-1.3.1 → maturin-1.3.2}/src/cargo_toml.rs +0 -0
  37. {maturin-1.3.1 → maturin-1.3.2}/src/ci.rs +0 -0
  38. {maturin-1.3.1 → maturin-1.3.2}/src/compile.rs +0 -0
  39. {maturin-1.3.1 → maturin-1.3.2}/src/cross_compile.rs +0 -0
  40. {maturin-1.3.1 → maturin-1.3.2}/src/develop.rs +0 -0
  41. {maturin-1.3.1 → maturin-1.3.2}/src/lib.rs +0 -0
  42. {maturin-1.3.1 → maturin-1.3.2}/src/main.rs +0 -0
  43. {maturin-1.3.1 → maturin-1.3.2}/src/new_project.rs +0 -0
  44. {maturin-1.3.1 → maturin-1.3.2}/src/project_layout.rs +0 -0
  45. {maturin-1.3.1 → maturin-1.3.2}/src/pyproject_toml.rs +0 -0
  46. {maturin-1.3.1 → maturin-1.3.2}/src/python_interpreter/config.rs +0 -0
  47. {maturin-1.3.1 → maturin-1.3.2}/src/python_interpreter/get_interpreter_metadata.py +0 -0
  48. {maturin-1.3.1 → maturin-1.3.2}/src/python_interpreter/mod.rs +0 -0
  49. {maturin-1.3.1 → maturin-1.3.2}/src/target.rs +0 -0
  50. {maturin-1.3.1 → maturin-1.3.2}/src/templates/.gitignore.j2 +0 -0
  51. {maturin-1.3.1 → maturin-1.3.2}/src/templates/__init__.py.j2 +0 -0
  52. {maturin-1.3.1 → maturin-1.3.2}/src/templates/build.rs.j2 +0 -0
  53. {maturin-1.3.1 → maturin-1.3.2}/src/templates/example.udl.j2 +0 -0
  54. {maturin-1.3.1 → maturin-1.3.2}/src/templates/lib.rs.j2 +0 -0
  55. {maturin-1.3.1 → maturin-1.3.2}/src/templates/main.rs.j2 +0 -0
  56. {maturin-1.3.1 → maturin-1.3.2}/src/templates/pyproject.toml.j2 +0 -0
  57. {maturin-1.3.1 → maturin-1.3.2}/src/templates/test_all.py.j2 +0 -0
  58. {maturin-1.3.1 → maturin-1.3.2}/src/upload.rs +0 -0
@@ -45,7 +45,7 @@ macos_arm64_task:
45
45
  - cat Cargo.lock
46
46
  install_script:
47
47
  - brew install python3
48
- - python3 -m pip install uniffi-bindgen==0.24.1
48
+ - python3 -m pip install uniffi-bindgen==0.25.0
49
49
  <<: *BUILD_AND_TEST
50
50
 
51
51
  linux_aarch64_task:
@@ -62,5 +62,5 @@ linux_aarch64_task:
62
62
  - echo $CIRRUS_OS
63
63
  - cat Cargo.lock
64
64
  install_script:
65
- - python3 -m pip install uniffi-bindgen==0.24.1
65
+ - python3 -m pip install uniffi-bindgen==0.25.0
66
66
  <<: *BUILD_AND_TEST
@@ -55,16 +55,13 @@ repos:
55
55
  (.*\.stdout)
56
56
  )
57
57
  - id: mixed-line-ending
58
- - repo: https://github.com/psf/black
59
- rev: 23.10.0
60
- hooks:
61
- - id: black
62
58
  - repo: https://github.com/astral-sh/ruff-pre-commit
63
- rev: v0.1.1
59
+ rev: v0.1.5
64
60
  hooks:
61
+ - id: ruff-format
65
62
  - id: ruff
66
63
  - repo: https://github.com/pre-commit/mirrors-mypy
67
- rev: v1.6.1
64
+ rev: v1.7.0
68
65
  hooks:
69
66
  - id: mypy
70
67
  entry: mypy maturin/
@@ -10,9 +10,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
10
10
 
11
11
  [[package]]
12
12
  name = "ahash"
13
- version = "0.7.6"
13
+ version = "0.7.7"
14
14
  source = "registry+https://github.com/rust-lang/crates.io-index"
15
- checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
15
+ checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd"
16
16
  dependencies = [
17
17
  "getrandom",
18
18
  "once_cell",
@@ -126,12 +126,6 @@ dependencies = [
126
126
  "serde",
127
127
  ]
128
128
 
129
- [[package]]
130
- name = "bumpalo"
131
- version = "3.13.0"
132
- source = "registry+https://github.com/rust-lang/crates.io-index"
133
- checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1"
134
-
135
129
  [[package]]
136
130
  name = "byteorder"
137
131
  version = "1.4.3"
@@ -246,9 +240,9 @@ dependencies = [
246
240
 
247
241
  [[package]]
248
242
  name = "cargo-zigbuild"
249
- version = "0.17.3"
243
+ version = "0.17.5"
250
244
  source = "registry+https://github.com/rust-lang/crates.io-index"
251
- checksum = "2307bb523befb01f7e8cf299c2219439339316964c3a4e95e29bd1c7831fae89"
245
+ checksum = "d5166694ea85c72f887293af72a665d7ac5a537649e607773bf834cb6303b1da"
252
246
  dependencies = [
253
247
  "anyhow",
254
248
  "cargo-options",
@@ -282,9 +276,9 @@ dependencies = [
282
276
 
283
277
  [[package]]
284
278
  name = "cbindgen"
285
- version = "0.25.0"
279
+ version = "0.26.0"
286
280
  source = "registry+https://github.com/rust-lang/crates.io-index"
287
- checksum = "faeaa693e5a727975a79211b8f35c0cb09b031fdb6eaa4a788bc6713d01488ca"
281
+ checksum = "da6bc11b07529f16944307272d5bd9b22530bc7d05751717c9d416586cedab49"
288
282
  dependencies = [
289
283
  "heck",
290
284
  "indexmap",
@@ -576,12 +570,13 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
576
570
 
577
571
  [[package]]
578
572
  name = "dialoguer"
579
- version = "0.10.4"
573
+ version = "0.11.0"
580
574
  source = "registry+https://github.com/rust-lang/crates.io-index"
581
- checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87"
575
+ checksum = "658bce805d770f407bc62102fca7c2c64ceef2fbcb2b8bd19d2765ce093980de"
582
576
  dependencies = [
583
577
  "console",
584
578
  "shell-words",
579
+ "thiserror",
585
580
  "zeroize",
586
581
  ]
587
582
 
@@ -963,15 +958,6 @@ version = "1.0.9"
963
958
  source = "registry+https://github.com/rust-lang/crates.io-index"
964
959
  checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
965
960
 
966
- [[package]]
967
- name = "js-sys"
968
- version = "0.3.64"
969
- source = "registry+https://github.com/rust-lang/crates.io-index"
970
- checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a"
971
- dependencies = [
972
- "wasm-bindgen",
973
- ]
974
-
975
961
  [[package]]
976
962
  name = "keyring"
977
963
  version = "2.0.5"
@@ -1068,7 +1054,7 @@ dependencies = [
1068
1054
 
1069
1055
  [[package]]
1070
1056
  name = "maturin"
1071
- version = "1.3.1"
1057
+ version = "1.3.2"
1072
1058
  dependencies = [
1073
1059
  "anyhow",
1074
1060
  "base64 0.21.2",
@@ -1104,6 +1090,7 @@ dependencies = [
1104
1090
  "native-tls",
1105
1091
  "normpath",
1106
1092
  "once_cell",
1093
+ "path-slash",
1107
1094
  "pep440_rs",
1108
1095
  "pep508_rs",
1109
1096
  "platform-info",
@@ -1672,17 +1659,16 @@ dependencies = [
1672
1659
 
1673
1660
  [[package]]
1674
1661
  name = "ring"
1675
- version = "0.16.20"
1662
+ version = "0.17.3"
1676
1663
  source = "registry+https://github.com/rust-lang/crates.io-index"
1677
- checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc"
1664
+ checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e"
1678
1665
  dependencies = [
1679
1666
  "cc",
1667
+ "getrandom",
1680
1668
  "libc",
1681
- "once_cell",
1682
1669
  "spin",
1683
1670
  "untrusted",
1684
- "web-sys",
1685
- "winapi",
1671
+ "windows-sys 0.48.0",
1686
1672
  ]
1687
1673
 
1688
1674
  [[package]]
@@ -1710,9 +1696,9 @@ dependencies = [
1710
1696
 
1711
1697
  [[package]]
1712
1698
  name = "rustls"
1713
- version = "0.21.2"
1699
+ version = "0.21.8"
1714
1700
  source = "registry+https://github.com/rust-lang/crates.io-index"
1715
- checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f"
1701
+ checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c"
1716
1702
  dependencies = [
1717
1703
  "log",
1718
1704
  "ring",
@@ -1731,9 +1717,9 @@ dependencies = [
1731
1717
 
1732
1718
  [[package]]
1733
1719
  name = "rustls-webpki"
1734
- version = "0.100.2"
1720
+ version = "0.101.7"
1735
1721
  source = "registry+https://github.com/rust-lang/crates.io-index"
1736
- checksum = "e98ff011474fa39949b7e5c0428f9b4937eda7da7848bbb947786b7be0b27dab"
1722
+ checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765"
1737
1723
  dependencies = [
1738
1724
  "ring",
1739
1725
  "untrusted",
@@ -1797,9 +1783,9 @@ dependencies = [
1797
1783
 
1798
1784
  [[package]]
1799
1785
  name = "sct"
1800
- version = "0.7.0"
1786
+ version = "0.7.1"
1801
1787
  source = "registry+https://github.com/rust-lang/crates.io-index"
1802
- checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4"
1788
+ checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414"
1803
1789
  dependencies = [
1804
1790
  "ring",
1805
1791
  "untrusted",
@@ -1977,9 +1963,9 @@ dependencies = [
1977
1963
 
1978
1964
  [[package]]
1979
1965
  name = "spin"
1980
- version = "0.5.2"
1966
+ version = "0.9.8"
1981
1967
  source = "registry+https://github.com/rust-lang/crates.io-index"
1982
- checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
1968
+ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
1983
1969
 
1984
1970
  [[package]]
1985
1971
  name = "stacker"
@@ -2356,15 +2342,15 @@ checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
2356
2342
 
2357
2343
  [[package]]
2358
2344
  name = "untrusted"
2359
- version = "0.7.1"
2345
+ version = "0.9.0"
2360
2346
  source = "registry+https://github.com/rust-lang/crates.io-index"
2361
- checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
2347
+ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
2362
2348
 
2363
2349
  [[package]]
2364
2350
  name = "ureq"
2365
- version = "2.7.1"
2351
+ version = "2.8.0"
2366
2352
  source = "registry+https://github.com/rust-lang/crates.io-index"
2367
- checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9"
2353
+ checksum = "f5ccd538d4a604753ebc2f17cd9946e89b77bf87f6a8e2309667c6f2e87855e3"
2368
2354
  dependencies = [
2369
2355
  "base64 0.21.2",
2370
2356
  "flate2",
@@ -2382,9 +2368,9 @@ dependencies = [
2382
2368
 
2383
2369
  [[package]]
2384
2370
  name = "url"
2385
- version = "2.4.0"
2371
+ version = "2.4.1"
2386
2372
  source = "registry+https://github.com/rust-lang/crates.io-index"
2387
- checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb"
2373
+ checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5"
2388
2374
  dependencies = [
2389
2375
  "form_urlencoded",
2390
2376
  "idna",
@@ -2457,78 +2443,11 @@ version = "0.11.0+wasi-snapshot-preview1"
2457
2443
  source = "registry+https://github.com/rust-lang/crates.io-index"
2458
2444
  checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
2459
2445
 
2460
- [[package]]
2461
- name = "wasm-bindgen"
2462
- version = "0.2.87"
2463
- source = "registry+https://github.com/rust-lang/crates.io-index"
2464
- checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342"
2465
- dependencies = [
2466
- "cfg-if",
2467
- "wasm-bindgen-macro",
2468
- ]
2469
-
2470
- [[package]]
2471
- name = "wasm-bindgen-backend"
2472
- version = "0.2.87"
2473
- source = "registry+https://github.com/rust-lang/crates.io-index"
2474
- checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd"
2475
- dependencies = [
2476
- "bumpalo",
2477
- "log",
2478
- "once_cell",
2479
- "proc-macro2",
2480
- "quote",
2481
- "syn 2.0.29",
2482
- "wasm-bindgen-shared",
2483
- ]
2484
-
2485
- [[package]]
2486
- name = "wasm-bindgen-macro"
2487
- version = "0.2.87"
2488
- source = "registry+https://github.com/rust-lang/crates.io-index"
2489
- checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d"
2490
- dependencies = [
2491
- "quote",
2492
- "wasm-bindgen-macro-support",
2493
- ]
2494
-
2495
- [[package]]
2496
- name = "wasm-bindgen-macro-support"
2497
- version = "0.2.87"
2498
- source = "registry+https://github.com/rust-lang/crates.io-index"
2499
- checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
2500
- dependencies = [
2501
- "proc-macro2",
2502
- "quote",
2503
- "syn 2.0.29",
2504
- "wasm-bindgen-backend",
2505
- "wasm-bindgen-shared",
2506
- ]
2507
-
2508
- [[package]]
2509
- name = "wasm-bindgen-shared"
2510
- version = "0.2.87"
2511
- source = "registry+https://github.com/rust-lang/crates.io-index"
2512
- checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1"
2513
-
2514
- [[package]]
2515
- name = "web-sys"
2516
- version = "0.3.64"
2517
- source = "registry+https://github.com/rust-lang/crates.io-index"
2518
- checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b"
2519
- dependencies = [
2520
- "js-sys",
2521
- "wasm-bindgen",
2522
- ]
2523
-
2524
2446
  [[package]]
2525
2447
  name = "webpki-roots"
2526
- version = "0.23.1"
2448
+ version = "0.25.2"
2527
2449
  source = "registry+https://github.com/rust-lang/crates.io-index"
2528
- checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338"
2529
- dependencies = [
2530
- "rustls-webpki",
2531
- ]
2450
+ checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc"
2532
2451
 
2533
2452
  [[package]]
2534
2453
  name = "which"
@@ -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.3.1"
4
+ version = "1.3.2"
5
5
  description = "Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries as python packages"
6
6
  exclude = [
7
7
  "test-crates/**/*",
@@ -41,7 +41,7 @@ glob = "0.3.0"
41
41
  cargo-config2 = "0.1.9"
42
42
  cargo_metadata = "0.18.0"
43
43
  cargo-options = "0.6.0"
44
- cbindgen = { version = "0.25.0", default-features = false }
44
+ cbindgen = { version = "0.26.0", default-features = false }
45
45
  flate2 = "1.0.18"
46
46
  goblin = "0.7.1"
47
47
  platform-info = "2.0.2"
@@ -71,6 +71,7 @@ lddtree = "0.3.3"
71
71
  cc = "1.0.72"
72
72
  dunce = "1.0.2"
73
73
  normpath = "1.0.0"
74
+ path-slash = "0.2.1"
74
75
  pep440_rs = { version = "0.3.6", features = ["serde"] }
75
76
  pep508_rs = { version = "0.2.1", features = ["serde"] }
76
77
  time = "0.3.17"
@@ -80,7 +81,7 @@ clap = { version = "4.0.0", features = ["derive", "env", "wrap_help"] }
80
81
  clap_complete_command = { version = "0.5.1", optional = true }
81
82
 
82
83
  # cross compile
83
- cargo-zigbuild = { version = "0.17.3", default-features = false, optional = true }
84
+ cargo-zigbuild = { version = "0.17.5", default-features = false, optional = true }
84
85
  cargo-xwin = { version = "0.14.7", default-features = false, optional = true }
85
86
 
86
87
  # log
@@ -88,7 +89,7 @@ tracing = "0.1.36"
88
89
  tracing-subscriber = { version = "0.3.15", features = ["env-filter"], optional = true }
89
90
 
90
91
  # project scaffolding, maturin new/init/generate-ci
91
- dialoguer = { version = "0.10.2", default-features = false, optional = true }
92
+ dialoguer = { version = "0.11.0", default-features = false, optional = true }
92
93
  console = { version = "0.15.4", optional = true }
93
94
  minijinja = { version = "1.0.7", optional = true }
94
95
 
@@ -99,11 +100,11 @@ dirs = { version = "5.0.0", optional = true }
99
100
  multipart = { version = "0.18.0", features = ["client"], default-features = false, optional = true }
100
101
  ureq = { version = "2.7.0", features = ["gzip", "json", "socks-proxy"], default-features = false, optional = true }
101
102
  native-tls = { version = "0.2.8", optional = true }
102
- rustls = { version = "0.21.2", optional = true }
103
+ rustls = { version = "0.21.8", optional = true }
103
104
  rustls-pemfile = { version = "1.0.1", optional = true }
104
105
  keyring = { version = "2.0.0", default-features = false, features = ["linux-no-secret-service"], optional = true }
105
106
  wild = { version = "2.1.0", optional = true }
106
- url = { version = "2.3.1", optional = true }
107
+ url = { version = "2.4.1", optional = true }
107
108
 
108
109
  [dev-dependencies]
109
110
  expect-test = "1.4.1"
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.3.2] - 2023-11-14
11
+
12
+ * Add support for uniffi library mode in [#1729](https://github.com/PyO3/maturin/pull/1729)
13
+ * Un-deprecate `MATURIN_PEP517_ARGS` env var in [#1820](https://github.com/PyO3/maturin/pull/1820)
14
+ * Fix missing member in Cargo.toml for sdist of nested workspace layout in [#1828](https://github.com/PyO3/maturin/pull/1828)
15
+ * Escape display name in email addresses of wheel metadata in [#1832](https://github.com/PyO3/maturin/pull/1832)
16
+ * Fix rewriting workspace Cargo.toml in sdist in [#1841](https://github.com/PyO3/maturin/pull/1841)
17
+ * Fix glob workspace members matching in sdist in [#1846](https://github.com/PyO3/maturin/pull/1846)
18
+
10
19
  ## [1.3.1] - 2023-10-24
11
20
 
12
21
  * Use external `uniffi-bindgen` if no root package is configured in [#1797](https://github.com/PyO3/maturin/pull/1797)
@@ -927,7 +936,8 @@ points-0.1.0-py2.py3-none-manylinux1_x86_64.whl | 2,8M | 752K | 85K
927
936
 
928
937
  * Initial Release
929
938
 
930
- [Unreleased]: https://github.com/pyo3/maturin/compare/v1.3.1...HEAD
939
+ [Unreleased]: https://github.com/pyo3/maturin/compare/v1.3.2...HEAD
940
+ [1.3.2]: https://github.com/pyo3/maturin/compare/v1.3.1...v1.3.2
931
941
  [1.3.1]: https://github.com/pyo3/maturin/compare/v1.3.0...v1.3.1
932
942
  [1.3.0]: https://github.com/pyo3/maturin/compare/v1.2.3...v1.3.0
933
943
  [1.2.3]: https://github.com/pyo3/maturin/compare/v1.2.2...v1.2.3
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: maturin
3
- Version: 1.3.1
3
+ Version: 1.3.2
4
4
  Classifier: Topic :: Software Development :: Build Tools
5
5
  Classifier: Programming Language :: Rust
6
6
  Classifier: Programming Language :: Python :: Implementation :: CPython
@@ -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):
@@ -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
 
@@ -64,9 +64,7 @@ setup(
64
64
  python_requires=">=3.7",
65
65
  cmdclass={"bdist_wheel": bdist_wheel},
66
66
  packages=["maturin"],
67
- rust_extensions=[
68
- RustBin("maturin", args=cargo_args, cargo_manifest_args=["--locked"])
69
- ],
67
+ rust_extensions=[RustBin("maturin", args=cargo_args, cargo_manifest_args=["--locked"])],
70
68
  classifiers=[
71
69
  "Topic :: Software Development :: Build Tools",
72
70
  "Programming Language :: Rust",
@@ -226,7 +226,7 @@ impl Metadata21 {
226
226
  for author in authors {
227
227
  match (&author.name, &author.email) {
228
228
  (Some(name), Some(email)) => {
229
- emails.push(format!("{name} <{email}>"));
229
+ emails.push(escape_email_with_display_name(name, email));
230
230
  }
231
231
  (Some(name), None) => {
232
232
  names.push(name.as_str());
@@ -251,7 +251,7 @@ impl Metadata21 {
251
251
  for maintainer in maintainers {
252
252
  match (&maintainer.name, &maintainer.email) {
253
253
  (Some(name), Some(email)) => {
254
- emails.push(format!("{name} <{email}>"));
254
+ emails.push(escape_email_with_display_name(name, email));
255
255
  }
256
256
  (Some(name), None) => {
257
257
  names.push(name.as_str());
@@ -555,6 +555,23 @@ impl Metadata21 {
555
555
  }
556
556
  }
557
557
 
558
+ /// Escape email addresses with display name if necessary
559
+ /// according to RFC 822 Section 3.3. "specials".
560
+ fn escape_email_with_display_name(display_name: &str, email: &str) -> String {
561
+ if display_name.chars().any(|c| {
562
+ matches!(
563
+ c,
564
+ '(' | ')' | '<' | '>' | '@' | ',' | ';' | ':' | '\\' | '"' | '.' | '[' | ']'
565
+ )
566
+ }) {
567
+ return format!(
568
+ "\"{}\" <{email}>",
569
+ display_name.replace('\\', "\\\\").replace('\"', "\\\"")
570
+ );
571
+ }
572
+ format!("{display_name} <{email}>")
573
+ }
574
+
558
575
  /// Fold long header field according to RFC 5322 section 2.2.3
559
576
  /// https://datatracker.ietf.org/doc/html/rfc5322#section-2.2.3
560
577
  fn fold_header(text: &str) -> String {
@@ -811,4 +828,43 @@ mod test {
811
828
  assert_eq!(metadata.license_files[2], manifest_dir.join("NOTICE.md"));
812
829
  assert_eq!(metadata.license_files[3], manifest_dir.join("AUTHORS.txt"));
813
830
  }
831
+
832
+ #[test]
833
+ fn test_escape_email_with_display_name_without_special_characters() {
834
+ let display_name = "Foo Bar !#$%&'*+-/=?^_`{|}~ 123";
835
+ let email = "foobar-123@example.com";
836
+ let result = escape_email_with_display_name(display_name, email);
837
+ assert_eq!(
838
+ result,
839
+ "Foo Bar !#$%&'*+-/=?^_`{|}~ 123 <foobar-123@example.com>"
840
+ );
841
+ }
842
+
843
+ #[test]
844
+ fn test_escape_email_with_display_name_with_special_characters() {
845
+ let tests = [
846
+ ("Foo ( Bar", "\"Foo ( Bar\""),
847
+ ("Foo ) Bar", "\"Foo ) Bar\""),
848
+ ("Foo < Bar", "\"Foo < Bar\""),
849
+ ("Foo > Bar", "\"Foo > Bar\""),
850
+ ("Foo @ Bar", "\"Foo @ Bar\""),
851
+ ("Foo , Bar", "\"Foo , Bar\""),
852
+ ("Foo ; Bar", "\"Foo ; Bar\""),
853
+ ("Foo : Bar", "\"Foo : Bar\""),
854
+ ("Foo \\ Bar", "\"Foo \\\\ Bar\""),
855
+ ("Foo \" Bar", "\"Foo \\\" Bar\""),
856
+ ("Foo . Bar", "\"Foo . Bar\""),
857
+ ("Foo [ Bar", "\"Foo [ Bar\""),
858
+ ("Foo ] Bar", "\"Foo ] Bar\""),
859
+ ("Foo ) Bar", "\"Foo ) Bar\""),
860
+ ("Foo ) Bar", "\"Foo ) Bar\""),
861
+ ("Foo, Bar", "\"Foo, Bar\""),
862
+ ];
863
+ for (display_name, expected_name) in tests {
864
+ let email = "foobar-123@example.com";
865
+ let result = escape_email_with_display_name(display_name, email);
866
+ let expected = format!("{expected_name} <{email}>");
867
+ assert_eq!(result, expected);
868
+ }
869
+ }
814
870
  }
@@ -921,13 +921,6 @@ fn generate_uniffi_bindings(
921
921
  false
922
922
  };
923
923
 
924
- // Disallow library mode without UDL files for now
925
- // Should be removed in https://github.com/PyO3/maturin/pull/1729
926
- // once uniffi release a new version
927
- if is_library {
928
- bail!("No UDL files found in {}", crate_dir.join("src").display());
929
- }
930
-
931
924
  let mut cmd = uniffi_bindgen_command(crate_dir)?;
932
925
  cmd.current_dir(crate_dir);
933
926
  cmd.args([
@@ -6,6 +6,7 @@ use cargo_metadata::{Metadata, MetadataCommand};
6
6
  use fs_err as fs;
7
7
  use ignore::overrides::Override;
8
8
  use normpath::PathExt as _;
9
+ use path_slash::PathExt as _;
9
10
  use std::collections::HashMap;
10
11
  use std::path::{Path, PathBuf};
11
12
  use std::process::Command;
@@ -48,6 +49,7 @@ fn rewrite_cargo_toml(
48
49
  known_path_deps: &HashMap<String, PathDependency>,
49
50
  ) -> Result<String> {
50
51
  let manifest_path = manifest_path.as_ref();
52
+ debug!("Rewriting Cargo.toml at {}", manifest_path.display());
51
53
  let mut document = parse_toml_file(manifest_path, "Cargo.toml")?;
52
54
 
53
55
  // Update workspace members
@@ -65,23 +67,24 @@ fn rewrite_cargo_toml(
65
67
  for member in members {
66
68
  if let toml_edit::Value::String(ref s) = member {
67
69
  let member_path = s.value();
68
- let path = Path::new(member_path);
69
- if let Some(name) = path.file_name().and_then(|x| x.to_str()) {
70
- // See https://github.com/rust-lang/cargo/blob/0de91c89e6479016d0ed8719fdc2947044335b36/src/cargo/util/restricted_names.rs#L119-L122
71
- let is_glob_pattern = name.contains(['*', '?', '[', ']']);
72
- if is_glob_pattern {
73
- let pattern = glob::Pattern::new(name).context(format!(
70
+ // See https://github.com/rust-lang/cargo/blob/0de91c89e6479016d0ed8719fdc2947044335b36/src/cargo/util/restricted_names.rs#L119-L122
71
+ let is_glob_pattern = member_path.contains(['*', '?', '[', ']']);
72
+ if is_glob_pattern {
73
+ let pattern = glob::Pattern::new(member_path).with_context(|| {
74
+ format!(
74
75
  "Invalid `workspace.members` glob pattern: {} in {}",
75
- name,
76
+ member_path,
76
77
  manifest_path.display()
77
- ))?;
78
- if known_path_deps
79
- .keys()
80
- .any(|path_dep| pattern.matches(path_dep))
81
- {
82
- new_members.push(member_path);
83
- }
84
- } else if known_path_deps.contains_key(member_path) {
78
+ )
79
+ })?;
80
+ if known_path_deps.values().any(|path_dep| {
81
+ let relative_path = path_dep
82
+ .manifest_path
83
+ .strip_prefix(&path_dep.workspace_root)
84
+ .unwrap();
85
+ let relative_path_str = relative_path.to_str().unwrap();
86
+ pattern.matches(relative_path_str)
87
+ }) {
85
88
  new_members.push(member_path);
86
89
  }
87
90
  } else if known_path_deps.contains_key(member_path) {
@@ -147,6 +150,7 @@ fn add_crate_to_source_distribution(
147
150
  prefix: impl AsRef<Path>,
148
151
  known_path_deps: &HashMap<String, PathDependency>,
149
152
  root_crate: bool,
153
+ skip_cargo_toml: bool,
150
154
  ) -> Result<()> {
151
155
  let manifest_path = manifest_path.as_ref();
152
156
  let output = Command::new("cargo")
@@ -215,7 +219,7 @@ fn add_crate_to_source_distribution(
215
219
  if root_crate {
216
220
  let rewritten_cargo_toml = rewrite_cargo_toml(manifest_path, known_path_deps)?;
217
221
  writer.add_bytes(cargo_toml_path, rewritten_cargo_toml.as_bytes())?;
218
- } else {
222
+ } else if !skip_cargo_toml {
219
223
  writer.add_file(cargo_toml_path, manifest_path)?;
220
224
  }
221
225
 
@@ -344,6 +348,10 @@ fn add_cargo_package_files_to_sdist(
344
348
  let workspace_manifest_path = workspace_root.join("Cargo.toml");
345
349
 
346
350
  let known_path_deps = find_path_deps(&build_context.cargo_metadata)?;
351
+ debug!(
352
+ "Found path dependencies: {:?}",
353
+ known_path_deps.keys().collect::<Vec<_>>()
354
+ );
347
355
  let mut sdist_root =
348
356
  common_path_prefix(workspace_root.as_std_path(), pyproject_toml_path).unwrap();
349
357
  for path_dep in known_path_deps.values() {
@@ -360,21 +368,31 @@ fn add_cargo_package_files_to_sdist(
360
368
 
361
369
  // Add local path dependencies
362
370
  for (name, path_dep) in known_path_deps.iter() {
371
+ debug!(
372
+ "Adding path dependency: {} at {}",
373
+ name,
374
+ path_dep.manifest_path.display()
375
+ );
363
376
  let path_dep_manifest_dir = path_dep.manifest_path.parent().unwrap();
364
377
  let relative_path_dep_manifest_dir =
365
378
  path_dep_manifest_dir.strip_prefix(&sdist_root).unwrap();
379
+ // we may need to rewrite workspace Cargo.toml later so don't add it to sdist yet
380
+ let skip_cargo_toml = workspace_manifest_path == path_dep.manifest_path;
366
381
  add_crate_to_source_distribution(
367
382
  writer,
368
383
  &path_dep.manifest_path,
369
384
  &root_dir.join(relative_path_dep_manifest_dir),
370
385
  &known_path_deps,
371
386
  false,
387
+ skip_cargo_toml,
372
388
  )
373
- .context(format!(
374
- "Failed to add local dependency {} at {} to the source distribution",
375
- name,
376
- path_dep.manifest_path.display()
377
- ))?;
389
+ .with_context(|| {
390
+ format!(
391
+ "Failed to add local dependency {} at {} to the source distribution",
392
+ name,
393
+ path_dep.manifest_path.display()
394
+ )
395
+ })?;
378
396
  // Handle possible relative readme field in Cargo.toml
379
397
  if let Some(readme) = path_dep.readme.as_ref() {
380
398
  let abs_readme = path_dep_manifest_dir
@@ -416,6 +434,7 @@ fn add_cargo_package_files_to_sdist(
416
434
  root_dir.join(relative_main_crate_manifest_dir),
417
435
  &known_path_deps,
418
436
  true,
437
+ false,
419
438
  )?;
420
439
  // Handle possible relative readme field in Cargo.toml
421
440
  if let Some(readme) = main_crate.readme.as_ref() {
@@ -456,9 +475,9 @@ fn add_cargo_package_files_to_sdist(
456
475
  let mut deps_to_keep = known_path_deps.clone();
457
476
  // Also need to the main Python binding crate
458
477
  let main_member_name = abs_manifest_dir
459
- .strip_prefix(&sdist_root)
478
+ .strip_prefix(workspace_root)
460
479
  .unwrap()
461
- .to_str()
480
+ .to_slash()
462
481
  .unwrap()
463
482
  .to_string();
464
483
  deps_to_keep.insert(
@@ -16,8 +16,8 @@ pyo3 = "0.19.0"
16
16
  {% elif bindings == "rust-cpython" -%}
17
17
  cpython = "0.7.1"
18
18
  {% elif bindings == "uniffi" -%}
19
- uniffi = "0.24.1"
19
+ uniffi = "0.25.0"
20
20
 
21
21
  [build-dependencies]
22
- uniffi = { version = "0.24.1", features = ["build"] }
22
+ uniffi = { version = "0.25.0", features = ["build"] }
23
23
  {% endif -%}
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