maturin 1.9.3__tar.gz → 1.9.5__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 (64) hide show
  1. {maturin-1.9.3 → maturin-1.9.5}/.pre-commit-config.yaml +3 -3
  2. {maturin-1.9.3 → maturin-1.9.5}/Cargo.lock +114 -44
  3. {maturin-1.9.3 → maturin-1.9.5}/Cargo.toml +4 -4
  4. {maturin-1.9.3 → maturin-1.9.5}/Changelog.md +16 -2
  5. {maturin-1.9.3 → maturin-1.9.5}/PKG-INFO +3 -1
  6. {maturin-1.9.3 → maturin-1.9.5}/README.md +1 -0
  7. {maturin-1.9.3 → maturin-1.9.5}/maturin/__init__.py +1 -1
  8. {maturin-1.9.3 → maturin-1.9.5}/maturin.schema.json +5 -0
  9. {maturin-1.9.3 → maturin-1.9.5}/pyproject.toml +1 -0
  10. {maturin-1.9.3 → maturin-1.9.5}/src/build_context.rs +10 -3
  11. {maturin-1.9.3 → maturin-1.9.5}/src/compile.rs +5 -0
  12. {maturin-1.9.3 → maturin-1.9.5}/src/cross_compile.rs +3 -1
  13. {maturin-1.9.3 → maturin-1.9.5}/src/module_writer.rs +1 -1
  14. {maturin-1.9.3 → maturin-1.9.5}/src/pyproject_toml.rs +7 -0
  15. {maturin-1.9.3 → maturin-1.9.5}/src/python_interpreter/config.rs +48 -2
  16. {maturin-1.9.3 → maturin-1.9.5}/src/python_interpreter/mod.rs +212 -66
  17. {maturin-1.9.3 → maturin-1.9.5}/src/target/mod.rs +1 -1
  18. {maturin-1.9.3 → maturin-1.9.5}/.cirrus.yml +0 -0
  19. {maturin-1.9.3 → maturin-1.9.5}/.codespellrc +0 -0
  20. {maturin-1.9.3 → maturin-1.9.5}/.config/nextest.toml +0 -0
  21. {maturin-1.9.3 → maturin-1.9.5}/.gitignore +0 -0
  22. {maturin-1.9.3 → maturin-1.9.5}/MANIFEST.in +0 -0
  23. {maturin-1.9.3 → maturin-1.9.5}/clippy.toml +0 -0
  24. {maturin-1.9.3 → maturin-1.9.5}/license-apache +0 -0
  25. {maturin-1.9.3 → maturin-1.9.5}/license-mit +0 -0
  26. {maturin-1.9.3 → maturin-1.9.5}/maturin/__main__.py +0 -0
  27. {maturin-1.9.3 → maturin-1.9.5}/maturin/bootstrap.py +0 -0
  28. {maturin-1.9.3 → maturin-1.9.5}/netlify.toml +0 -0
  29. {maturin-1.9.3 → maturin-1.9.5}/setup.py +0 -0
  30. {maturin-1.9.3 → maturin-1.9.5}/src/auditwheel/audit.rs +0 -0
  31. {maturin-1.9.3 → maturin-1.9.5}/src/auditwheel/manylinux-policy.json +0 -0
  32. {maturin-1.9.3 → maturin-1.9.5}/src/auditwheel/mod.rs +0 -0
  33. {maturin-1.9.3 → maturin-1.9.5}/src/auditwheel/musllinux-policy.json +0 -0
  34. {maturin-1.9.3 → maturin-1.9.5}/src/auditwheel/musllinux.rs +0 -0
  35. {maturin-1.9.3 → maturin-1.9.5}/src/auditwheel/patchelf.rs +0 -0
  36. {maturin-1.9.3 → maturin-1.9.5}/src/auditwheel/platform_tag.rs +0 -0
  37. {maturin-1.9.3 → maturin-1.9.5}/src/auditwheel/policy.rs +0 -0
  38. {maturin-1.9.3 → maturin-1.9.5}/src/auditwheel/repair.rs +0 -0
  39. {maturin-1.9.3 → maturin-1.9.5}/src/bridge.rs +0 -0
  40. {maturin-1.9.3 → maturin-1.9.5}/src/build_options.rs +0 -0
  41. {maturin-1.9.3 → maturin-1.9.5}/src/cargo_toml.rs +0 -0
  42. {maturin-1.9.3 → maturin-1.9.5}/src/ci.rs +0 -0
  43. {maturin-1.9.3 → maturin-1.9.5}/src/compression.rs +0 -0
  44. {maturin-1.9.3 → maturin-1.9.5}/src/develop.rs +0 -0
  45. {maturin-1.9.3 → maturin-1.9.5}/src/generate_json_schema.rs +0 -0
  46. {maturin-1.9.3 → maturin-1.9.5}/src/lib.rs +0 -0
  47. {maturin-1.9.3 → maturin-1.9.5}/src/main.rs +0 -0
  48. {maturin-1.9.3 → maturin-1.9.5}/src/metadata.rs +0 -0
  49. {maturin-1.9.3 → maturin-1.9.5}/src/new_project.rs +0 -0
  50. {maturin-1.9.3 → maturin-1.9.5}/src/project_layout.rs +0 -0
  51. {maturin-1.9.3 → maturin-1.9.5}/src/python_interpreter/get_interpreter_metadata.py +0 -0
  52. {maturin-1.9.3 → maturin-1.9.5}/src/source_distribution.rs +0 -0
  53. {maturin-1.9.3 → maturin-1.9.5}/src/target/legacy_py.rs +0 -0
  54. {maturin-1.9.3 → maturin-1.9.5}/src/target/pypi_tags.rs +0 -0
  55. {maturin-1.9.3 → maturin-1.9.5}/src/templates/.gitignore.j2 +0 -0
  56. {maturin-1.9.3 → maturin-1.9.5}/src/templates/Cargo.toml.j2 +0 -0
  57. {maturin-1.9.3 → maturin-1.9.5}/src/templates/__init__.py.j2 +0 -0
  58. {maturin-1.9.3 → maturin-1.9.5}/src/templates/build.rs.j2 +0 -0
  59. {maturin-1.9.3 → maturin-1.9.5}/src/templates/example.udl.j2 +0 -0
  60. {maturin-1.9.3 → maturin-1.9.5}/src/templates/lib.rs.j2 +0 -0
  61. {maturin-1.9.3 → maturin-1.9.5}/src/templates/main.rs.j2 +0 -0
  62. {maturin-1.9.3 → maturin-1.9.5}/src/templates/pyproject.toml.j2 +0 -0
  63. {maturin-1.9.3 → maturin-1.9.5}/src/templates/test_all.py.j2 +0 -0
  64. {maturin-1.9.3 → maturin-1.9.5}/src/upload.rs +0 -0
@@ -38,7 +38,7 @@ repos:
38
38
  types: [rust]
39
39
  stages: [manual] # because it's slow
40
40
  - repo: https://github.com/pre-commit/pre-commit-hooks
41
- rev: v5.0.0
41
+ rev: v6.0.0
42
42
  hooks:
43
43
  - id: check-yaml
44
44
  - id: check-toml
@@ -56,12 +56,12 @@ repos:
56
56
  )
57
57
  - id: mixed-line-ending
58
58
  - repo: https://github.com/astral-sh/ruff-pre-commit
59
- rev: v0.12.5
59
+ rev: v0.13.0
60
60
  hooks:
61
61
  - id: ruff-format
62
62
  - id: ruff
63
63
  - repo: https://github.com/pre-commit/mirrors-mypy
64
- rev: v1.17.0
64
+ rev: v1.18.1
65
65
  hooks:
66
66
  - id: mypy
67
67
  entry: mypy maturin/
@@ -493,13 +493,26 @@ version = "0.15.8"
493
493
  source = "registry+https://github.com/rust-lang/crates.io-index"
494
494
  checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb"
495
495
  dependencies = [
496
- "encode_unicode",
496
+ "encode_unicode 0.3.6",
497
497
  "lazy_static",
498
498
  "libc",
499
499
  "unicode-width 0.1.13",
500
500
  "windows-sys 0.52.0",
501
501
  ]
502
502
 
503
+ [[package]]
504
+ name = "console"
505
+ version = "0.16.0"
506
+ source = "registry+https://github.com/rust-lang/crates.io-index"
507
+ checksum = "2e09ced7ebbccb63b4c65413d821f2e00ce54c5ca4514ddc6b3c892fdbcbc69d"
508
+ dependencies = [
509
+ "encode_unicode 1.0.0",
510
+ "libc",
511
+ "once_cell",
512
+ "unicode-width 0.2.0",
513
+ "windows-sys 0.60.2",
514
+ ]
515
+
503
516
  [[package]]
504
517
  name = "content_inspector"
505
518
  version = "0.2.4"
@@ -634,7 +647,7 @@ version = "0.11.0"
634
647
  source = "registry+https://github.com/rust-lang/crates.io-index"
635
648
  checksum = "658bce805d770f407bc62102fca7c2c64ceef2fbcb2b8bd19d2765ce093980de"
636
649
  dependencies = [
637
- "console",
650
+ "console 0.15.8",
638
651
  "shell-words",
639
652
  "thiserror 1.0.69",
640
653
  "zeroize",
@@ -718,6 +731,12 @@ version = "0.3.6"
718
731
  source = "registry+https://github.com/rust-lang/crates.io-index"
719
732
  checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
720
733
 
734
+ [[package]]
735
+ name = "encode_unicode"
736
+ version = "1.0.0"
737
+ source = "registry+https://github.com/rust-lang/crates.io-index"
738
+ checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0"
739
+
721
740
  [[package]]
722
741
  name = "encoding_rs"
723
742
  version = "0.8.34"
@@ -983,8 +1002,8 @@ dependencies = [
983
1002
  "aho-corasick",
984
1003
  "bstr",
985
1004
  "log",
986
- "regex-automata 0.4.9",
987
- "regex-syntax 0.8.5",
1005
+ "regex-automata",
1006
+ "regex-syntax",
988
1007
  ]
989
1008
 
990
1009
  [[package]]
@@ -1194,7 +1213,7 @@ dependencies = [
1194
1213
  "globset",
1195
1214
  "log",
1196
1215
  "memchr",
1197
- "regex-automata 0.4.9",
1216
+ "regex-automata",
1198
1217
  "same-file",
1199
1218
  "walkdir",
1200
1219
  "winapi-util",
@@ -1217,7 +1236,7 @@ version = "0.17.9"
1217
1236
  source = "registry+https://github.com/rust-lang/crates.io-index"
1218
1237
  checksum = "cbf675b85ed934d3c67b5c5469701eec7db22689d0a2139d856e0925fa28b281"
1219
1238
  dependencies = [
1220
- "console",
1239
+ "console 0.15.8",
1221
1240
  "number_prefix",
1222
1241
  "portable-atomic",
1223
1242
  "unicode-width 0.2.0",
@@ -1236,7 +1255,7 @@ version = "1.43.1"
1236
1255
  source = "registry+https://github.com/rust-lang/crates.io-index"
1237
1256
  checksum = "154934ea70c58054b556dd430b99a98c2a7ff5309ac9891597e339b5c28f4371"
1238
1257
  dependencies = [
1239
- "console",
1258
+ "console 0.15.8",
1240
1259
  "once_cell",
1241
1260
  "similar",
1242
1261
  ]
@@ -1427,16 +1446,16 @@ dependencies = [
1427
1446
 
1428
1447
  [[package]]
1429
1448
  name = "matchers"
1430
- version = "0.1.0"
1449
+ version = "0.2.0"
1431
1450
  source = "registry+https://github.com/rust-lang/crates.io-index"
1432
- checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
1451
+ checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9"
1433
1452
  dependencies = [
1434
- "regex-automata 0.1.10",
1453
+ "regex-automata",
1435
1454
  ]
1436
1455
 
1437
1456
  [[package]]
1438
1457
  name = "maturin"
1439
- version = "1.9.3"
1458
+ version = "1.9.5"
1440
1459
  dependencies = [
1441
1460
  "anyhow",
1442
1461
  "base64 0.21.7",
@@ -1451,7 +1470,7 @@ dependencies = [
1451
1470
  "clap",
1452
1471
  "clap_complete_command",
1453
1472
  "configparser",
1454
- "console",
1473
+ "console 0.16.0",
1455
1474
  "dialoguer",
1456
1475
  "dirs",
1457
1476
  "dunce",
@@ -1637,12 +1656,11 @@ dependencies = [
1637
1656
 
1638
1657
  [[package]]
1639
1658
  name = "nu-ansi-term"
1640
- version = "0.46.0"
1659
+ version = "0.50.1"
1641
1660
  source = "registry+https://github.com/rust-lang/crates.io-index"
1642
- checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
1661
+ checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399"
1643
1662
  dependencies = [
1644
- "overload",
1645
- "winapi",
1663
+ "windows-sys 0.52.0",
1646
1664
  ]
1647
1665
 
1648
1666
  [[package]]
@@ -1723,12 +1741,6 @@ dependencies = [
1723
1741
  "windows-sys 0.52.0",
1724
1742
  ]
1725
1743
 
1726
- [[package]]
1727
- name = "overload"
1728
- version = "0.1.1"
1729
- source = "registry+https://github.com/rust-lang/crates.io-index"
1730
- checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
1731
-
1732
1744
  [[package]]
1733
1745
  name = "parking_lot"
1734
1746
  version = "0.12.3"
@@ -2034,17 +2046,8 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
2034
2046
  dependencies = [
2035
2047
  "aho-corasick",
2036
2048
  "memchr",
2037
- "regex-automata 0.4.9",
2038
- "regex-syntax 0.8.5",
2039
- ]
2040
-
2041
- [[package]]
2042
- name = "regex-automata"
2043
- version = "0.1.10"
2044
- source = "registry+https://github.com/rust-lang/crates.io-index"
2045
- checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
2046
- dependencies = [
2047
- "regex-syntax 0.6.29",
2049
+ "regex-automata",
2050
+ "regex-syntax",
2048
2051
  ]
2049
2052
 
2050
2053
  [[package]]
@@ -2055,15 +2058,9 @@ checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
2055
2058
  dependencies = [
2056
2059
  "aho-corasick",
2057
2060
  "memchr",
2058
- "regex-syntax 0.8.5",
2061
+ "regex-syntax",
2059
2062
  ]
2060
2063
 
2061
- [[package]]
2062
- name = "regex-syntax"
2063
- version = "0.6.29"
2064
- source = "registry+https://github.com/rust-lang/crates.io-index"
2065
- checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
2066
-
2067
2064
  [[package]]
2068
2065
  name = "regex-syntax"
2069
2066
  version = "0.8.5"
@@ -2790,14 +2787,14 @@ dependencies = [
2790
2787
 
2791
2788
  [[package]]
2792
2789
  name = "tracing-subscriber"
2793
- version = "0.3.19"
2790
+ version = "0.3.20"
2794
2791
  source = "registry+https://github.com/rust-lang/crates.io-index"
2795
- checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008"
2792
+ checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5"
2796
2793
  dependencies = [
2797
2794
  "matchers",
2798
2795
  "nu-ansi-term",
2799
2796
  "once_cell",
2800
- "regex",
2797
+ "regex-automata",
2801
2798
  "serde",
2802
2799
  "serde_json",
2803
2800
  "sharded-slab",
@@ -3174,6 +3171,15 @@ dependencies = [
3174
3171
  "windows-targets 0.52.5",
3175
3172
  ]
3176
3173
 
3174
+ [[package]]
3175
+ name = "windows-sys"
3176
+ version = "0.60.2"
3177
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3178
+ checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
3179
+ dependencies = [
3180
+ "windows-targets 0.53.2",
3181
+ ]
3182
+
3177
3183
  [[package]]
3178
3184
  name = "windows-targets"
3179
3185
  version = "0.48.5"
@@ -3198,13 +3204,29 @@ dependencies = [
3198
3204
  "windows_aarch64_gnullvm 0.52.5",
3199
3205
  "windows_aarch64_msvc 0.52.5",
3200
3206
  "windows_i686_gnu 0.52.5",
3201
- "windows_i686_gnullvm",
3207
+ "windows_i686_gnullvm 0.52.5",
3202
3208
  "windows_i686_msvc 0.52.5",
3203
3209
  "windows_x86_64_gnu 0.52.5",
3204
3210
  "windows_x86_64_gnullvm 0.52.5",
3205
3211
  "windows_x86_64_msvc 0.52.5",
3206
3212
  ]
3207
3213
 
3214
+ [[package]]
3215
+ name = "windows-targets"
3216
+ version = "0.53.2"
3217
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3218
+ checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef"
3219
+ dependencies = [
3220
+ "windows_aarch64_gnullvm 0.53.0",
3221
+ "windows_aarch64_msvc 0.53.0",
3222
+ "windows_i686_gnu 0.53.0",
3223
+ "windows_i686_gnullvm 0.53.0",
3224
+ "windows_i686_msvc 0.53.0",
3225
+ "windows_x86_64_gnu 0.53.0",
3226
+ "windows_x86_64_gnullvm 0.53.0",
3227
+ "windows_x86_64_msvc 0.53.0",
3228
+ ]
3229
+
3208
3230
  [[package]]
3209
3231
  name = "windows_aarch64_gnullvm"
3210
3232
  version = "0.48.5"
@@ -3217,6 +3239,12 @@ version = "0.52.5"
3217
3239
  source = "registry+https://github.com/rust-lang/crates.io-index"
3218
3240
  checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
3219
3241
 
3242
+ [[package]]
3243
+ name = "windows_aarch64_gnullvm"
3244
+ version = "0.53.0"
3245
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3246
+ checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
3247
+
3220
3248
  [[package]]
3221
3249
  name = "windows_aarch64_msvc"
3222
3250
  version = "0.48.5"
@@ -3229,6 +3257,12 @@ version = "0.52.5"
3229
3257
  source = "registry+https://github.com/rust-lang/crates.io-index"
3230
3258
  checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
3231
3259
 
3260
+ [[package]]
3261
+ name = "windows_aarch64_msvc"
3262
+ version = "0.53.0"
3263
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3264
+ checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
3265
+
3232
3266
  [[package]]
3233
3267
  name = "windows_i686_gnu"
3234
3268
  version = "0.48.5"
@@ -3241,12 +3275,24 @@ version = "0.52.5"
3241
3275
  source = "registry+https://github.com/rust-lang/crates.io-index"
3242
3276
  checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
3243
3277
 
3278
+ [[package]]
3279
+ name = "windows_i686_gnu"
3280
+ version = "0.53.0"
3281
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3282
+ checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3"
3283
+
3244
3284
  [[package]]
3245
3285
  name = "windows_i686_gnullvm"
3246
3286
  version = "0.52.5"
3247
3287
  source = "registry+https://github.com/rust-lang/crates.io-index"
3248
3288
  checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
3249
3289
 
3290
+ [[package]]
3291
+ name = "windows_i686_gnullvm"
3292
+ version = "0.53.0"
3293
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3294
+ checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
3295
+
3250
3296
  [[package]]
3251
3297
  name = "windows_i686_msvc"
3252
3298
  version = "0.48.5"
@@ -3259,6 +3305,12 @@ version = "0.52.5"
3259
3305
  source = "registry+https://github.com/rust-lang/crates.io-index"
3260
3306
  checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
3261
3307
 
3308
+ [[package]]
3309
+ name = "windows_i686_msvc"
3310
+ version = "0.53.0"
3311
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3312
+ checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
3313
+
3262
3314
  [[package]]
3263
3315
  name = "windows_x86_64_gnu"
3264
3316
  version = "0.48.5"
@@ -3271,6 +3323,12 @@ version = "0.52.5"
3271
3323
  source = "registry+https://github.com/rust-lang/crates.io-index"
3272
3324
  checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
3273
3325
 
3326
+ [[package]]
3327
+ name = "windows_x86_64_gnu"
3328
+ version = "0.53.0"
3329
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3330
+ checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba"
3331
+
3274
3332
  [[package]]
3275
3333
  name = "windows_x86_64_gnullvm"
3276
3334
  version = "0.48.5"
@@ -3283,6 +3341,12 @@ version = "0.52.5"
3283
3341
  source = "registry+https://github.com/rust-lang/crates.io-index"
3284
3342
  checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
3285
3343
 
3344
+ [[package]]
3345
+ name = "windows_x86_64_gnullvm"
3346
+ version = "0.53.0"
3347
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3348
+ checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57"
3349
+
3286
3350
  [[package]]
3287
3351
  name = "windows_x86_64_msvc"
3288
3352
  version = "0.48.5"
@@ -3295,6 +3359,12 @@ version = "0.52.5"
3295
3359
  source = "registry+https://github.com/rust-lang/crates.io-index"
3296
3360
  checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
3297
3361
 
3362
+ [[package]]
3363
+ name = "windows_x86_64_msvc"
3364
+ version = "0.53.0"
3365
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3366
+ checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
3367
+
3298
3368
  [[package]]
3299
3369
  name = "winnow"
3300
3370
  version = "0.5.40"
@@ -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.9.3"
4
+ version = "1.9.5"
5
5
  description = "Build and publish crates with pyo3, cffi and uniffi bindings as well as rust binaries as python packages"
6
6
  exclude = [
7
7
  "test-crates/**/*",
@@ -63,7 +63,7 @@ zip = { version = "2.3.0", default-features = false, features = [
63
63
  "deflate",
64
64
  "time",
65
65
  "zstd",
66
- "lzma"
66
+ "lzma",
67
67
  ] }
68
68
  thiserror = "2.0.3"
69
69
  fs-err = "3.0.0"
@@ -105,11 +105,11 @@ cargo-xwin = { version = "0.18.6", default-features = false, optional = true }
105
105
 
106
106
  # log
107
107
  tracing = "0.1.36"
108
- tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }
108
+ tracing-subscriber = { version = "0.3.20", features = ["env-filter"] }
109
109
 
110
110
  # project scaffolding, maturin new/init/generate-ci
111
111
  dialoguer = { version = "0.11.0", default-features = false, optional = true }
112
- console = { version = "0.15.4", optional = true }
112
+ console = { version = "0.16.0", optional = true }
113
113
  minijinja = { version = "2.5.0", optional = true }
114
114
 
115
115
  # upload
@@ -1,6 +1,16 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## [1.9.5]
4
+
5
+ * Add builtin sysconfig for FreeBSD 14.2 amd64
6
+ * Fix issue searching lib dir containing Python 3.14 `build-details.json`
7
+ * Fix detection of compatible interpreters on Windows ARM64
8
+
9
+ ## [1.9.4]
10
+
11
+ * Add a `use-base-python` option to `pyproject.toml` with the same behaviour as `MATURIN_PEP517_USE_BASE_PYTHON`.
12
+ * Add builtin sysconfigs for GraalPy
13
+ * Fix calculation of platform tag for FreeBSD
4
14
 
5
15
  ## [1.9.3]
6
16
 
@@ -1094,7 +1104,11 @@ points-0.1.0-py2.py3-none-manylinux1_x86_64.whl | 2,8M | 752K | 85K
1094
1104
 
1095
1105
  * Initial Release
1096
1106
 
1097
- [Unreleased]: https://github.com/pyo3/maturin/compare/v1.9.1...HEAD
1107
+ [Unreleased]: https://github.com/pyo3/maturin/compare/v1.9.5...HEAD
1108
+ [1.9.5]: https://github.com/pyo3/maturin/compare/v1.9.4...v1.9.5
1109
+ [1.9.4]: https://github.com/pyo3/maturin/compare/v1.9.3...v1.9.4
1110
+ [1.9.3]: https://github.com/pyo3/maturin/compare/v1.9.2...v1.9.3
1111
+ [1.9.2]: https://github.com/pyo3/maturin/compare/v1.9.1...v1.9.2
1098
1112
  [1.9.1]: https://github.com/pyo3/maturin/compare/v1.9.0...v1.9.1
1099
1113
  [1.9.0]: https://github.com/pyo3/maturin/compare/v1.8.7...v1.9.0
1100
1114
  [1.8.7]: https://github.com/pyo3/maturin/compare/v1.8.6...v1.8.7
@@ -1,10 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maturin
3
- Version: 1.9.3
3
+ Version: 1.9.5
4
4
  Classifier: Topic :: Software Development :: Build Tools
5
5
  Classifier: Programming Language :: Rust
6
6
  Classifier: Programming Language :: Python :: Implementation :: CPython
7
7
  Classifier: Programming Language :: Python :: Implementation :: PyPy
8
+ Classifier: Programming Language :: Python :: Implementation :: GraalPy
8
9
  Requires-Dist: tomli>=1.1.0 ; python_full_version < '3.11'
9
10
  Requires-Dist: ziglang>=0.10.0,<0.13.0 ; extra == 'zig'
10
11
  Requires-Dist: patchelf ; extra == 'patchelf'
@@ -254,6 +255,7 @@ maturin itself is manylinux compliant when compiled for the musl target.
254
255
 
255
256
  ## Examples
256
257
 
258
+ - [agg-python-bindings](https://pypi.org/project/agg-python-bindings) - A Python Library that binds to Asciinema Agg terminal record renderer and Avt terminal emulator
257
259
  - [ballista-python](https://github.com/apache/arrow-ballista-python) - A Python library that binds to Apache Arrow distributed query engine Ballista
258
260
  - [bleuscore](https://github.com/shenxiangzhuang/bleuscore) - A BLEU score calculation library, written in pure Rust
259
261
  - [chardetng-py](https://github.com/john-parton/chardetng-py) - Python binding for the chardetng character encoding detector.
@@ -229,6 +229,7 @@ maturin itself is manylinux compliant when compiled for the musl target.
229
229
 
230
230
  ## Examples
231
231
 
232
+ - [agg-python-bindings](https://pypi.org/project/agg-python-bindings) - A Python Library that binds to Asciinema Agg terminal record renderer and Avt terminal emulator
232
233
  - [ballista-python](https://github.com/apache/arrow-ballista-python) - A Python library that binds to Apache Arrow distributed query engine Ballista
233
234
  - [bleuscore](https://github.com/shenxiangzhuang/bleuscore) - A BLEU score calculation library, written in pure Rust
234
235
  - [chardetng-py](https://github.com/john-parton/chardetng-py) - Python binding for the chardetng character encoding detector.
@@ -50,7 +50,7 @@ def get_maturin_pep517_args(config_settings: Optional[Mapping[str, Any]] = None)
50
50
 
51
51
  def _get_sys_executable() -> str:
52
52
  executable = sys.executable
53
- if os.getenv("MATURIN_PEP517_USE_BASE_PYTHON") in {"1", "true"}:
53
+ if os.getenv("MATURIN_PEP517_USE_BASE_PYTHON") in {"1", "true"} or get_config().get("use-base-python"):
54
54
  # Use the base interpreter path when running inside a venv to avoid recompilation
55
55
  # when switching between venvs
56
56
  base_executable = getattr(sys, "_base_executable")
@@ -202,6 +202,11 @@
202
202
  "items": {
203
203
  "type": "string"
204
204
  }
205
+ },
206
+ "use-base-python": {
207
+ "description": "Use base Python executable instead of venv Python executable in PEP 517 build.",
208
+ "default": false,
209
+ "type": "boolean"
205
210
  }
206
211
  },
207
212
  "definitions": {
@@ -24,6 +24,7 @@ classifiers = [
24
24
  "Programming Language :: Rust",
25
25
  "Programming Language :: Python :: Implementation :: CPython",
26
26
  "Programming Language :: Python :: Implementation :: PyPy",
27
+ "Programming Language :: Python :: Implementation :: GraalPy",
27
28
  ]
28
29
  dependencies = ["tomli>=1.1.0 ; python_version<'3.11'"]
29
30
  dynamic = ["version"]
@@ -624,7 +624,14 @@ impl BuildContext {
624
624
  }
625
625
  }
626
626
  // FreeBSD
627
- (Os::FreeBsd, _)
627
+ | (Os::FreeBsd, _) => {
628
+ format!(
629
+ "{}_{}_{}",
630
+ target.target_os().to_string().to_ascii_lowercase(),
631
+ target.get_platform_release()?.to_ascii_lowercase(),
632
+ target.target_arch().machine(),
633
+ )
634
+ }
628
635
  // NetBSD
629
636
  | (Os::NetBsd, _)
630
637
  // OpenBSD
@@ -724,7 +731,7 @@ impl BuildContext {
724
731
  &self.out,
725
732
  &self.project_layout.project_root,
726
733
  &self.metadata24,
727
- &[tag.clone()],
734
+ std::slice::from_ref(&tag),
728
735
  self.excludes(Format::Wheel)?,
729
736
  self.compression,
730
737
  )?;
@@ -803,7 +810,7 @@ impl BuildContext {
803
810
  &self.out,
804
811
  &self.project_layout.project_root,
805
812
  &self.metadata24,
806
- &[tag.clone()],
813
+ std::slice::from_ref(&tag),
807
814
  self.excludes(Format::Wheel)?,
808
815
  self.compression,
809
816
  )?;
@@ -411,6 +411,11 @@ fn cargo_build_command(
411
411
  }
412
412
  }
413
413
 
414
+ // Set PYO3_BUILD_EXTENSION_MODULE when building pyo3 extension modules
415
+ if bridge_model.is_pyo3() && !bridge_model.is_bin() {
416
+ build_command.env("PYO3_BUILD_EXTENSION_MODULE", "1");
417
+ }
418
+
414
419
  // Setup `PYO3_CONFIG_FILE` if we are cross compiling for pyo3 bindings
415
420
  if let Some(interpreter) = python_interpreter {
416
421
  // Target python interpreter isn't runnable when cross compiling
@@ -153,7 +153,9 @@ fn search_lib_dir(path: impl AsRef<Path>, target: &Target) -> Result<Vec<PathBuf
153
153
  for f in fs::read_dir(path.as_ref())? {
154
154
  let sysc = match &f {
155
155
  Ok(f) if starts_with(f, "_sysconfigdata") && ends_with(f, "py") => vec![f.path()],
156
- Ok(f) if starts_with(f, "build") => search_lib_dir(f.path(), target)?,
156
+ Ok(f) if starts_with(f, "build") && f.path().is_dir() => {
157
+ search_lib_dir(f.path(), target)?
158
+ }
157
159
  Ok(f) if starts_with(f, "lib.") => {
158
160
  let name = f.file_name();
159
161
  // check if right target os
@@ -243,7 +243,7 @@ pub struct WheelWriter {
243
243
  compression: CompressionOptions,
244
244
  }
245
245
  impl CompressionOptions {
246
- fn get_file_options(&self) -> zip::write::FileOptions<()> {
246
+ fn get_file_options(&self) -> zip::write::FileOptions<'_, ()> {
247
247
  let method = if cfg!(feature = "faster-tests") {
248
248
  // Unlike users which can use the develop subcommand, the tests have to go through
249
249
  // packing a zip which pip than has to unpack. This makes this 2-3 times faster
@@ -223,6 +223,13 @@ pub struct ToolMaturin {
223
223
  pub unstable_flags: Option<Vec<String>>,
224
224
  /// Additional rustc arguments
225
225
  pub rustc_args: Option<Vec<String>>,
226
+ /// Use base Python executable instead of venv Python executable in PEP 517 build.
227
+ //
228
+ // This can help avoid unnecessary rebuilds, as the Python executable does not change
229
+ // every time. It should not be set when the sdist build requires packages installed
230
+ // in venv.
231
+ #[serde(default)]
232
+ pub use_base_python: bool,
226
233
  }
227
234
 
228
235
  /// A pyproject.toml as specified in PEP 517
@@ -12,7 +12,21 @@ use std::io::{BufRead, BufReader};
12
12
  use std::path::Path;
13
13
 
14
14
  const PYPY_ABI_TAG: &str = "pp73";
15
- const GRAALPY_ABI_TAG: &str = "graalpy230_310_native";
15
+
16
+ fn graalpy_version_for_python_version(major: usize, minor: usize) -> Option<(usize, usize)> {
17
+ match (major, minor) {
18
+ (3, 10) => Some((24, 0)),
19
+ (3, 11) => Some((24, 2)),
20
+ // Since 25.0, GraalPy should only change the major release number for feature releases.
21
+ // Additionally, it promises that only the autumn (oddly-numbered) releases are
22
+ // allowed to break ABI compatibility, so only those can change the Python version.
23
+ // The even-numbered releases will report the ABI version of the previous release.
24
+ // So assuming that GraalPy doesn't fall terribly behind on updating Python version,
25
+ // the version used in the ABI should follow this formula
26
+ (3, 12..) => Some((25 + (minor - 12) * 2, 0)),
27
+ (_, _) => None,
28
+ }
29
+ }
16
30
 
17
31
  /// Some of the sysconfigdata of Python interpreter we care about
18
32
  #[derive(Debug, Clone, Deserialize, Eq, PartialEq)]
@@ -92,6 +106,20 @@ impl InterpreterConfig {
92
106
  gil_disabled,
93
107
  })
94
108
  }
109
+ (Os::Linux, GraalPy) => {
110
+ let (graalpy_major, graalpy_minor) =
111
+ graalpy_version_for_python_version(major, minor)?;
112
+ let ext_suffix = format!(".graalpy{graalpy_major}{graalpy_minor}-{major}{minor}-native-{python_ext_arch}-linux.so");
113
+ Some(Self {
114
+ major,
115
+ minor,
116
+ interpreter_kind: GraalPy,
117
+ abiflags: String::new(),
118
+ ext_suffix,
119
+ pointer_width: Some(target.pointer_width()),
120
+ gil_disabled,
121
+ })
122
+ }
95
123
  (Os::Macos, CPython) => {
96
124
  let abiflags = if python_version < (3, 8) {
97
125
  "m".to_string()
@@ -122,6 +150,20 @@ impl InterpreterConfig {
122
150
  gil_disabled,
123
151
  })
124
152
  }
153
+ (Os::Macos, GraalPy) => {
154
+ let (graalpy_major, graalpy_minor) =
155
+ graalpy_version_for_python_version(major, minor)?;
156
+ let ext_suffix = format!(".graalpy{graalpy_major}{graalpy_minor}-{major}{minor}-native-{python_ext_arch}-darwin.so");
157
+ Some(Self {
158
+ major,
159
+ minor,
160
+ interpreter_kind: GraalPy,
161
+ abiflags: String::new(),
162
+ ext_suffix,
163
+ pointer_width: Some(target.pointer_width()),
164
+ gil_disabled,
165
+ })
166
+ }
125
167
  (Os::Windows, CPython) => {
126
168
  let abiflags = if python_version < (3, 8) {
127
169
  "m".to_string()
@@ -319,7 +361,11 @@ impl InterpreterConfig {
319
361
  }
320
362
  }
321
363
  InterpreterKind::PyPy => abi_tag.unwrap_or_else(|| PYPY_ABI_TAG.to_string()),
322
- InterpreterKind::GraalPy => abi_tag.unwrap_or_else(|| GRAALPY_ABI_TAG.to_string()),
364
+ InterpreterKind::GraalPy => abi_tag.unwrap_or_else(|| {
365
+ let (graalpy_major, graalpy_minor) =
366
+ graalpy_version_for_python_version(major, minor).unwrap_or((23, 0));
367
+ format!("graalpy{graalpy_major}{graalpy_minor}_{major}{minor}_native")
368
+ }),
323
369
  };
324
370
  let file_ext = if target.is_windows() { "pyd" } else { "so" };
325
371
  let ext_suffix = if target.is_linux() || target.is_macos() || target.is_hurd() {
@@ -1,5 +1,6 @@
1
1
  pub use self::config::InterpreterConfig;
2
2
  use crate::auditwheel::PlatformTag;
3
+ use crate::target::Arch;
3
4
  use crate::{BridgeModel, BuildContext, Target};
4
5
  use anyhow::{bail, ensure, format_err, Context, Result};
5
6
  use pep440_rs::{Version, VersionSpecifiers};
@@ -29,8 +30,8 @@ pub const MAXIMUM_PYPY_MINOR: usize = 11;
29
30
  fn windows_interpreter_no_build(
30
31
  major: usize,
31
32
  minor: usize,
32
- target_width: usize,
33
- pointer_width: usize,
33
+ target: &Target,
34
+ platform: String,
34
35
  min_python_minor: usize,
35
36
  requires_python: Option<&VersionSpecifiers>,
36
37
  ) -> bool {
@@ -46,17 +47,34 @@ fn windows_interpreter_no_build(
46
47
  }
47
48
  }
48
49
 
49
- // There can be 32-bit installations on a 64-bit machine, but we can't link
50
- // those for 64-bit targets
51
- if pointer_width != target_width {
50
+ let python_arch = match platform.as_str() {
51
+ "win32" => Arch::X86,
52
+ "win-amd64" => Arch::X86_64,
53
+ "win-arm64" => Arch::Aarch64,
54
+ _ => {
55
+ eprintln!("⚠️ Warning: {major}.{minor} reports unknown platform '{platform}'. This may fail to build.");
56
+ // false => build it anyway
57
+ return false;
58
+ }
59
+ };
60
+
61
+ let target_arch = target.target_arch();
62
+
63
+ if python_arch != target.target_arch() {
52
64
  eprintln!(
53
- "👽 {major}.{minor} is installed as {pointer_width}-bit, while the target is {target_width}-bit. Skipping."
65
+ "👽 {major}.{minor} reports a platform '{platform}' (architecture '{python_arch}'), while the Rust target is '{target_arch}'. Skipping."
54
66
  );
55
67
  return true;
56
68
  }
57
69
  false
58
70
  }
59
71
 
72
+ struct WindowsPythonInfo {
73
+ major: usize,
74
+ minor: usize,
75
+ platform: String, // e.g. win32, win-amd64, win-arm64
76
+ }
77
+
60
78
  /// On windows regular Python installs are supported along with environments
61
79
  /// being managed by `conda`.
62
80
  ///
@@ -132,45 +150,44 @@ fn find_all_windows(
132
150
  .parse::<usize>()
133
151
  .context("Expected a digit for minor version")?;
134
152
  if !versions_found.contains(&(major, minor)) {
135
- let pointer_width = capture
136
- .get(5)
137
- .map(|m| m.as_str())
138
- .filter(|m| !m.is_empty())
139
- .unwrap_or("64")
140
- .parse::<usize>()
141
- .context("Expected a digit for pointer width")?;
142
-
143
- if windows_interpreter_no_build(
144
- major,
145
- minor,
146
- target.pointer_width(),
147
- pointer_width,
148
- min_python_minor,
149
- requires_python,
150
- ) {
153
+ let executable = capture.get(6).unwrap().as_str();
154
+ let executable_path = Path::new(&executable);
155
+ // Skip non-existing paths
156
+ if !executable_path.exists() {
151
157
  continue;
152
158
  }
159
+ if let Some(python_info) = windows_python_info(executable_path)? {
160
+ if windows_interpreter_no_build(
161
+ major,
162
+ minor,
163
+ target,
164
+ python_info.platform,
165
+ min_python_minor,
166
+ requires_python,
167
+ ) {
168
+ continue;
169
+ }
153
170
 
154
- let executable = capture.get(6).unwrap().as_str();
155
- let output = Command::new(executable).args(["-c", code]).output();
156
- let output = match output {
157
- Ok(output) => output,
158
- Err(err) => {
171
+ let output = Command::new(executable).args(["-c", code]).output();
172
+ let output = match output {
173
+ Ok(output) => output,
174
+ Err(err) => {
175
+ eprintln!(
176
+ "⚠️ Warning: failed to determine the path to python for `{executable}`: {err}"
177
+ );
178
+ continue;
179
+ }
180
+ };
181
+ let path = str::from_utf8(&output.stdout).unwrap().trim();
182
+ if !output.status.success() || path.trim().is_empty() {
159
183
  eprintln!(
160
- "⚠️ Warning: failed to determine the path to python for `{executable}`: {err}"
184
+ "⚠️ Warning: couldn't determine the path to python for `{executable}`"
161
185
  );
162
186
  continue;
163
187
  }
164
- };
165
- let path = str::from_utf8(&output.stdout).unwrap().trim();
166
- if !output.status.success() || path.trim().is_empty() {
167
- eprintln!(
168
- "⚠️ Warning: couldn't determine the path to python for `{executable}`"
169
- );
170
- continue;
188
+ interpreter.push(path.to_string());
189
+ versions_found.insert((major, minor));
171
190
  }
172
- interpreter.push(path.to_string());
173
- versions_found.insert((major, minor));
174
191
  }
175
192
  }
176
193
  }
@@ -205,8 +222,8 @@ fn find_all_windows(
205
222
  if windows_interpreter_no_build(
206
223
  python_info.major,
207
224
  python_info.minor,
208
- target.pointer_width(),
209
- python_info.pointer_width.unwrap(),
225
+ target,
226
+ python_info.platform,
210
227
  min_python_minor,
211
228
  requires_python,
212
229
  ) {
@@ -226,8 +243,8 @@ fn find_all_windows(
226
243
  if windows_interpreter_no_build(
227
244
  python_info.major,
228
245
  python_info.minor,
229
- target.pointer_width(),
230
- python_info.pointer_width.unwrap(),
246
+ target,
247
+ python_info.platform,
231
248
  min_python_minor,
232
249
  requires_python,
233
250
  ) {
@@ -247,16 +264,10 @@ fn find_all_windows(
247
264
  Ok(interpreter)
248
265
  }
249
266
 
250
- struct WindowsPythonInfo {
251
- major: usize,
252
- minor: usize,
253
- pointer_width: Option<usize>,
254
- }
255
-
256
267
  fn windows_python_info(executable: &Path) -> Result<Option<WindowsPythonInfo>> {
257
268
  let python_info = Command::new(executable)
258
269
  .arg("-c")
259
- .arg("import sys; print(sys.version)")
270
+ .arg("import sys, sysconfig; print(sys.version_info.major, sys.version_info.minor, sysconfig.get_platform())")
260
271
  .output();
261
272
 
262
273
  let python_info = match python_info {
@@ -275,23 +286,25 @@ fn windows_python_info(executable: &Path) -> Result<Option<WindowsPythonInfo>> {
275
286
  };
276
287
 
277
288
  let version_info = str::from_utf8(&python_info.stdout).unwrap();
278
- let expr = Regex::new(r"(\d).(\d).(\d+)").unwrap();
279
- if let Some(capture) = expr.captures(version_info) {
280
- let major = capture.get(1).unwrap().as_str().parse::<usize>().unwrap();
281
- let minor = capture.get(2).unwrap().as_str().parse::<usize>().unwrap();
282
- let pointer_width = if version_info.contains("64 bit (AMD64)") {
283
- 64
284
- } else {
285
- 32
286
- };
287
- Ok(Some(WindowsPythonInfo {
288
- major,
289
- minor,
290
- pointer_width: Some(pointer_width),
291
- }))
292
- } else {
293
- Ok(None)
294
- }
289
+
290
+ // Split into 3 segments: major, minor, platform by spaces
291
+ let segments: Vec<&str> = version_info.splitn(3, ' ').collect();
292
+ let [major, minor, platform] = segments.as_slice() else {
293
+ bail!(
294
+ "Unexpected output for Python version info from {}: '{}'",
295
+ executable.display(),
296
+ version_info
297
+ );
298
+ };
299
+ // can then parse each substring
300
+ let major = major.parse::<usize>().ok().unwrap_or(0);
301
+ let minor = minor.parse::<usize>().ok().unwrap_or(0);
302
+
303
+ Ok(Some(WindowsPythonInfo {
304
+ major,
305
+ minor,
306
+ platform: platform.to_string(),
307
+ }))
295
308
  }
296
309
 
297
310
  #[derive(Debug, Clone, Copy, Eq, PartialEq, Deserialize, clap::ValueEnum)]
@@ -325,7 +338,7 @@ impl fmt::Display for InterpreterKind {
325
338
  match *self {
326
339
  InterpreterKind::CPython => write!(f, "CPython"),
327
340
  InterpreterKind::PyPy => write!(f, "PyPy"),
328
- InterpreterKind::GraalPy => write!(f, "GraalPy"),
341
+ InterpreterKind::GraalPy => write!(f, "GraalVM"),
329
342
  }
330
343
  }
331
344
  }
@@ -1180,4 +1193,137 @@ mod tests {
1180
1193
  assert_eq!(calculate_abi_tag(ext_suffix).as_deref(), expected);
1181
1194
  }
1182
1195
  }
1196
+
1197
+ #[test]
1198
+ fn test_windows_interpreter_no_build() {
1199
+ use pep440_rs::VersionSpecifiers;
1200
+ use std::str::FromStr;
1201
+
1202
+ // Test cases for different scenarios
1203
+ let target_x64 = Target::from_resolved_target_triple("x86_64-pc-windows-msvc").unwrap();
1204
+ let target_x86 = Target::from_resolved_target_triple("i686-pc-windows-msvc").unwrap();
1205
+ let target_arm64 = Target::from_resolved_target_triple("aarch64-pc-windows-msvc").unwrap();
1206
+
1207
+ // Test Python 2.x should be rejected
1208
+ assert!(windows_interpreter_no_build(
1209
+ 2,
1210
+ 7,
1211
+ &target_x64,
1212
+ "win-amd64".to_string(),
1213
+ 7,
1214
+ None
1215
+ ));
1216
+
1217
+ // Test Python 3.x but below minimum version
1218
+ assert!(windows_interpreter_no_build(
1219
+ 3,
1220
+ 6,
1221
+ &target_x64,
1222
+ "win-amd64".to_string(),
1223
+ 7,
1224
+ None
1225
+ ));
1226
+
1227
+ // Test valid Python version with matching platform and architecture
1228
+ assert!(!windows_interpreter_no_build(
1229
+ 3,
1230
+ 10,
1231
+ &target_x64,
1232
+ "win-amd64".to_string(),
1233
+ 7,
1234
+ None
1235
+ ));
1236
+
1237
+ // Test 32-bit Python on 64-bit target (should be rejected)
1238
+ assert!(windows_interpreter_no_build(
1239
+ 3,
1240
+ 10,
1241
+ &target_x64,
1242
+ "win32".to_string(),
1243
+ 7,
1244
+ None
1245
+ ));
1246
+
1247
+ // Test 32-bit Python on 32-bit target (should be accepted)
1248
+ assert!(!windows_interpreter_no_build(
1249
+ 3,
1250
+ 10,
1251
+ &target_x86,
1252
+ "win32".to_string(),
1253
+ 7,
1254
+ None
1255
+ ));
1256
+
1257
+ // Test mismatched architectures
1258
+ assert!(windows_interpreter_no_build(
1259
+ 3,
1260
+ 10,
1261
+ &target_x64,
1262
+ "win-arm64".to_string(),
1263
+ 7,
1264
+ None
1265
+ ));
1266
+
1267
+ assert!(windows_interpreter_no_build(
1268
+ 3,
1269
+ 10,
1270
+ &target_arm64,
1271
+ "win-amd64".to_string(),
1272
+ 7,
1273
+ None
1274
+ ));
1275
+
1276
+ // Test correct architecture matches
1277
+ assert!(!windows_interpreter_no_build(
1278
+ 3,
1279
+ 10,
1280
+ &target_arm64,
1281
+ "win-arm64".to_string(),
1282
+ 7,
1283
+ None
1284
+ ));
1285
+
1286
+ // Test requires-python constraints
1287
+ let requires_python = VersionSpecifiers::from_str(">=3.8,<3.12").unwrap();
1288
+
1289
+ // Should reject Python 3.7 due to requires-python
1290
+ assert!(windows_interpreter_no_build(
1291
+ 3,
1292
+ 7,
1293
+ &target_x64,
1294
+ "win-amd64".to_string(),
1295
+ 7,
1296
+ Some(&requires_python)
1297
+ ));
1298
+
1299
+ // Should accept Python 3.10 within requires-python range
1300
+ assert!(!windows_interpreter_no_build(
1301
+ 3,
1302
+ 10,
1303
+ &target_x64,
1304
+ "win-amd64".to_string(),
1305
+ 7,
1306
+ Some(&requires_python)
1307
+ ));
1308
+
1309
+ // Should reject Python 3.12 due to requires-python upper bound
1310
+ assert!(windows_interpreter_no_build(
1311
+ 3,
1312
+ 12,
1313
+ &target_x64,
1314
+ "win-amd64".to_string(),
1315
+ 7,
1316
+ Some(&requires_python)
1317
+ ));
1318
+
1319
+ // Test edge case with unknown platform (should not match any specific architecture)
1320
+ assert!(!windows_interpreter_no_build(
1321
+ 3,
1322
+ 10,
1323
+ &target_x64,
1324
+ "unknown-platform".to_string(),
1325
+ 7,
1326
+ None
1327
+ ));
1328
+ }
1183
1329
  }
@@ -378,7 +378,7 @@ impl Target {
378
378
  Ok(release)
379
379
  }
380
380
 
381
- /// Returns the name python uses in `sys.platform` for this architecture.
381
+ /// Returns the name python uses in `platform.machine()` for this architecture.
382
382
  pub fn get_python_arch(&self) -> &str {
383
383
  match self.arch {
384
384
  Arch::Aarch64 => "aarch64",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes