Skip to content

Commit f6666dd

Browse files
jakelishmanIvanIsCoding
authored andcommitted
Use workspace versioning and relax hashbrown/indexmap deps (#956)
This commit does two things: first, switch a lot of metadata-definition to use the workspace-package inheritance allowed since Rust 1.64 (including several shared dependencies); second, relax the installation requirements on `indexmap` and `hashbrown` to allow both to use their most recent two majors. Dependents can then install `rustworkx-core` using either (say) `hashbrown 0.13.2` or `hashbrown 0.14.0` as desired, and similar between `indexmap 1.9.3` and `indexmap 2.0.0`. This commit leaves the lock file in the `hashbrown 0.14.0`, `indexmap 2.0.0` state, although note that some other crate dependents still use `hashbrown 0.12.3` internally, but this doesn't matter for the public API surface. I tested it manually in the `hashbrown 0.13.2`, `indexmap 1.9.3` state by updating those two dependencies with: cargo update -p '[email protected]' --precise 1.9.3 cargo update -p '[email protected]' --precise 0.13.2 cargo update -p '[email protected]' Co-authored-by: Ivan Carvalho <[email protected]>
1 parent fbdd235 commit f6666dd

File tree

3 files changed

+112
-83
lines changed

3 files changed

+112
-83
lines changed

Cargo.lock

Lines changed: 60 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,60 @@
11
[package]
22
name = "rustworkx"
33
description = "A python graph library implemented in Rust"
4-
version = "0.14.0"
5-
authors = ["Matthew Treinish <[email protected]>"]
6-
license = "Apache-2.0"
74
readme = "README.md"
8-
repository = "https://github.com/Qiskit/rustworkx"
95
keywords = ["python", "graph"]
10-
edition = "2021"
11-
rust-version = "1.64"
6+
version.workspace = true
7+
edition.workspace = true
8+
rust-version.workspace = true
9+
authors.workspace = true
10+
repository.workspace = true
11+
license.workspace = true
1212

1313
[workspace]
1414
members = [
1515
"rustworkx-core",
1616
]
1717

18-
[lib]
19-
name = "rustworkx"
20-
crate-type = ["cdylib"]
18+
[workspace.package]
19+
version = "0.14.0"
20+
edition = "2021"
21+
rust-version = "1.64"
22+
authors = ["Matthew Treinish <[email protected]>"]
23+
repository = "https://github.com/Qiskit/rustworkx"
24+
license = "Apache-2.0"
2125

22-
[dependencies]
26+
[workspace.dependencies]
2327
ahash = "0.8.3"
24-
petgraph = "0.6.3"
2528
fixedbitset = "0.4.2"
29+
hashbrown = { version = ">=0.13, <0.15", features = ["rayon"] }
30+
indexmap = { version = ">=1.9, <3", features = ["rayon"] }
31+
num-traits = "0.2"
2632
numpy = "0.19.0"
33+
petgraph = "0.6.3"
2734
rand = "0.8"
2835
rand_pcg = "0.3"
2936
rayon = "1.7"
30-
num-traits = "0.2"
37+
rayon-cond = "1.7"
38+
39+
[lib]
40+
name = "rustworkx"
41+
crate-type = ["cdylib"]
42+
43+
[dependencies]
44+
ahash.workspace = true
45+
fixedbitset.workspace = true
46+
hashbrown.workspace = true
47+
indexmap.workspace = true
48+
ndarray-stats = "0.5.1"
3149
num-bigint = "0.4"
3250
num-complex = "0.4"
33-
ndarray-stats = "0.5.1"
51+
num-traits.workspace = true
52+
numpy.workspace = true
53+
petgraph.workspace = true
3454
quick-xml = "0.30"
55+
rand.workspace = true
56+
rand_pcg.workspace = true
57+
rayon.workspace = true
3558
serde = { version = "1.0", features = ["derive"] }
3659
serde_json = "1.0"
3760
rustworkx-core = { path = "rustworkx-core", version = "=0.14.0" }
@@ -40,18 +63,10 @@ rustworkx-core = { path = "rustworkx-core", version = "=0.14.0" }
4063
version = "0.19.2"
4164
features = ["extension-module", "hashbrown", "num-bigint", "num-complex", "indexmap"]
4265

43-
[dependencies.hashbrown]
44-
version = "0.13"
45-
features = ["rayon"]
46-
4766
[dependencies.ndarray]
4867
version = "^0.15.6"
4968
features = ["rayon"]
5069

51-
[dependencies.indexmap]
52-
version = "1.9"
53-
features = ["rayon"]
54-
5570
[dependencies.sprs]
5671
version = "^0.11"
5772
features = ["multi_thread"]

rustworkx-core/Cargo.toml

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,25 @@
11
[package]
22
name = "rustworkx-core"
3-
version = "0.14.0"
4-
edition = "2021"
5-
authors = ["Matthew Treinish <[email protected]>"]
63
description = "Rust APIs used for rustworkx algorithms"
7-
license = "Apache-2.0"
84
readme = "README.md"
9-
repository = "https://github.com/Qiskit/rustworkx"
10-
homepage = "https://github.com/Qiskit/rustworkx/tree/main/rustworkx-core"
115
keywords = ["graph"]
12-
rust-version = "1.64"
6+
homepage = "https://github.com/Qiskit/rustworkx/tree/main/rustworkx-core"
7+
version.workspace = true
8+
edition.workspace = true
9+
rust-version.workspace = true
10+
authors.workspace = true
11+
repository.workspace = true
12+
license.workspace = true
1313

1414
[dependencies]
15-
ahash = "0.8.3"
16-
fixedbitset = "0.4.2"
17-
petgraph = "0.6.3"
18-
rand = "0.8.5"
19-
rand_pcg = "0.3.1"
20-
rayon = "1.7"
21-
num-traits = "0.2"
15+
ahash.workspace = true
16+
fixedbitset.workspace = true
17+
hashbrown.workspace = true
18+
indexmap.workspace = true
19+
num-traits.workspace = true
20+
petgraph.workspace = true
2221
priority-queue = "1.3"
22+
rand.workspace = true
23+
rand_pcg.workspace = true
24+
rayon.workspace = true
2325
rayon-cond = "0.3"
24-
25-
[dependencies.hashbrown]
26-
version = "0.13"
27-
features = ["rayon"]
28-
29-
[dependencies.indexmap]
30-
version = "1.9"
31-
features = ["rayon"]

0 commit comments

Comments
 (0)