diff --git a/Cargo.lock b/Cargo.lock index 3145fefcc..2fb580d26 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2725,15 +2725,15 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.20.3" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53bdbb96d49157e65d45cc287af5f32ffadd5f4761438b527b055fb0d4bb8233" +checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8" dependencies = [ "cfg-if", "indoc", "libc", "memoffset 0.9.1", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "portable-atomic", "pyo3-build-config", "pyo3-ffi", @@ -2743,9 +2743,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.20.3" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deaa5745de3f5231ce10517a1f5dd97d53e5a2fd77aa6b5842292085831d48d7" +checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50" dependencies = [ "once_cell", "target-lexicon", @@ -2753,9 +2753,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.20.3" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b42531d03e08d4ef1f6e85a2ed422eb678b8cd62b762e53891c05faf0d4afa" +checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403" dependencies = [ "libc", "pyo3-build-config", @@ -2763,9 +2763,9 @@ dependencies = [ [[package]] name = "pyo3-log" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c10808ee7250403bedb24bc30c32493e93875fef7ba3e4292226fe924f398bd" +checksum = "2af49834b8d2ecd555177e63b273b708dea75150abc6f5341d0a6e1a9623976c" dependencies = [ "arc-swap", "log", @@ -2774,9 +2774,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.20.3" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7305c720fa01b8055ec95e484a6eca7a83c841267f0dd5280f0c8b8551d2c158" +checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -2786,9 +2786,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.20.3" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c7e9b68bb9c3149c5b0cade5d07f953d6d125eb4337723c4ccdb665f1f96185" +checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c" dependencies = [ "heck 0.4.1", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index ec92f6ff7..90b17eec9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -106,8 +106,8 @@ pathdiff = { version = "0.2.1" } petgraph = { version = "0.6.4" } platform-info = { version = "2.0.2" } pubgrub = { git = "https://github.com/astral-sh/pubgrub", rev = "c26e485213e39582c6f2e4d45c0328422670e7a7" } -pyo3 = { version = "0.20.3" } -pyo3-log = { version = "0.9.0" } +pyo3 = { version = "0.21.0" } +pyo3-log = { version = "0.10.0" } rand = { version = "0.8.5" } rayon = { version = "1.8.0" } reflink-copy = { version = "0.1.15" } diff --git a/crates/pep440-rs/src/lib.rs b/crates/pep440-rs/src/lib.rs index 1b35778c3..754b03915 100644 --- a/crates/pep440-rs/src/lib.rs +++ b/crates/pep440-rs/src/lib.rs @@ -54,7 +54,10 @@ mod version_specifier; #[cfg(feature = "pyo3")] #[pyo3::pymodule] #[pyo3(name = "_pep440_rs")] -pub fn python_module(_py: pyo3::Python, module: &pyo3::types::PyModule) -> pyo3::PyResult<()> { +pub fn python_module( + _py: pyo3::Python, + module: &pyo3::Bound<'_, pyo3::types::PyModule>, +) -> pyo3::PyResult<()> { module.add_class::()?; module.add_class::()?; module.add_class::()?; diff --git a/crates/pep508-rs/src/lib.rs b/crates/pep508-rs/src/lib.rs index e36f21f00..c6bdd26f4 100644 --- a/crates/pep508-rs/src/lib.rs +++ b/crates/pep508-rs/src/lib.rs @@ -1367,8 +1367,9 @@ fn parse_unnamed_requirement( #[cfg(feature = "pyo3")] #[pymodule] #[pyo3(name = "pep508_rs")] -pub fn python_module(py: Python<'_>, m: &PyModule) -> PyResult<()> { +pub fn python_module(py: Python<'_>, m: &pyo3::Bound<'_, PyModule>) -> PyResult<()> { // Allowed to fail if we embed this module in another + #[allow(unused_must_use)] { pyo3_log::try_init(); @@ -1379,7 +1380,7 @@ pub fn python_module(py: Python<'_>, m: &PyModule) -> PyResult<()> { m.add_class::()?; m.add_class::()?; - m.add("Pep508Error", py.get_type::())?; + m.add("Pep508Error", py.get_type_bound::())?; Ok(()) } diff --git a/crates/pep508-rs/src/marker.rs b/crates/pep508-rs/src/marker.rs index 943c4cc8c..51c061fd7 100644 --- a/crates/pep508-rs/src/marker.rs +++ b/crates/pep508-rs/src/marker.rs @@ -13,7 +13,8 @@ use crate::{Cursor, Pep508Error, Pep508ErrorSource}; use pep440_rs::{Version, VersionPattern, VersionSpecifier}; #[cfg(feature = "pyo3")] use pyo3::{ - basic::CompareOp, exceptions::PyValueError, pyclass, pymethods, PyAny, PyResult, Python, + basic::CompareOp, exceptions::PyValueError, pyclass, pymethods, types::PyAnyMethods, PyResult, + Python, }; #[cfg(feature = "serde")] use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; @@ -476,9 +477,9 @@ impl MarkerEnvironment { /// Query the current python interpreter to get the correct marker value #[staticmethod] fn current(py: Python<'_>) -> PyResult { - let os = py.import("os")?; - let platform = py.import("platform")?; - let sys = py.import("sys")?; + let os = py.import_bound("os")?; + let platform = py.import_bound("platform")?; + let sys = py.import_bound("sys")?; let python_version_tuple: (String, String, String) = platform .getattr("python_version_tuple")? .call0()? @@ -487,7 +488,7 @@ impl MarkerEnvironment { // See pseudocode at // https://packaging.python.org/en/latest/specifications/dependency-specifiers/#environment-markers let name = sys.getattr("implementation")?.getattr("name")?.extract()?; - let info: &PyAny = sys.getattr("implementation")?.getattr("version")?; + let info = sys.getattr("implementation")?.getattr("version")?; let kind = info.getattr("releaselevel")?.extract::()?; let implementation_version: String = format!( "{}.{}.{}{}", diff --git a/scripts/packages/maturin_editable/Cargo.lock b/scripts/packages/maturin_editable/Cargo.lock index 847212c74..74158ad7e 100644 --- a/scripts/packages/maturin_editable/Cargo.lock +++ b/scripts/packages/maturin_editable/Cargo.lock @@ -93,6 +93,12 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + [[package]] name = "proc-macro2" version = "1.0.70" @@ -104,15 +110,16 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.20.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e8453b658fe480c3e70c8ed4e3d3ec33eb74988bd186561b0cc66b85c3bc4b" +checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8" dependencies = [ "cfg-if", "indoc", "libc", "memoffset", "parking_lot", + "portable-atomic", "pyo3-build-config", "pyo3-ffi", "pyo3-macros", @@ -121,9 +128,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.20.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a96fe70b176a89cff78f2fa7b3c930081e163d5379b4dcdf993e3ae29ca662e5" +checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50" dependencies = [ "once_cell", "target-lexicon", @@ -131,9 +138,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.20.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "214929900fd25e6604661ed9cf349727c8920d47deff196c4e28165a6ef2a96b" +checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403" dependencies = [ "libc", "pyo3-build-config", @@ -141,9 +148,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.20.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac53072f717aa1bfa4db832b39de8c875b7c7af4f4a6fe93cdbf9264cf8383b" +checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -153,12 +160,13 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.20.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7774b5a8282bd4f25f803b1f0d945120be959a36c72e08e7cd031c792fdfd424" +checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c" dependencies = [ "heck", "proc-macro2", + "pyo3-build-config", "quote", "syn", ] diff --git a/scripts/packages/maturin_editable/Cargo.toml b/scripts/packages/maturin_editable/Cargo.toml index a5ec356e2..ffe7a651b 100644 --- a/scripts/packages/maturin_editable/Cargo.toml +++ b/scripts/packages/maturin_editable/Cargo.toml @@ -9,4 +9,4 @@ name = "maturin_editable" crate-type = ["cdylib"] [dependencies] -pyo3 = "0.20.0" +pyo3 = "0.21.0"