Skip to content
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

crate_universe re-pinning now defaults to "workspace" #1723

Merged
merged 2 commits into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crate_universe/private/crates_repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ that is called behind the scenes to update dependencies.

| Value | Cargo command |
| --- | --- |
| Any of [`true`, `1`, `yes`, `on`] | `cargo update` |
| `workspace` | `cargo update --workspace` |
| Any of [`true`, `1`, `yes`, `on`, `workspace`] | `cargo update --workspace` |
| Any of [`full`, `eager`, `all`] | `cargo update` |
| `package_name` | `cargo upgrade --package package_name` |
| `package_name@1.2.3` | `cargo upgrade --package package_name --precise 1.2.3` |

Expand Down
4 changes: 2 additions & 2 deletions crate_universe/private/crates_vendor.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ call against the generated workspace. The following table describes how to contr

| Value | Cargo command |
| --- | --- |
| Any of [`true`, `1`, `yes`, `on`] | `cargo update` |
| `workspace` | `cargo update --workspace` |
| Any of [`true`, `1`, `yes`, `on`, `workspace`] | `cargo update --workspace` |
| Any of [`full`, `eager`, `all`] | `cargo update` |
| `package_name` | `cargo upgrade --package package_name` |
| `package_name@1.2.3` | `cargo upgrade --package package_name --precise 1.2.3` |

Expand Down
8 changes: 4 additions & 4 deletions crate_universe/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ impl FromStr for CargoUpdateRequest {
fn from_str(s: &str) -> Result<Self, Self::Err> {
let lower = s.to_lowercase();

if ["1", "yes", "true", "on"].contains(&lower.as_str()) {
if ["eager", "full", "all"].contains(&lower.as_str()) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open to naming suggestions 😄

return Ok(Self::Eager);
}

if ["workspace", "minimal"].contains(&lower.as_str()) {
if ["1", "yes", "true", "on", "workspace", "minimal"].contains(&lower.as_str()) {
return Ok(Self::Workspace);
}

Expand Down Expand Up @@ -361,7 +361,7 @@ mod test {

#[test]
fn deserialize_cargo_update_request_for_eager() {
for value in ["1", "yes", "true", "on"] {
for value in ["all", "full", "eager"] {
let request = CargoUpdateRequest::from_str(value).unwrap();

assert_eq!(request, CargoUpdateRequest::Eager);
Expand All @@ -370,7 +370,7 @@ mod test {

#[test]
fn deserialize_cargo_update_request_for_workspace() {
for value in ["workspace", "minimal"] {
for value in ["1", "true", "yes", "on", "workspace", "minimal"] {
let request = CargoUpdateRequest::from_str(value).unwrap();

assert_eq!(request, CargoUpdateRequest::Workspace);
Expand Down
2 changes: 1 addition & 1 deletion crate_universe/version.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
""" Version info for the `cargo-bazel` repository """

VERSION = "0.6.0"
VERSION = "0.7.0"
8 changes: 4 additions & 4 deletions docs/crate_universe.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ that is called behind the scenes to update dependencies.

| Value | Cargo command |
| --- | --- |
| Any of [`true`, `1`, `yes`, `on`] | `cargo update` |
| `workspace` | `cargo update --workspace` |
| Any of [`true`, `1`, `yes`, `on`, `workspace`] | `cargo update --workspace` |
| Any of [`full`, `eager`, `all`] | `cargo update` |
| `package_name` | `cargo upgrade --package package_name` |
| `package_name@1.2.3` | `cargo upgrade --package package_name --precise 1.2.3` |

Expand Down Expand Up @@ -372,8 +372,8 @@ call against the generated workspace. The following table describes how to contr

| Value | Cargo command |
| --- | --- |
| Any of [`true`, `1`, `yes`, `on`] | `cargo update` |
| `workspace` | `cargo update --workspace` |
| Any of [`true`, `1`, `yes`, `on`, `workspace`] | `cargo update --workspace` |
| Any of [`full`, `eager`, `all`] | `cargo update` |
| `package_name` | `cargo upgrade --package package_name` |
| `package_name@1.2.3` | `cargo upgrade --package package_name --precise 1.2.3` |

Expand Down