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

Update clap requirement from 2.34.0 to 3.0.5 #10262

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 6, 2022

Updates the requirements on clap to permit the latest version.

Release notes

Sourced from clap's releases.

v3.0.5

[3.0.5] - 2022-01-05

Fixes

docs:

  • Cleaned up code blocks in tutorials (#3261)
  • Clean up quotes in ArgMatches asserts
  • List correct replacement for deprecated Parser::from_clap (#3257)
Changelog

Sourced from clap's changelog.

[3.0.5] - 2022-01-05

Fixes

docs:

  • Cleaned up code blocks in tutorials (#3261)
  • Clean up quotes in ArgMatches asserts
  • List correct replacement for deprecated Parser::from_clap (#3257)

[3.0.4] - 2022-01-04

Features

  • For very limited cases, like cargo, expose ArgMatches::is_valid_arg to avoid panicing on undefined arguments

[3.0.3] - 2022-01-04

Fixes

  • Specify cause of debug assert failure

[3.0.2] - 2022-01-04

Fixes

  • Ignore Last when checking hyphen values (see #3249 for details)
  • Help catch bugs with #[must_use]

[3.0.1] - 2022-01-03

Fixes

  • Don't panic when getting number of values (#3241)
  • Don't warn when using default_value_t derive attribute with a Subcommand (#3245)

Documentation

  • Added name attribute to ArgEnum variant derive reference

[3.0.0] - 2021-12-31

Note: clap v3 has been in development for several years and has changed hands multiple times. Unfortunately, our changelog might be incomplete, whether in changes or their motivation.

Highlights

A special thanks to the maintainers, contributors, beta users, and sponsors who have helped along this journey, especially kbknapp.

... (truncated)

Commits
  • ef823bb chore: Release
  • 0238a57 docs: Update changelog
  • ad55cd5 Merge pull request #3264 from epage/external
  • faf3861 fix(parser): Loosen asserts for now
  • 2074c56 Merge pull request #3261 from epage/fix-borked-formatting
  • 7110401 docs: Fix messed up highlighting
  • a61ad34 docs(changelog): Call out more breaking changes
  • e9f6ef6 fix(parser): Fix more panic quotes
  • 2b2e2c9 fix(parser): Fix quoting in panic
  • 690da48 Merge pull request #3257 from Tiwalun/patch-1
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [clap](https://github.com/clap-rs/clap) to permit the latest version.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](clap-rs/clap@clap_generate-v3.0.0-rc.0...v3.0.5)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the A-build-dependencies Area: [build-dependencies] label Jan 6, 2022
@dependabot dependabot bot requested a review from alexcrichton January 6, 2022 02:04
@rust-highfive
Copy link

r? @ehuss

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 6, 2022
@ehuss
Copy link
Contributor

ehuss commented Jan 6, 2022

@dependabot ignore this major version

@dependabot dependabot bot closed this Jan 6, 2022
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Jan 6, 2022

OK, I won't notify you about version 3.x.x again, unless you re-open this PR or update to a 3.x.x release yourself.

@dependabot dependabot bot deleted the dependabot/cargo/clap-3.0.5 branch January 6, 2022 02:09
@epage epage mentioned this pull request Jan 6, 2022
bors added a commit that referenced this pull request Jan 11, 2022
Port cargo to clap3

### What does this PR try to resolve?

This moves cargo to the latest major version of clap.

This supersedes #10259  and #10262

### How should we test and review this PR?

For testing, I mostly relied on existing tests.  I did manually validate that `cargo run <non-escaped command args>` behaved the same between both
```console
$ cargo run release --help
    Finished dev [unoptimized + debuginfo] target(s) in 0.22s
     Running `target/debug/cargo-release release --help`
cargo-release 0.18.8
...

$ cargo run --manifest-path ../cargo/Cargo.toml -- run release --help
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
     Running `/home/epage/src/personal/cargo/target/debug/cargo run release --help`
    Finished dev [unoptimized + debuginfo] target(s) in 1.31s
     Running `target/debug/cargo-release release --help`
cargo-release 0.18.8
...
```

For reviewing, I split out each deprecation resolution into a separate commit so its easy to focus on more mechanical changes (most of the deprecation fixes) from interesting ones (the port, the `Arg::multiple` deprecation)

### Additional information

- One parser change found by `cargo_config::includes` is that clap 2
  would ignore any values after a `=` for flags.
  `cargo config --show-origin` is a flag but the test passed `--show-origin=yes` which
  happens to give the desired result for that test but is the same as
  `--show-origin=no` or `--show-origin=alien-invasion`.
- `ArgMatches` now panics when accessing an undefined argument but clap
  takes advantage of that for sharing code across commands that have
  different subsets of arguments defined.  I've extended clap so we can
  "look before you leap" and put the checks at the argument calls to
  start off with so its very clear what is tenuously shared.  This
  allows us to go in either direction in the future, either addressing
  how we are sharing between commands or by moving this down into the
  extension methods and pretending this clap feature doesn't exist
- On that topic, a test found clap-rs/clap#3263.  For now, there is a
  hack in clap.  Depending on how we fix that in clap for clap 4.0, we
  might need to re-address things in cargo.
- `value_of_os` now requires setting `allow_invalid_utf8`, otherwise it
  asserts.  To help catch this, I updated the argument definitions
  associated with lookups reported by:
  - `rg 'values?_os' src/`
  - `rg 'values?_of_os' src/`
- clap now reports `2` for usage errors, so we had to bypass clap's
  `exit` call to keep the same exit code.
- `cargo vendor --sync` did not use `multi_opt` and so it has both
  multiple occurrences **and** multiple values.  If we want to deprecate
  this, we'll need `unstable-grouped` to be stablized (or pin our clap
  version) and ensure each group has only 1 value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-dependencies Area: [build-dependencies] S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants