Skip to content

Commit

Permalink
chore: leverage cargo's workspace inheritance
Browse files Browse the repository at this point in the history
Previously, we would specify the version and path of our workspace dependencies in each of our crates. This is error prone as libp2p#3658 (comment) for example shows. Problems like these happened in the past too.

There is no need for us to ever depend on a earlier version than the most current one in our crates. It thus makes sense that we manage this version in a single place.

Cargo supports a feature called "workspace inheritance" which allows us to share a dependency declaration across a workspace and inherit it with `{ workspace = true }`.

We do this for all our workspace dependencies and for the MSRV.

Resolves libp2p#3787.

Pull-Request: libp2p#3715.
  • Loading branch information
thomaseizinger authored May 2, 2023
1 parent 1aa2c58 commit 2242b8b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 0.11.0 - unreleased

- Raise MSRV to 1.65.
See [PR 3715].

[PR 3715]: https://github.com/libp2p/rust-libp2p/pull/3715

## 0.10.2

- Store server `PeerId`s in `HashSet` to avoid duplicates and lower memory consumption.
Expand Down
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "libp2p-autonat"
edition = "2021"
rust-version = "1.62.0"
rust-version = { workspace = true }
description = "NAT and firewall detection for libp2p"
version = "0.10.2"
version = "0.11.0"
authors = ["David Craven <david@craven.ch>", "Elena Frank <elena.frank@protonmail.com>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand All @@ -15,18 +15,18 @@ async-trait = "0.1"
futures = "0.3"
futures-timer = "3.0"
instant = "0.1"
libp2p-core = { version = "0.39.0", path = "../../core" }
libp2p-swarm = { version = "0.42.1", path = "../../swarm" }
libp2p-request-response = { version = "0.24.0", path = "../request-response" }
libp2p-identity = { version = "0.1.0", path = "../../identity" }
libp2p-core = { workspace = true }
libp2p-swarm = { workspace = true }
libp2p-request-response = { workspace = true }
libp2p-identity = { workspace = true }
log = "0.4"
rand = "0.8"
quick-protobuf = "0.8"

[dev-dependencies]
async-std = { version = "1.10", features = ["attributes"] }
env_logger = "0.10"
libp2p-swarm-test = { path = "../../swarm-test" }
libp2p-swarm-test = { workspace = true }

# Passing arguments to the docsrs builder in order to properly document cfg's.
# More information: https://docs.rs/about/builds#cross-compiling
Expand Down

0 comments on commit 2242b8b

Please sign in to comment.