#cargo-toml #toml #update #cargo #dependencies #semver #latest-version

build dependency-refresh

This tool is meant to update rust dependency versions within Cargo.toml files

12 releases

Uses old Rust 2015

0.3.0 Sep 11, 2021
0.2.0 Apr 12, 2021
0.1.12 Mar 26, 2021
0.1.11 Sep 29, 2020
0.1.5 May 16, 2019

#486 in Build Utils

GPL-3.0-only

26KB
316 lines

dependency-refresh

dependency-refresh is meant to update rust dependency versions within Cargo.toml files.

The tool reads the given toml files and checks online at https://crates.io for the latest version of each dependency.

By default dependency-refresh compares the versions according to Semantic versioning (see https://semver.org/) rules the same way Cargo does (see https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html). Therefore, dependency-refresh does not update the version in the local Cargo.toml, if the new crates.io version is a compatible minor update. This behavior usually is desired, because Cargo uses the latest compatible version anyway. To override this, pass the option --exact to dependency-refresh. That will disable Semantic versioning compare and will always trigger an update of the local version.

I am aware that there is room for improvement in my rust code, so feel free to comment or submit small patches.

Example usage with SemVer (default)

$ ./target/debug/dr ./Cargo.toml
Reading file: ./Cargo.toml
        Found: structopt
                Local version:  0.3.0
                Online version: 0.3.21
        Found: toml_edit
                Local version:  0.2.0
                Online version: 0.2.0
        Found: reqwest
                Local version:  0.11.0
                Online version: 0.11.2
        Found: serde_json
                Local version:  1.0.0
                Online version: 1.0.64
        Found: semver
                Local version:  0.10.0
                Online version: 0.11.0
        Updating: semver 0.10.0 => 0.11.0

Example usage with exact matching (no SemVer)

$ ./target/debug/dr --exact ./Cargo.toml
Reading file: ./Cargo.toml
        Found: structopt
                Local version:  0.3.0
                Online version: 0.3.21
        Found: toml_edit
                Local version:  0.2.0
                Online version: 0.2.0
        Found: reqwest
                Local version:  0.11.0
                Online version: 0.11.2
        Found: serde_json
                Local version:  1.0.0
                Online version: 1.0.64
        Found: semver
                Local version:  0.10.0
                Online version: 0.11.0
        Updating: structopt 0.3.0 => 0.3.21
        Updating: serde_json 1.0.0 => 1.0.64
        Updating: semver 0.10.0 => 0.11.0
        Updating: reqwest 0.11.0 => 0.11.2

Installation

Arch linux https://aur.archlinux.org/packages/rust-dependency-refresh/

Dependencies

~8–21MB
~287K SLoC