diff --git a/src/lib.rs b/src/lib.rs index 83b48cb9..f101f7fe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -149,7 +149,9 @@ //! crate-type = ["cdylib"] //! //! [dependencies.pyo3] -//! version = "0.13.2" +// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643 +#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("version = \"", env!("CARGO_PKG_VERSION"), "\"")))] +#![cfg_attr(not(docsrs), doc = "version = \"*\"")] //! features = ["extension-module"] //! ``` //! @@ -200,7 +202,9 @@ //! //! ```toml //! [dependencies.pyo3] -//! version = "0.13.2" +// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643 +#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("version = \"", env!("CARGO_PKG_VERSION"), "\"")))] +#![cfg_attr(not(docsrs), doc = "version = \"*\"")] //! # this is necessary to automatically initialize the Python interpreter //! features = ["auto-initialize"] //! ``` diff --git a/src/num_bigint.rs b/src/num_bigint.rs index 2252338b..1b4d05da 100644 --- a/src/num_bigint.rs +++ b/src/num_bigint.rs @@ -17,9 +17,13 @@ //! //! ```toml //! [dependencies] -//! # change * to the latest versions //! num-bigint = "*" -//! pyo3 = { version = "*", features = ["num-bigint"] } +// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643 +#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"num-bigint\"] }")))] +#![cfg_attr( + not(docsrs), + doc = "pyo3 = { version = \"*\", features = [\"num-bigint\"] }" +)] //! ``` //! //! Note that you must use compatible versions of num-bigint and PyO3. diff --git a/src/num_complex.rs b/src/num_complex.rs index 5cb45dec..24da2390 100644 --- a/src/num_complex.rs +++ b/src/num_complex.rs @@ -14,7 +14,12 @@ //! [dependencies] //! # change * to the latest versions //! num-complex = "*" -//! pyo3 = { version = "*", features = ["num-complex"] } +// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643 +#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"num-complex\"] }")))] +#![cfg_attr( + not(docsrs), + doc = "pyo3 = { version = \"*\", features = [\"num-complex\"] }" +)] //! ``` //! //! Note that you must use compatible versions of num-complex and PyO3.