Skip to content

Commit e8b9a99

Browse files
authored
Merge pull request #1694 from mejrs/pyo3version
automagically update pyo3 version in toml examples
2 parents 6009cc8 + cfedd87 commit e8b9a99

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

src/lib.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@
149149
//! crate-type = ["cdylib"]
150150
//!
151151
//! [dependencies.pyo3]
152-
//! version = "0.13.2"
152+
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643
153+
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("version = \"", env!("CARGO_PKG_VERSION"), "\"")))]
154+
#![cfg_attr(not(docsrs), doc = "version = \"*\"")]
153155
//! features = ["extension-module"]
154156
//! ```
155157
//!
@@ -200,7 +202,9 @@
200202
//!
201203
//! ```toml
202204
//! [dependencies.pyo3]
203-
//! version = "0.13.2"
205+
// workaround for `extended_key_value_attributes`: https://github.com/rust-lang/rust/issues/82768#issuecomment-803935643
206+
#![cfg_attr(docsrs, cfg_attr(docsrs, doc = concat!("version = \"", env!("CARGO_PKG_VERSION"), "\"")))]
207+
#![cfg_attr(not(docsrs), doc = "version = \"*\"")]
204208
//! # this is necessary to automatically initialize the Python interpreter
205209
//! features = ["auto-initialize"]
206210
//! ```

src/num_bigint.rs

+6-2
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

+6-1
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)