-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade dependency to specific version #177
Comments
@jechas01 I think you can already use |
Oh, does that update the version of existing dependencies? I was under the
impression that the --vers flag for add was just to specify the version of
new dependencies.
…On Thu, Nov 16, 2017, 17:33 Andronik Ordian ***@***.***> wrote:
@jechas01 <https://github.com/jechas01> I think you can already use cargo
add --vers for this, though it wouldn't work with workspaces.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#177 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABe0rddo6wTgQH_diXff1rqLTBHkxYj-ks5s3Lg7gaJpZM4QhOeI>
.
|
Yeah, we should probably document that: running |
Ah, ok, good to know. It would still be massively helpful to have it work
for workspaces. For large multi-crate projects, managing duplicate
dependencies can get cumbersome, and a way to ensure that the same version
is used across all workspace crates would be awesome.
…On Thu, Nov 16, 2017, 19:28 Andronik Ordian ***@***.***> wrote:
Yeah, we should probably document that: running cargo add <crate> will
overwrite entry in Cargo.toml (with or w/o --vers flag).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#177 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABe0rWBoBqgycsJfTHFeeroBkurQGtK3ks5s3NMbgaJpZM4QhOeI>
.
|
That's an interesting point. I've also been using Maybe we should change the CLI to something like:
Here, the default would remain unchanged, but the experience of upgrading a single dependency would be better (no longer need a We'd probably want to deprecate the old way of specifying specific dependencies ( Thoughts? I shouldn't think this should be too difficult, so I might look at implementing this over the weekend. |
I'm starting to look at this now. It probably makes sense to try and stick as close as possible to
|
Fixes killercup#177. If this flag is provided, all dependencies upgraded will be blindly upgraded to the version specified. Also, there has been substantial refactoring. The new `Manifests` and `Dependencies` structs now hold the logic for upgrade. This allows us to commonise the cases of a single upgrade and full workspace upgrade quite considerably. This should also make it fairly simple to extend to permit providing a list of packages to confine upgrades to. Also does some tidying up for the new `--precise` option. Most significantly, we now have a test for this functionality.
200: Add `--precise` flag for cargo-upgrade r=bjgill a=bjgill Fixes #177. If this flag is provided, all dependencies upgraded will be blindly upgraded to the version specified. Added a test for this new feature. Also, there has been substantial refactoring. The new `Manifests` and `Dependencies` structs now hold the logic for upgrade. This allows us to commonise the cases of a single and full workspace upgrade quite considerably. EDIT: this also fixes #182 (I'll open a new issue for alternate registries)
Pushing a dependency to the latest version isn't always the desired behavior. For example, if one of your crate's dependencies depends on an older version of error_chain than the latest, it can cause problems since you can end up with two incompatible versions of the generated types.
It would be nice to have an option to specify the version to upgrade (or even downgrade) to, either in the
cargo-upgrade
command, or in a newcargo-set-version
command, preferably that would work for the entire workspace.The text was updated successfully, but these errors were encountered: