Skip to content

Commit 7afa1ea

Browse files
jaslordian
andauthored
Use workspace metadata and deps (#900)
* Extract common package fields to workspace * Extract deps to workspace * Add back `rust-version` field * Add missing * fix compile * Update Cargo.toml Co-authored-by: ordian <write@reusable.software> --------- Co-authored-by: ordian <write@reusable.software>
1 parent 4b20ddd commit 7afa1ea

File tree

22 files changed

+273
-203
lines changed

22 files changed

+273
-203
lines changed

Cargo.toml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
[workspace.package]
2+
authors = ["Parity Technologies <admin@parity.io>"]
3+
edition = "2021"
4+
license = "MIT OR Apache-2.0"
5+
homepage = "https://github.com/paritytech/parity-common"
6+
repository = "https://github.com/paritytech/parity-common"
7+
18
[workspace]
29
resolver = "2"
310
members = [
@@ -16,3 +23,59 @@ members = [
1623
"ethereum-types",
1724
"ethbloom",
1825
]
26+
27+
[workspace.dependencies]
28+
serde_json = "1.0.41"
29+
criterion = "0.5.1"
30+
rand = { version = "0.8.0", default-features = false }
31+
hex-literal = "0.4.1"
32+
scale-info = { version = ">=1.0, <3", default-features = false }
33+
quickcheck = "1"
34+
rustc-hex = { version = "2.0.1", default-features = false }
35+
static_assertions = "1.0.0"
36+
arbitrary = "1.0"
37+
tiny-keccak = "2.0"
38+
crunchy = { version = "0.2.2", default-features = false }
39+
serde = { version = "1.0.101", default-features = false }
40+
codec = { package = "parity-scale-codec", version = "3.7.4", default-features = false }
41+
log = { version = "0.4.17", default-features = false }
42+
schemars = ">=0.8.12"
43+
rand_xorshift = "0.3.0"
44+
tempfile = "3.1.0"
45+
smallvec = "1.0.0"
46+
parking_lot = "0.12.0"
47+
num_cpus = "1.10.1"
48+
regex = "1.3.1"
49+
rocksdb = { version = "0.22.0", default-features = false }
50+
alloc_counter = "0.0.4"
51+
sysinfo = "0.30.13"
52+
ctrlc = "3.1.4"
53+
chrono = "0.4"
54+
num-traits = { version = "0.2", default-features = false }
55+
integer-sqrt = "0.1"
56+
bytes = { version = "1", default-features = false }
57+
syn = "2.0.72"
58+
quote = "1.0.2"
59+
proc-macro2 = "1.0.8"
60+
byteorder = { version = "1.4.2", default-features = false }
61+
hex = { version = "0.4", default-features = false }
62+
num-bigint = "0.4.0"
63+
rug = { version = "1.6.0", default-features = false }
64+
jsonschema = { version = "0.23", default-features = false }
65+
serde_derive = "1.0.101"
66+
67+
ethbloom = { path = "./ethbloom", default-features = false }
68+
ethereum-types = { path = "./ethereum-types" }
69+
fixed-hash = { path = "./fixed-hash", default-features = false }
70+
uint = { path = "./uint", default-features = false }
71+
uint-crate = { path = "./uint", package = "uint", default-features = false }
72+
primitive-types = { path = "./primitive-types", default-features = false }
73+
impl-codec = { path = "./primitive-types/impls/codec", default-features = false }
74+
impl-num-traits = { path = "./primitive-types/impls/num-traits", default-features = false }
75+
impl-rlp = { path = "./primitive-types/impls/rlp", default-features = false }
76+
impl-serde = { path = "./primitive-types/impls/serde", default-features = false }
77+
kvdb = { path = "./kvdb" }
78+
kvdb-shared-tests = { path = "./kvdb-shared-tests" }
79+
keccak-hash = { path = "./keccak-hash" }
80+
rlp = { path = "./rlp" }
81+
rlp-derive = { path = "./rlp-derive" }

bounded-collections/Cargo.toml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
[package]
22
name = "bounded-collections"
33
version = "0.2.3"
4-
authors = ["Parity Technologies <admin@parity.io>"]
5-
license = "MIT OR Apache-2.0"
6-
homepage = "https://github.com/paritytech/parity-common"
74
description = "Bounded types and their supporting traits"
8-
edition = "2021"
5+
readme = "README.md"
96
rust-version = "1.79.0"
7+
authors.workspace = true
8+
edition.workspace = true
9+
license.workspace = true
10+
homepage.workspace = true
11+
repository.workspace = true
1012

1113
[dependencies]
12-
serde = { version = "1.0.101", default-features = false, optional = true, features=["alloc", "derive"] }
13-
codec = { version = "3.7.4", default-features = false, features = ["max-encoded-len"], package = "parity-scale-codec" }
14-
scale-info = { version = ">=1.0, <3", features = ["derive"], default-features = false }
15-
log = { version = "0.4.17", default-features = false }
16-
schemars = { version = ">=0.8.12", default-features = true, optional = true }
14+
serde = { workspace = true, features = ["alloc", "derive"], optional = true }
15+
codec = { workspace = true, features = ["max-encoded-len"] }
16+
scale-info = { workspace = true, features = ["derive"] }
17+
log = { workspace = true }
18+
schemars = { workspace = true, optional = true }
1719

1820
[dev-dependencies]
19-
serde_json = "1.0.41"
21+
serde_json = { workspace = true }
2022

2123
[features]
2224
default = ["std"]

ethbloom/Cargo.toml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
[package]
22
name = "ethbloom"
33
version = "0.14.1"
4-
authors = ["Parity Technologies <admin@parity.io>"]
54
description = "Ethereum bloom filter"
6-
license = "MIT OR Apache-2.0"
7-
documentation = "https://docs.rs/ethbloom"
8-
homepage = "https://github.com/paritytech/parity-common"
9-
repository = "https://github.com/paritytech/parity-common"
10-
edition = "2021"
115
rust-version = "1.56.1"
6+
authors.workspace = true
7+
edition.workspace = true
8+
license.workspace = true
9+
homepage.workspace = true
10+
repository.workspace = true
1211

1312
[dependencies]
14-
tiny-keccak = { version = "2.0", features = ["keccak"] }
15-
crunchy = { version = "0.2.2", default-features = false, features = ["limit_256"] }
16-
fixed-hash = { path = "../fixed-hash", version = "0.8", default-features = false }
17-
impl-serde = { path = "../primitive-types/impls/serde", version = "0.5", default-features = false, optional = true }
18-
impl-rlp = { path = "../primitive-types/impls/rlp", version = "0.4", default-features = false, optional = true }
19-
impl-codec = { version = "0.7.0", path = "../primitive-types/impls/codec", default-features = false, optional = true }
20-
scale-info = { version = ">=1.0, <3", features = ["derive"], default-features = false, optional = true }
13+
tiny-keccak = { workspace = true, features = ["keccak"] }
14+
crunchy = { workspace = true, features = ["limit_256"] }
15+
fixed-hash = { workspace = true }
16+
impl-serde = { workspace = true, optional = true }
17+
impl-rlp = { workspace = true, optional = true }
18+
impl-codec = { workspace = true, optional = true }
19+
scale-info = { workspace = true, features = ["derive"], optional = true }
2120

2221
[dev-dependencies]
23-
criterion = "0.5.1"
24-
rand = "0.8.0"
25-
hex-literal = "0.4.1"
22+
criterion = { workspace = true }
23+
rand = { workspace = true, default-features = true }
24+
hex-literal = { workspace = true }
2625

2726
[features]
2827
default = ["std", "rlp", "serialize", "rustc-hex"]

ethereum-types/Cargo.toml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
[package]
22
name = "ethereum-types"
33
version = "0.15.1"
4-
authors = ["Parity Technologies <admin@parity.io>"]
5-
license = "MIT OR Apache-2.0"
6-
homepage = "https://github.com/paritytech/parity-common"
74
description = "Ethereum types"
8-
edition = "2021"
95
rust-version = "1.60.0"
6+
authors.workspace = true
7+
edition.workspace = true
8+
license.workspace = true
9+
homepage.workspace = true
10+
repository.workspace = true
1011

1112
[dependencies]
12-
ethbloom = { path = "../ethbloom", version = "0.14", optional = true, default-features = false }
13-
fixed-hash = { path = "../fixed-hash", version = "0.8", default-features = false, features = ["rustc-hex"] }
14-
uint-crate = { path = "../uint", package = "uint", version = "0.10", default-features = false }
15-
primitive-types = { path = "../primitive-types", version = "0.13", features = ["rustc-hex"], default-features = false }
16-
impl-serde = { path = "../primitive-types/impls/serde", version = "0.5.0", default-features = false, optional = true }
17-
impl-rlp = { path = "../primitive-types/impls/rlp", version = "0.4", default-features = false, optional = true }
18-
impl-codec = { version = "0.7.0", path = "../primitive-types/impls/codec", default-features = false, optional = true }
19-
scale-info = { version = ">=1.0, <3", features = ["derive"], default-features = false, optional = true }
13+
ethbloom = { workspace = true, optional = true }
14+
fixed-hash = { workspace = true, features = ["rustc-hex"] }
15+
uint-crate = { workspace = true }
16+
primitive-types = { workspace = true, features = ["rustc-hex"] }
17+
impl-serde = { workspace = true, optional = true }
18+
impl-rlp = { workspace = true, optional = true }
19+
impl-codec = { workspace = true, optional = true }
20+
scale-info = { workspace = true, features = ["derive"], optional = true }
2021

2122
[dev-dependencies]
22-
serde_json = "1.0.41"
23+
serde_json = { workspace = true }
2324

2425
[features]
2526
default = ["std", "ethbloom", "rlp", "serialize"]

fixed-hash/Cargo.toml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
[package]
22
name = "fixed-hash"
33
version = "0.8.0"
4-
authors = ["Parity Technologies <admin@parity.io>"]
5-
license = "MIT OR Apache-2.0"
6-
homepage = "https://github.com/paritytech/parity-common"
7-
repository = "https://github.com/paritytech/parity-common"
84
description = "Macros to define custom fixed-size hash types"
9-
documentation = "https://docs.rs/fixed-hash/"
105
readme = "README.md"
11-
edition = "2021"
126
rust-version = "1.60"
7+
authors.workspace = true
8+
edition.workspace = true
9+
license.workspace = true
10+
homepage.workspace = true
11+
repository.workspace = true
1312

1413
[package.metadata.docs.rs]
1514
features = ["quickcheck", "api-dummy"]
1615

1716
[dependencies]
18-
quickcheck = { version = "1", optional = true }
19-
rand = { version = "0.8.0", optional = true, default-features = false }
20-
rustc-hex = { version = "2.0.1", optional = true, default-features = false }
21-
static_assertions = "1.0.0"
22-
arbitrary = { version = "1.0", optional = true }
17+
quickcheck = { workspace = true, optional = true }
18+
rand = { workspace = true, optional = true }
19+
rustc-hex = { workspace = true, optional = true }
20+
static_assertions = { workspace = true }
21+
arbitrary = { workspace = true, optional = true }
2322

2423
[dev-dependencies]
25-
rand_xorshift = "0.3.0"
26-
criterion = "0.5.1"
27-
rand = { version = "0.8.0", default-features = false, features = ["std_rng"] }
24+
rand_xorshift = { workspace = true }
25+
criterion = { workspace = true }
26+
rand = { workspace = true, default-features = false, features = ["std_rng"] }
2827

2928
[features]
3029
default = ["std", "rand", "rustc-hex"]

keccak-hash/Cargo.toml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22
name = "keccak-hash"
33
version = "0.11.0"
44
description = "`keccak-hash` is a set of utility functions to facilitate working with Keccak hashes (256/512 bits long)."
5-
authors = ["Parity Technologies <admin@parity.io>"]
6-
repository = "https://github.com/paritytech/parity-common"
75
readme = "README.md"
8-
license = "MIT OR Apache-2.0"
9-
edition = "2021"
106
rust-version = "1.56.1"
7+
authors.workspace = true
8+
edition.workspace = true
9+
license.workspace = true
10+
homepage.workspace = true
11+
repository.workspace = true
1112

1213
[dependencies]
13-
tiny-keccak = { version = "2.0", features = ["keccak"] }
14-
primitive-types = { path = "../primitive-types", version = "0.13", default-features = false }
14+
tiny-keccak = { workspace = true, features = ["keccak"] }
15+
primitive-types = { workspace = true }
1516

1617
[dev-dependencies]
17-
tempfile = "3.1.0"
18-
criterion = "0.5.1"
18+
tempfile = { workspace = true }
19+
criterion = { workspace = true }
1920

2021
[features]
2122
default = ["std"]

kvdb-memorydb/Cargo.toml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
[package]
22
name = "kvdb-memorydb"
33
version = "0.13.0"
4-
authors = ["Parity Technologies <admin@parity.io>"]
5-
repository = "https://github.com/paritytech/parity-common"
6-
description = "A key-value in-memory database that implements the `KeyValueDB` trait"
7-
license = "MIT OR Apache-2.0"
8-
edition = "2021"
4+
description = "A key-value in-memory database that implements the `KeyValueDB` trait"
95
rust-version = "1.56.1"
6+
authors.workspace = true
7+
edition.workspace = true
8+
license.workspace = true
9+
homepage.workspace = true
10+
repository.workspace = true
1011

1112
[dependencies]
12-
parking_lot = "0.12.0"
13-
kvdb = { version = "0.13", path = "../kvdb" }
13+
parking_lot = { workspace = true }
14+
kvdb = { workspace = true }
1415

1516
[dev-dependencies]
16-
kvdb-shared-tests = { path = "../kvdb-shared-tests", version = "0.11" }
17+
kvdb-shared-tests = { workspace = true }
1718

1819
[features]
1920
default = []

kvdb-rocksdb/Cargo.toml

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,41 @@
11
[package]
22
name = "kvdb-rocksdb"
33
version = "0.19.0"
4-
authors = ["Parity Technologies <admin@parity.io>"]
5-
repository = "https://github.com/paritytech/parity-common"
64
description = "kvdb implementation backed by RocksDB"
7-
license = "MIT OR Apache-2.0"
8-
edition = "2021"
95
rust-version = "1.56.1"
6+
authors.workspace = true
7+
edition.workspace = true
8+
license.workspace = true
9+
homepage.workspace = true
10+
repository.workspace = true
1011

1112
[[bench]]
1213
name = "bench_read_perf"
1314
harness = false
1415

1516
[dependencies]
16-
smallvec = "1.0.0"
17-
kvdb = { path = "../kvdb", version = "0.13" }
18-
num_cpus = "1.10.1"
19-
parking_lot = "0.12.0"
20-
regex = "1.3.1"
17+
smallvec = { workspace = true }
18+
kvdb = { workspace = true }
19+
num_cpus = { workspace = true }
20+
parking_lot = { workspace = true }
21+
regex = { workspace = true }
2122

2223
# OpenBSD and MSVC are unteested and shouldn't enable jemalloc:
2324
# https://github.com/tikv/jemallocator/blob/52de4257fab3e770f73d5174c12a095b49572fba/jemalloc-sys/build.rs#L26-L27
24-
[target.'cfg(any(target_os = "openbsd", target_env = "msvc"))'.dependencies.rocksdb]
25-
default-features = false
26-
features = ["snappy"]
27-
version = "0.22.0"
25+
[target.'cfg(any(target_os = "openbsd", target_env = "msvc"))'.dependencies]
26+
rocksdb = { workspace = true, features = ["snappy"] }
2827

29-
[target.'cfg(not(any(target_os = "openbsd", target_env = "msvc")))'.dependencies.rocksdb]
30-
default-features = false
31-
features = ["snappy", "jemalloc"]
32-
version = "0.22.0"
28+
[target.'cfg(not(any(target_os = "openbsd", target_env = "msvc")))'.dependencies]
29+
rocksdb = { workspace = true, features = ["snappy", "jemalloc"] }
3330

3431
[dev-dependencies]
35-
alloc_counter = "0.0.4"
36-
criterion = "0.5"
37-
ethereum-types = { path = "../ethereum-types", features = ["rand"] }
38-
kvdb-shared-tests = { path = "../kvdb-shared-tests", version = "0.11" }
39-
rand = "0.8.0"
40-
tempfile = "3.1.0"
41-
keccak-hash = { path = "../keccak-hash" }
42-
sysinfo = "0.30.13"
43-
ctrlc = "3.1.4"
44-
chrono = "0.4"
32+
alloc_counter = { workspace = true }
33+
criterion = { workspace = true }
34+
ethereum-types = { workspace = true, features = ["rand"] }
35+
kvdb-shared-tests = { workspace = true }
36+
rand = { workspace = true, default-features = true }
37+
tempfile = { workspace = true }
38+
keccak-hash = { workspace = true }
39+
sysinfo = { workspace = true }
40+
ctrlc = { workspace = true }
41+
chrono = { workspace = true }

kvdb-shared-tests/Cargo.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
[package]
22
name = "kvdb-shared-tests"
33
version = "0.11.0"
4-
authors = ["Parity Technologies <admin@parity.io>"]
5-
edition = "2021"
6-
rust-version = "1.56.1"
74
description = "Shared tests for kvdb functionality, to be executed against actual implementations"
8-
license = "MIT OR Apache-2.0"
5+
rust-version = "1.56.1"
6+
authors.workspace = true
7+
edition.workspace = true
8+
license.workspace = true
9+
homepage.workspace = true
10+
repository.workspace = true
911

1012
[dependencies]
11-
kvdb = { path = "../kvdb", version = "0.13" }
13+
kvdb = { workspace = true }

kvdb/Cargo.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
[package]
22
name = "kvdb"
33
version = "0.13.0"
4-
authors = ["Parity Technologies <admin@parity.io>"]
5-
repository = "https://github.com/paritytech/parity-common"
64
description = "Generic key-value trait"
7-
license = "MIT OR Apache-2.0"
8-
edition = "2021"
95
rust-version = "1.56.1"
6+
authors.workspace = true
7+
edition.workspace = true
8+
license.workspace = true
9+
homepage.workspace = true
10+
repository.workspace = true
1011

1112
[dependencies]
12-
smallvec = "1.0.0"
13+
smallvec = { workspace = true }

0 commit comments

Comments
 (0)