killercup / killercup/cargo-edit

set-version: Add option to *not* change dependencies of other crates in workspace

Open
#952 2 comments 1 reaction 0 assignees View on GitHub
cargo-set-version enhancement
Dominant language
Rust
Stars
3.5k
Forks
166
PR merge metrics
No merged PRs in 30d

Description

When you run `cargo set-version --bump minor -p foo` in a workspace that has crates "foo" and "bar", and "bar" has a dependency of "foo", the Cargo.toml for "bar" will also be updated to bump the version of "foo". It would look something like:

```text
Upgrading foo from 1.6.0 to 1.7.0
Updating bar's dependency from 1.6.0 to 1.7.0
```

This is okay as a default, but sometimes you might not want to update "bar"s dependencies. For example say that "foo" gained a new feature (hence the minor version bump), but "bar" doesn't use the feature and works fine with "foo" 1.6.0. By increasing "bar"s dependency version, it forces all users of "bar" to upgrade their version of "foo" even though it's unnecessary.

In a workspace with only two crates this is easy to work around (just git stage the specific changes you want), but in a workspace with many crates and many version bumps (and which may be automated with a script), this can be a bit painful.

It would be nice if there was a flag where you could disable this feature. (I also tried `cargo set-version --bump minor -p foo --exclude bar`, but that didn't seem to help.)

Contributor guide

Open the contributing guide

Research direction

Start at the set-version command entry point and trace how workspace dependency updates and --exclude are handled. Reproduce the foo/bar workspace case, then verify that a new opt-out option leaves bar's dependency unchanged while still bumping foo; add or run focused CLI tests if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.