Skip to content

Commit 11f5070

Browse files
authored
Re-enable pyo3_stub_gen::derive (#17)
Reverts #15 with modified Cargo.toml setting. https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#the-role-of-the-version-key > Note: [crates.io](https://crates.io/) does not allow packages to be published with dependencies on code published outside of [crates.io](https://crates.io/) itself ([dev-dependencies](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#development-dependencies) are ignored). So the problem is `dev-dependency.pyo3-stub-gen` in `pyo3-stub-gen-derive/Cargo.toml` specifies version `0.1.0`, which did not exists on crates.io. This version specification is not needed, and removed in this PR. Then, we do not have cyclic dependency. We can release `pyo3-stub-gen-derive` first, and then `pyo3-stub-gen`.
1 parent 5c867cc commit 11f5070

File tree

10 files changed

+20
-25
lines changed

10 files changed

+20
-25
lines changed

Cargo.lock

+5-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ members = [
88
resolver = "2"
99

1010
[workspace.package]
11-
version = "0.1.0"
11+
version = "0.1.1"
1212
edition = "2021"
1313

1414
description = "Stub file (*.pyi) generator for PyO3"
@@ -18,9 +18,6 @@ license = "MIT OR Apache-2.0"
1818
readme = "README.md"
1919

2020
[workspace.dependencies]
21-
pyo3-stub-gen = { version = "0.1.0", path = "pyo3-stub-gen" }
22-
pyo3-stub-gen-derive = { version = "0.1.0", path = "pyo3-stub-gen-derive" }
23-
2421
anyhow = "1.0.86"
2522
insta = "1.39.0"
2623
inventory = "0.3.15"

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ To generate a stub file for this project, please modify it as follows:
2828

2929
```rust
3030
use pyo3::prelude::*;
31-
use pyo3_stub_gen::StubInfo;
32-
use pyo3_stub_gen_derive::gen_stub_pyfunction;
31+
use pyo3_stub_gen::{derive::gen_stub_pyfunction, StubInfo};
3332
use std::{env, path::*};
3433

3534
#[gen_stub_pyfunction] // Proc-macro attribute to register a function to stub file generator.

pyo3-stub-gen-derive/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ quote.workspace = true
1818
syn = { workspace = true, features = ["full", "extra-traits"] }
1919

2020
[dev-dependencies]
21-
pyo3-stub-gen.workspace = true
22-
21+
pyo3-stub-gen = { path = "../pyo3-stub-gen" }
2322
insta.workspace = true
2423
inventory.workspace = true
2524
prettyplease.workspace = true

pyo3-stub-gen-testing-mixed/Cargo.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
[package]
22
name = "pyo3-stub-gen-testing-mixed"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
edition = "2021"
55

66
[lib]
77
crate-type = ["cdylib", "rlib"]
88

99
[dependencies]
10-
pyo3-stub-gen.workspace = true
11-
pyo3-stub-gen-derive.workspace = true
10+
pyo3-stub-gen = { path = "../pyo3-stub-gen" }
1211
pyo3.workspace = true
1312

1413
[[bin]]

pyo3-stub-gen-testing-mixed/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use pyo3::prelude::*;
2-
use pyo3_stub_gen::StubInfo;
3-
use pyo3_stub_gen_derive::gen_stub_pyfunction;
2+
use pyo3_stub_gen::{derive::gen_stub_pyfunction, StubInfo};
43
use std::{env, path::*};
54

65
/// Gather information to generate stub files

pyo3-stub-gen-testing-pure/Cargo.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
[package]
22
name = "pyo3-stub-gen-testing-pure"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
edition = "2021"
55

66
[lib]
77
crate-type = ["cdylib", "rlib"]
88

99
[dependencies]
10-
pyo3-stub-gen.workspace = true
11-
pyo3-stub-gen-derive.workspace = true
10+
pyo3-stub-gen = { path = "../pyo3-stub-gen" }
1211
pyo3.workspace = true
1312

1413
[[bin]]

pyo3-stub-gen-testing-pure/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
mod readme {}
33

44
use pyo3::prelude::*;
5-
use pyo3_stub_gen::StubInfo;
6-
use pyo3_stub_gen_derive::gen_stub_pyfunction;
5+
use pyo3_stub_gen::{derive::gen_stub_pyfunction, StubInfo};
76
use std::{env, path::*};
87

98
/// Gather information to generate stub files

pyo3-stub-gen/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ itertools.workspace = true
1515
pyo3.workspace = true
1616
serde.workspace = true
1717
toml.workspace = true
18+
19+
[dependencies.pyo3-stub-gen-derive]
20+
version = "0.1.1"
21+
path = "../pyo3-stub-gen-derive"

pyo3-stub-gen/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
pub use inventory; // re-export to use in generated code
1+
pub use inventory;
2+
pub use pyo3_stub_gen_derive as derive; // re-export to use in generated code
23

34
mod generate;
45
mod pyproject;

0 commit comments

Comments
 (0)