Skip to content

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

@opara-tor

Description

@opara-tor

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:

   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.)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions