From 9b2125ddacd4a7db19ab6d6f3b1bb57bd33ff1d6 Mon Sep 17 00:00:00 2001 From: konstin Date: Sun, 18 Feb 2024 21:55:25 +0100 Subject: [PATCH] Update pep440_rs, pep508_rs and pyproject-toml --- Cargo.lock | 101 +++++++++--------- Cargo.toml | 6 +- src/build_context.rs | 4 +- src/module_writer.rs | 2 +- src/pyproject_toml.rs | 2 +- src/python_interpreter/mod.rs | 8 +- .../pyo3-no-extension-module/Cargo.lock | 12 +-- 7 files changed, 65 insertions(+), 70 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3a821e298..c6dd1d30f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -572,6 +572,17 @@ dependencies = [ "powerfmt", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "dialoguer" version = "0.11.0" @@ -838,35 +849,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "hoot" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df22a4d90f1b0e65fe3e0d6ee6a4608cc4d81f4b2eb3e670f44bb6bde711e452" -dependencies = [ - "httparse", - "log", -] - -[[package]] -name = "hootbin" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "354e60868e49ea1a39c44b9562ad207c4259dc6eabf9863bf3b0f058c55cfdb2" -dependencies = [ - "fastrand", - "hoot", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - [[package]] name = "humantime" version = "2.1.0" @@ -885,9 +867,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1395,22 +1377,24 @@ checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" [[package]] name = "pep440_rs" -version = "0.3.12" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "887f66cc62717ea72caac4f1eb4e6f392224da3ffff3f40ec13ab427802746d6" +checksum = "15efd4d885c29126cc93e12af3087896e2518bd5ca0fb328c19c4ef9cecfa8be" dependencies = [ - "lazy_static", - "regex", + "once_cell", "serde", + "tracing", "unicode-width", + "unscanny", ] [[package]] name = "pep508_rs" -version = "0.2.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0713d7bb861ca2b7d4c50a38e1f31a4b63a2e2df35ef1e5855cc29e108453e2" +checksum = "1455babf8edd3eedcdfcb39700e455a4bb189e71b4f1fa0eacc9b244cc5a55e6" dependencies = [ + "derivative", "once_cell", "pep440_rs", "regex", @@ -1419,6 +1403,7 @@ dependencies = [ "tracing", "unicode-width", "url", + "urlencoding", ] [[package]] @@ -1503,9 +1488,9 @@ dependencies = [ [[package]] name = "pyproject-toml" -version = "0.8.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46d4a5e69187f23a29f8aa0ea57491d104ba541bc55f76552c2a74962aa20e04" +checksum = "3b80f889b6d413c3f8963a2c7db03f95dd6e1d85e1074137cb2013ea2faa8898" dependencies = [ "indexmap 2.1.0", "pep440_rs", @@ -1845,18 +1830,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", @@ -2096,18 +2081,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", @@ -2216,7 +2201,6 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2360,6 +2344,12 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +[[package]] +name = "unscanny" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9df2af067a7953e9c3831320f35c1cc0600c30d44d9f7a12b01db1cd88d6b47" + [[package]] name = "untrusted" version = "0.9.0" @@ -2368,13 +2358,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.9.4" +version = "2.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399dd89e2af196ae4f83a47bb37a1455e664fe2fed97b3ae68a1c4a3f8216e76" +checksum = "11f214ce18d8b2cbe84ed3aa6486ed3f5b285cf8d8fbdbce9f3f767a724adc35" dependencies = [ "base64 0.21.7", "flate2", - "hootbin", "log", "native-tls", "once_cell", @@ -2390,9 +2379,9 @@ dependencies = [ [[package]] name = "url" -version = "2.3.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -2400,6 +2389,12 @@ dependencies = [ "serde", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + [[package]] name = "utf8parse" version = "0.2.1" diff --git a/Cargo.toml b/Cargo.toml index 9d4a51db0..0e6806804 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,7 @@ rustc_version = "0.4.0" semver = "1.0.13" target-lexicon = "0.12.8" indexmap = "2.0.2" -pyproject-toml = "0.8.1" +pyproject-toml = "0.10.0" python-pkginfo = "0.6.0" textwrap = "0.16.0" ignore = "0.4.20" @@ -72,8 +72,8 @@ 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"] } +pep440_rs = { version = "0.5.0", features = ["serde", "tracing"] } +pep508_rs = { version = "0.4.2", features = ["serde", "tracing"] } time = "0.3.17" # cli diff --git a/src/build_context.rs b/src/build_context.rs index 87419ea7c..caa299d76 100644 --- a/src/build_context.rs +++ b/src/build_context.rs @@ -128,7 +128,7 @@ fn bin_wasi_helper( if !metadata21 .requires_dist .iter() - .any(|requirement| requirement.name == "wasmtime") + .any(|requirement| requirement.name.as_ref() == "wasmtime") { // Having the wasmtime version hardcoded is not ideal, it's easy enough to overwrite metadata21 @@ -900,7 +900,7 @@ impl BuildContext { .metadata21 .requires_dist .iter() - .any(|requirement| requirement.name == "cffi") + .any(|requirement| requirement.name.as_ref() == "cffi") { eprintln!( "⚠️ Warning: missing cffi package dependency, please add it to pyproject.toml. \ diff --git a/src/module_writer.rs b/src/module_writer.rs index 2aab940ab..6948dc3b5 100644 --- a/src/module_writer.rs +++ b/src/module_writer.rs @@ -1360,7 +1360,7 @@ mod tests { #[test] // The mechanism is the same for wheel_writer fn sdist_writer_excludes() -> Result<(), Box> { - let metadata = Metadata21::new("dummy".to_string(), Version::from_release(vec![1, 0])); + let metadata = Metadata21::new("dummy".to_string(), Version::new([1, 0])); let perm = 0o777; // No excludes diff --git a/src/pyproject_toml.rs b/src/pyproject_toml.rs index 319d7a9f6..dc296e5f3 100644 --- a/src/pyproject_toml.rs +++ b/src/pyproject_toml.rs @@ -318,7 +318,7 @@ impl PyProjectToml { .build_system .requires .iter() - .find(|x| x.name == maturin); + .find(|x| x.name.as_ref() == maturin); if let Some(requires_maturin) = requires_maturin { match requires_maturin.version_or_url.as_ref() { Some(VersionOrUrl::VersionSpecifier(version_specifier)) => { diff --git a/src/python_interpreter/mod.rs b/src/python_interpreter/mod.rs index 16f73f306..94bef21ea 100644 --- a/src/python_interpreter/mod.rs +++ b/src/python_interpreter/mod.rs @@ -40,7 +40,7 @@ fn windows_interpreter_no_build( // From requires-python in pyproject.toml if let Some(requires_python) = requires_python { - if !requires_python.contains(&Version::from_release(vec![major, minor])) { + if !requires_python.contains(&Version::new([major as u64, minor as u64])) { return true; } } @@ -726,7 +726,7 @@ impl PythonInterpreter { .filter_map(|config| match requires_python { Some(requires_python) => { if requires_python - .contains(&Version::from_release(vec![config.major, config.minor])) + .contains(&Version::new([config.major as u64, config.minor as u64])) { Some(Self::from_config(config)) } else { @@ -760,7 +760,7 @@ impl PythonInterpreter { .filter(|minor| { requires_python .map(|requires_python| { - requires_python.contains(&Version::from_release(vec![3, *minor])) + requires_python.contains(&Version::new([3, *minor as u64])) }) .unwrap_or(true) }) @@ -777,7 +777,7 @@ impl PythonInterpreter { requires_python .map(|requires_python| { requires_python - .contains(&Version::from_release(vec![3, *minor])) + .contains(&Version::new([3, *minor as u64])) }) .unwrap_or(true) }) diff --git a/test-crates/pyo3-no-extension-module/Cargo.lock b/test-crates/pyo3-no-extension-module/Cargo.lock index 93f465101..e3be9c93b 100644 --- a/test-crates/pyo3-no-extension-module/Cargo.lock +++ b/test-crates/pyo3-no-extension-module/Cargo.lock @@ -76,9 +76,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.19.2" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e681a6cfdc4adcc93b4d3cf993749a4552018ee0a9b65fc0ccfad74352c72a38" +checksum = "9a89dc7a5850d0e983be1ec2a463a171d20990487c3cfcd68b5363f1ee3d6fe0" dependencies = [ "cfg-if", "libc", @@ -90,9 +90,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.19.2" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076c73d0bc438f7a4ef6fdd0c3bb4732149136abd952b110ac93e4edb13a6ba5" +checksum = "07426f0d8fe5a601f26293f300afd1a7b1ed5e78b2a705870c5f30893c5163be" dependencies = [ "once_cell", "target-lexicon", @@ -100,9 +100,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.19.2" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53cee42e77ebe256066ba8aa77eff722b3bb91f3419177cf4cd0f304d3284d9" +checksum = "dbb7dec17e17766b46bca4f1a4215a85006b4c2ecde122076c562dd058da6cf1" dependencies = [ "libc", "pyo3-build-config",