Skip to content

Commit cfedd87

Browse files
committed
automagically update pyo3 version in toml examples
1 parent 64a0391 commit cfedd87

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@
150150
//! crate-type = ["cdylib"]
151151
//!
152152
//! [dependencies.pyo3]
153-
//! version = "0.13.2"
153+
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643
154+
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("version = \"", env!("CARGO_PKG_VERSION"), "\"")))]
155+
#![cfg_attr(not(docsrs), doc = "version = \"*\"")]
154156
//! features = ["extension-module"]
155157
//! ```
156158
//!
@@ -202,7 +204,9 @@
202204
//!
203205
//! ```toml
204206
//! [dependencies.pyo3]
205-
//! version = "0.13.2"
207+
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643
208+
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("version = \"", env!("CARGO_PKG_VERSION"), "\"")))]
209+
#![cfg_attr(not(docsrs), doc = "version = \"*\"")]
206210
//! # this is necessary to automatically initialize the Python interpreter
207211
//! features = ["auto-initialize"]
208212
//! ```

src/num_bigint.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@
1717
//!
1818
//! ```toml
1919
//! [dependencies]
20-
//! # change * to the latest versions
2120
//! num-bigint = "*"
22-
//! pyo3 = { version = "*", features = ["num-bigint"] }
21+
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643
22+
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"num-bigint\"] }")))]
23+
#![cfg_attr(
24+
not(docsrs),
25+
doc = "pyo3 = { version = \"*\", features = [\"num-bigint\"] }"
26+
)]
2327
//! ```
2428
//!
2529
//! Note that you must use compatible versions of num-bigint and PyO3.

src/num_complex.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414
//! [dependencies]
1515
//! # change * to the latest versions
1616
//! num-complex = "*"
17-
//! pyo3 = { version = "*", features = ["num-complex"] }
17+
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643
18+
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"), "\", features = [\"num-complex\"] }")))]
19+
#![cfg_attr(
20+
not(docsrs),
21+
doc = "pyo3 = { version = \"*\", features = [\"num-complex\"] }"
22+
)]
1823
//! ```
1924
//!
2025
//! Note that you must use compatible versions of num-complex and PyO3.

0 commit comments

Comments
 (0)