cargo-edit-0.13.10/.cargo_vcs_info.json0000644000000001361046102023000132360ustar { "git": { "sha1": "167dbfa57cb3757b167d5b926f2e01f32d47f588" }, "path_in_vcs": "" }cargo-edit-0.13.10/.gitattributes000064400000000000000000000000441046102023000146750ustar 00000000000000tests/fixtures/*/Cargo.toml.* -text cargo-edit-0.13.10/.github/workflows/build.yml000064400000000000000000000052651046102023000172330ustar 00000000000000name: build permissions: contents: read on: [push, pull_request] env: RUST_BACKTRACE: 1 CARGO_TERM_COLOR: always CLICOLOR: 1 jobs: build: permissions: contents: none name: CI needs: [test, lockfile, rustfmt, clippy] runs-on: ubuntu-latest if: "always()" steps: - name: Failed run: exit 1 if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')" test: name: Test strategy: matrix: os: ["ubuntu-latest", "windows-latest", "macos-latest"] rust: ["stable"] continue-on-error: ${{ matrix.rust != 'stable' }} runs-on: ${{ matrix.os }} steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ matrix.rust }} - uses: Swatinem/rust-cache@v2 - name: Build run: cargo test --no-run - name: Test run: cargo test lockfile: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: stable - uses: Swatinem/rust-cache@v2 - name: "Is lockfile updated?" run: cargo update --workspace --locked rustfmt: name: rustfmt runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: stable components: rustfmt - uses: Swatinem/rust-cache@v2 - name: Check formatting run: cargo fmt --all -- --check clippy: name: clippy runs-on: ubuntu-latest permissions: security-events: write # to upload sarif results steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: stable components: clippy - uses: Swatinem/rust-cache@v2 - name: Install SARIF tools run: cargo install clippy-sarif --locked - name: Install SARIF tools run: cargo install sarif-fmt --locked - name: Check run: > cargo clippy --workspace --all-features --all-targets --message-format=json | clippy-sarif | tee clippy-results.sarif | sarif-fmt continue-on-error: true - name: Upload uses: github/codeql-action/upload-sarif@v3 with: sarif_file: clippy-results.sarif wait-for-processing: true - name: Report status run: cargo clippy --workspace --all-features --all-targets -- -D warnings --allow deprecated cargo-edit-0.13.10/.github/workflows/post-release.yml000064400000000000000000000025311046102023000205300ustar 00000000000000name: post-release on: push: tags: - "v*" permissions: contents: read jobs: create-release: permissions: contents: write # for actions/create-release to create a release name: create-release runs-on: ubuntu-latest outputs: upload_url: ${{ steps.release.outputs.upload_url }} release_version: ${{ env.RELEASE_VERSION }} steps: - name: Get the release version from the tag shell: bash if: env.RELEASE_VERSION == '' run: | # See: https://github.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/m-p/32167/highlight/true#M1027 echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV echo "version is: ${{ env.RELEASE_VERSION }}" - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 1 - name: Generate Release Notes run: | ./.github/workflows/release-notes.py --tag ${{ env.RELEASE_VERSION }} --output notes-${{ env.RELEASE_VERSION }}.md cat notes-${{ env.RELEASE_VERSION }}.md - name: Create GitHub release id: release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ env.RELEASE_VERSION }} release_name: ${{ env.RELEASE_VERSION }} body_path: notes-${{ env.RELEASE_VERSION }}.md cargo-edit-0.13.10/.github/workflows/release-notes.py000075500000000000000000000020051046102023000205210ustar 00000000000000#!/usr/bin/env python3 import argparse import re import pathlib import sys _STDIO = pathlib.Path("-") def main(): parser = argparse.ArgumentParser() parser.add_argument("-i", "--input", type=pathlib.Path, default="CHANGELOG.md") parser.add_argument("--tag", required=True) parser.add_argument("-o", "--output", type=pathlib.Path, required=True) args = parser.parse_args() if args.input == _STDIO: lines = sys.stdin.readlines() else: with args.input.open() as fh: lines = fh.readlines() version = args.tag.lstrip("v") note_lines = [] for line in lines: if line.startswith("## ") and version in line: note_lines.append(line) elif note_lines and line.startswith("## "): break elif note_lines: note_lines.append(line) notes = "".join(note_lines).strip() if args.output == _STDIO: print(notes) else: args.output.write_text(notes) if __name__ == "__main__": main() cargo-edit-0.13.10/.gitignore000064400000000000000000000000071046102023000137710ustar 00000000000000target cargo-edit-0.13.10/CHANGELOG.md000064400000000000000000000351211046102023000136170ustar 00000000000000# Changelog The format is based on [Keep a Changelog]. [Keep a Changelog]: http://keepachangelog.com/en/1.0.0/ ## Unreleased - ReleaseDate ## 0.13.10 - 2026-04-17 ### Features - Support for TOML 1.1 ## 0.13.9 - 2026-03-02 ### Fixes - Report error when failing to update lockfile ## 0.13.8 - 2025-11-11 ### Internal - Dependency updates ## 0.13.7 - 2025-08-08 ### Internal - Dependency updates ## 0.13.6 - 2025-05-27 ### Fixes - *(upgrade)* Don't update git dependencies that were excluded ## 0.13.5 - 2025-05-27 ### Fixes - Add logging ## 0.13.4 - 2025-05-13 ### Fixes - Add logging - Add `-n` as a short for `--dry-run` ## 0.13.3 - 2025-05-01 ### Fixes - *(upgrade)* Provide more context on registry errors ## 0.13.2 - 2025-03-17 ### Fixes - *(upgrade)* Don't silence network errors ## 0.13.1 - 2025-01-23 ### Performance - Changed compilation settings ## 0.13.0 - 2024-09-16 ### Breaking Changes - *(upgrade)* Remove of `--offline` as we don't have local caching for sparse registry ### Fixes - *(upgrade)* Switched from git to sparse registry for faster runs ## 0.12.3 - 2024-05-30 ### Internal - Dependency update ## 0.12.2 - 2023-09-11 ### Features - Stylize help output ## 0.12.1 - 2023-08-28 ### Fixes - Fix building on nightlies ## 0.12.0 - 2023-05-25 ### Breaking Changes - *(rm)* Removed in favor of `cargo remove` - *(upgrade)* `--recursive ` now defaults to the same as `--compatible ` ### Features - MSRV-aware setting of version requirements with `--ignore-rust-version` and `--rust-version ` flags - Resolver still won't be MSRV aware - Lack of transparency in filtering out incompatible rust-versions (no warnings, no details in errors) ### Fixes - Don't upgrade indirect dependencies with `--incompatible allow --compatible deny` ## 0.11.11 - 2023-05-11 `upgrade` - `--locked --dry-run` should error if there are changes ## 0.11.10 - 2023-05-11 ### Fixes `upgrade` - In summary lists, coalece long lists - Reduce padding, consuming precious vertical space on large workspaces - Move unchanged requirements out of table unless `--verbose`, moving the existing `--verbose` to `--verbose --verbose`. ## 0.11.9 - 2023-02-23 ### Fixes `upgrade` - Report dependency tables to `stdout`, instead of `stderr` ## 0.11.8 - 2023-01-26 ### Internal - Dependencies updated ## 0.11.7 - 2022-12-23 ### Fixes - Improved build times ## 0.11.6 - 2022-11-14 ### Fixes `upgrade` - Ensure precise version setting runs - Remove error blocking precise version setting ## 0.11.5 - 2022-10-09 ## 0.11.4 - 2022-10-06 ### Features `set-version` - Modify `workspace.package.version` and all dependents, when needed ### Fixes `set-version` - Update versions in `workspace.dependencies` in virtual workspaces - Be more consistent with rest of cargo in output ## 0.11.3 - 2022-09-28 ### Fixes - Polished help output ## 0.11.2 - 2022-09-22 ### Features `upgrade` - Upgrade `workspace.dependencies` (new in Rust 1.64) ## 0.11.1 - 2022-09-16 ### Fixes `upgrade` - Changed `--compatible`, `--incompatible`, and `--pinned` from accepting `true|false` to `allow|ignore` (with aliases for compatibility - While we are still working out how we want to express these options, this at least removes the confusion over `--compatible false` looking like it is the same as `--incompatible`. ## 0.11.0 - 2022-09-14 This release is another step in our effort to find the appropriate `cargo upgrade` workflow for merging into `cargo`. This new iteration is modeled on the idea "if we started from scratch, what would `cargo update` look like?". Besides getting us to think outside the box, I hope that we can deprecate `cargo update` and replace it with `cargo upgrade` (caution: this has not been passed by the cargo team). We need runtime with the proposed behavior with feedback to see how well the idea works in theory and if it justifies the ecosystem churn of deprecating `cargo update`. More concretely, the approach taken in this release is a `cargo update`-like command that implicitly modifies `Cargo.lock`. To this end - `cargo upgrade` now works on the whole workspace exclusively - This also resolves confusion over `--package`, `--exclude`, and the positional `PKGID` argument - This also removes any UI barriers for supporting workspace inheritance coming in 1.64 - `cargo upgrade -p serde@1.0.100` will act as if `cargo update -p serde --precise 1.0.100` was performed - Compatible versions are upgraded by default - Pass `--incompatible` or `--pinned` to upgrade to incompatible versions - Disable the default with `--compatible false` - See [this PR](https://github.com/killercup/cargo-edit/pull/804) for context on the trade offs A side benefit of this approach is that users will get an approximation of minimal-version resolution so long as they stay within `cargo add` and `cargo upgrade` and commit their `Cargo.lock` file. Please include in any [feedback](https://internals.rust-lang.org/t/feedback-on-cargo-upgrade-to-prepare-it-for-merging/17101): - An evaluation of current behavior that takes into account the exiting "care abouts" or any additional we don't have listed yet - An evaluation of how existing or new alternatives would better fit the full set of care abouts ### Breaking Changes `upgrade` - Compatible versions are upgraded by default, with opt-out via `--compatible false` - Pinned dependencies will be upgraded to compatible versions when `--compatible true`, reserving `--pinned` for incompatible upgrades - Incompatible versions require opting in with `-i` / `--incompatible` - When a version requirement is fully specified, the lock version will modified to use that version - Exclusively operate on the workspace - The positional argument for selecting dependencies to upgrade has moved to `--package ` - `--package` and `--exclude` now take crate names rather than dependencies names (matters when dependencies are renamed) ### Features `upgrade` - `--recursive ` for controlling how the lockfile is updated - Update git dependencies ### Fixes `upgrade` - Treat `3.2.x` as pinned - Update lockfile in offline mode - Don't touch the lockfile in dry-run - Prefer preserving the original version requirement over compatible version upgrades (in cases where we don't know how to preserve the format) ## 0.10.4 - 2022-07-29 ### Fixes `upgrade` - Hide "note" column when unused - Summarize uninteresting rows by default ## 0.10.3 - 2022-07-27 ### Fixes `upgrade` - Provide table view of upgrades, like `cargo outdated`, to raise visibility for why a change isn't made - Fix where we didn't respect `--offline` - Fix `--to-lockfile` to update non-registry version requirements - Update lockfile for upgraded requirements - Update `--help` to be consistent with `cargo add` `rm` - Update `--help` to be consistent with `cargo add` ## 0.10.2 - 2022-07-21 ### Fixes `upgrade` - Only fail on bad lockfile if `--to-lockfile` is set `rm` - Don't duplicate error messages ## 0.10.1 - 2022-07-15 ### Features `upgrade` - Note the `--pinned` flag when pinned dependencies are skipped ### Fixes `add` - Provide a failing command to tell people how to get it ## 0.10.0 - 2022-07-14 ### Breaking changes - Many programmatic APIs changed - `cargo add` remove in favor of the version included with cargo 1.62.0 - `cargo upgrade` skips pinned dependencies by default, run with `--pinned` to do them all - `cargo upgrade --skip-compatible` is now default, run with `--to-lockfile` to upgrade all - `cargo upgrade` now accepts dependency keys rather than crate names - `cargo upgrade` now preserves version req precision - `cargo upgrade --allow-prerelease` was removed to match `cargo add` ### Fixes All - Align console messages - Allow using `--manifest-path` with `--pkgid` - Allow relative paths with `--manifest-path` `upgrade` - Positional arguments are now dependency keys, allowing forcing of renamed dependencies to upgrade - Make compatible upgrades and precision preservation work together - Cleaned up output - Preserve user formatting of dependencies - Don't confuse dependencies ### Features `upgrade` - Always preserve version req precision - With `--verbose`, see why dependencies didn't upgrade - Error if upgrades possible with `--locked` - Allow multiple occurrences of `--pkgid` `rm` - Add `--target` flag - Add `--dry-run` flag ## 0.9.1 - 2022-05-17 ### Fixes set-version - Don't overwrite updated dependencies with stale data when modifying multiple packages ## 0.9.0 - 2022-03-28 In large part, this release is a test-bed for changes proposed as part of the path to merging `cargo-add` into cargo. See [internals](https://internals.rust-lang.org/t/feedback-on-cargo-add-before-its-merged/16024) for more background on the changes. ### Breaking Changes - Many programmatic APIs changed - Feature flag `vendored-libgit2` is activated by default cargo-add - Removed `--upgrade ` - Removed `--sort` - Removed `--allow-prerelease` - Removed `cargo add `, requiring `cargo add --git ` - Removed `--path ` in favor of `cargo add ` - Removed `--vers ` in favor of `cargo add @` - `--git` support is now feature gated as we work out how to expose it ### Features cargo-add - Lists available features - Warn when adding non-existent features - git `--tag` and `--rev` support - `--default-features` flag for when updating an existing entry - `--no-optional` flag for when updating an existing entry - Allow `,` to separate `--features` - Added `-F` short flag for `--features` - `cargo add serde +derive` feature activation - `--dry-run` support ### Fixes General - TOML 1.0 compliant parser - Use stderr for user messages - Improve detection for enabling colored output - Handle empty cargo config `source` table cargo-add - Allow `--registry` with `name@version` and path dependencies - Don't panic on `--target=` (ie empty target) - Cleaned up "Adding" message - Improve overwrite behavior (re-adding the same dependency) - Allow using both `--manifest-path` and `--package` - Remove invalid dependency activation - When adding an existing dependency to another table, reuse the existing source information (e.g. version requirement) cargo-rm - Don't create empty feature tables - Remove dep activation when no longer optional cargo-upgrade - Preserve version requirement precision (behind a feature flag) cargo-set-version - Allow `--metadata` to override version metadata - Improve dependent detection ## 0.8.0 - 2021-09-22 #### Breaking Changes Many programmatic APIs changed cargo-add - Dependency paths are now relative to current working directory, rather than affect crate root (#497) - Sane defaults when adding a dependency from within the workspace (#504) #### Features - New `vendored-openssl` crate feature (#447) - New `vendored-libgit2` crate feature (#488) - Support for dotted keys in TOML (#491) cargo-set-version - New command to bump crate versions (#482) - Automatically update all workspace dependents (#506) cargo-upgrade - Add `--exclude` (#446) #### Fixes - Fixed various bugs when interacting with the registry (e.g. #433, #484) - Read config files with extensions as added with Rust 1.39 (#439) - rustsec - Removed unmaintained `dirs` dependency (#440) - Remove dependency on old `hyper` v0.13 (#431) - Respect `--quiet` when updating the index (#462) - Lookup pkg id's relative to `--manifest-path` rather than current working directory (#505) cargo-add - Look up versions *after* updating the index (#483) - Allow optional build dependencies (#494) - Dependency paths are now relative to current working directory, rather than affect crate root (#497) - Prevent `cargo add .` from working (#501) - Sane defaults when adding a dependency from within the workspace (#504) cargo-upgrade - Update optional dependencies with `--to-lockfile` (#427) - Actually report upgrade when `package` key is used (#409) cargo-rm - Remove references among features to crate being removed (#500) ## 0.7.0 - 2020-10-03 New features: - Keep dependencies in sorted order if they were already sorted (#421 by @joshtriplett) Fixes: - Fix for cargo-nightly (#413 by @meltinglava) - Normalise windows-style paths (#403 by @Michael-F-Bryan) - Fix for non-lowercase crate names (#398) ## 0.6.0 New features: * You can now specify a branch for git dependencies (#379 by @struktured) * A long awaited feature to support `-p` flag in the workspace is finally there :tada: ` (#390 by @pwoolcoc) Fixes: * `--all` flag is now deprecated in favor of `--workspace` to match cargo (#392 by @pwoolcoc) ## 0.5.0 This is a minor release that updates the dependencies so that it's easier to use `cargo-edit` as a library. Fixes: - Adding a dependency that was renamed previously (#351 by @stiiifff) Full changes: https://github.com/killercup/cargo-edit/compare/v0.4.2...v0.5.0 ## 0.4.2 New features: - Add a `--skip-compatible` flag to cargo upgrade (#360) This flag will make cargo upgrade ignore upgrades where the old version is semver compatible with the new one. This is useful in cases where you don't want to churn the `Cargo.toml` files in the whole project knowing that the lockfile is already forcing the versions to be up to date. Other: - Bunch of internal clean-ups ## 0.4.1 New features: - new cool feature: try passing `--to-lockfile` to `cargo upgrade` (#337 by @tofay) - alternative registries support (#336 by @tofay) - `cargo add` now supports `--rename` flag (#345) Bug fixes: - `cargo upgrade` works correctly with renamed dependencies (#342 by @stiiifff) - `cargo-{add, upgrade}` now works with ssh auth for git (#334) - `cargo upgrade` does not downgrade prerelease dependencies (#348) ## 0.4.0 Major changes: - `cargo add` and `cargo upgrade` now supports `--offline` mode and minimizes network queries (#317 by @DCjanus) - `cargo add` now accepts `--sort` flag to sort dependencies (#322 by @thiagoarrais) ## 0.3.3 - Update dependencies to most recent versions ## 0.3.2 New features: * add multiple local packages (#295) * support for `--no-default-features` flag (#290) * rm multiple crates (#289) Bug fixes: * strip semver metadata on versions (#304) ## 0.3.1 Update dependencies, which fixes issues with OpenSSL 1.1.1 (#245) ## 0.3.0 A lot has happened since the last stable release! The most important feature sure is that we try to not mess up your `Cargo.toml` files anymore! While we are not 100% there yet, `cargo add foo` should give you much nicer edits now. Other cool features: - Add proxy support via env variable (#179) - Allow simultaneous specification of both version and path (thanks, @dherman!) - Add specific error for a missing crate (thanks, @bjgill!) - `cargo-upgrade` now supports `--precise`, `--dry-run`, and has nicer output cargo-edit-0.13.10/CONTRIBUTING.md000064400000000000000000000011211046102023000142300ustar 00000000000000Thanks for your interest - we gratefully welcome contributions. Questions can be asked in [issues](https://github.com/killercup/cargo-edit/issues). To help us help you get pull requests merged quickly and smoothly, open an issue before submitted large changes. Please keep the contents of pull requests and commits short. Commit messages should include the intent of the commit. `cargo-edit` has a moderately comprehensive test suite. Contributions that add/improve tests are awesome. Please add tests for every change. `cargo-edit` uses `rustfmt` for formatting and `clippy` for linting. cargo-edit-0.13.10/Cargo.lock0000644000002466741046102023000112340ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 4 [[package]] name = "adler2" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aho-corasick" version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" dependencies = [ "memchr", ] [[package]] name = "anstream" version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" dependencies = [ "anstyle", "anstyle-parse 0.2.7", "anstyle-query", "anstyle-wincon", "colorchoice", "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstream" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" dependencies = [ "anstyle", "anstyle-parse 1.0.0", "anstyle-query", "anstyle-wincon", "colorchoice", "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" [[package]] name = "anstyle-lossy" version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9ca7d0f520afcd6d817970d0b2d5fd7c630c75e7783cae046b8b8a783c5befa" dependencies = [ "anstyle", ] [[package]] name = "anstyle-parse" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-parse" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ "windows-sys 0.61.2", ] [[package]] name = "anstyle-svg" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e22d9f3dea8bbda97c75bd0f0203e23f1e190d6d6f27a40e10063946dc4d4362" dependencies = [ "anstyle", "anstyle-lossy", "anstyle-parse 0.2.7", "html-escape", "unicode-width", ] [[package]] name = "anstyle-wincon" version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", "windows-sys 0.61.2", ] [[package]] name = "anyhow" version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" [[package]] name = "async-compression" version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0f9ee0f6e02ffd7ad5816e9464499fba7b3effd01123b515c41d1697c43dad1" dependencies = [ "compression-codecs", "compression-core", "pin-project-lite", "tokio", ] [[package]] name = "atomic-waker" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "atty" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", "winapi", ] [[package]] name = "automod" version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8b5778837666541195063243828c5b6139221b47dc4ec3ba81738e532469ab1" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "base16ct" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" [[package]] name = "block-buffer" version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] [[package]] name = "borsh" version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfd1e3f8955a5d7de9fab72fc8373fade9fb8a703968cb200ae3dc6cf08e185a" dependencies = [ "bytes", "cfg_aliases", ] [[package]] name = "bstr" version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" dependencies = [ "memchr", "serde", ] [[package]] name = "bumpalo" version = "3.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" [[package]] name = "bytes" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" [[package]] name = "camino" version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" dependencies = [ "serde_core", ] [[package]] name = "cargo-edit" version = "0.13.10" dependencies = [ "anyhow", "cargo-test-support", "cargo_metadata", "clap", "clap-cargo", "clap-verbosity-flag", "concolor-control", "dunce", "env_logger", "home", "indexmap", "log", "pathdiff", "semver", "serde", "serde_derive", "snapbox 0.6.24", "tame-index", "termcolor", "toml 1.1.2+spec-1.1.0", "toml_edit", "trycmd", "url", ] [[package]] name = "cargo-platform" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87a0c0e6148f11f01f32650a2ea02d532b2ad4e81d8bd41e6e565b5adc5e6082" dependencies = [ "serde", "serde_core", ] [[package]] name = "cargo-test-macro" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7bd89c170e33cea7b7b15d0b87c53a4c1545e67c5dc5eb3ae1fd623385740dbd" [[package]] name = "cargo-test-support" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eb0fda7f0c4293aba46ee5ca037f2a4d1c6e69e317bba813468b17778555cf2" dependencies = [ "anstream 0.6.21", "anstyle", "anyhow", "cargo-test-macro", "cargo-util", "crates-io", "filetime", "flate2", "git2", "glob", "itertools", "pasetors", "regex", "serde", "serde_json", "snapbox 0.6.24", "tar", "time", "toml 0.9.12+spec-1.1.0", "url", "walkdir", "windows-sys 0.61.2", ] [[package]] name = "cargo-util" version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a4b72539a4e322539ac3cd07d7e63d60ca3823f3143a2d39a9f8fcdace0e8ca" dependencies = [ "anyhow", "core-foundation", "filetime", "hex", "ignore", "jobserver", "libc", "miow", "same-file", "sha2", "shell-escape", "tempfile", "tracing", "walkdir", "windows-sys 0.61.2", ] [[package]] name = "cargo_metadata" version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef987d17b0a113becdd19d3d0022d04d7ef41f9efe4f3fb63ac44ba61df3ade9" dependencies = [ "camino", "cargo-platform", "semver", "serde", "serde_json", "thiserror", ] [[package]] name = "cc" version = "1.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20" dependencies = [ "find-msvc-tools", "jobserver", "libc", "shlex", ] [[package]] name = "cfg-if" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cfg_aliases" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "clap" version = "4.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" dependencies = [ "clap_builder", "clap_derive", ] [[package]] name = "clap-cargo" version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "936551935c8258754bb8216aec040957d261f977303754b9bf1a213518388006" dependencies = [ "anstyle", "clap", ] [[package]] name = "clap-verbosity-flag" version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d92b1fab272fe943881b77cc6e920d6543e5b1bfadbd5ed81c7c5a755742394" dependencies = [ "clap", "log", ] [[package]] name = "clap_builder" version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" dependencies = [ "anstream 1.0.0", "anstyle", "clap_lex", "strsim", "terminal_size", ] [[package]] name = "clap_derive" version = "4.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" dependencies = [ "heck", "proc-macro2", "quote", "syn", ] [[package]] name = "clap_lex" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" [[package]] name = "colorchoice" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" [[package]] name = "compression-codecs" version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb7b51a7d9c967fc26773061ba86150f19c50c0d65c887cb1fbe295fd16619b7" dependencies = [ "compression-core", "flate2", "memchr", ] [[package]] name = "compression-core" version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75984efb6ed102a0d42db99afb6c1948f0380d1d91808d5529916e6c08b49d8d" [[package]] name = "concolor-control" version = "0.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7104119c2f80d887239879d0c50e033cd40eac9a3f3561e0684ba7d5d654f4da" dependencies = [ "atty", "bitflags 1.3.2", "concolor-query", ] [[package]] name = "concolor-query" version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad159cc964ac8f9d407cbc0aa44b02436c054b541f2b4b5f06972e1efdc54bc7" [[package]] name = "const-oid" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "content_inspector" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7bda66e858c683005a53a9a60c69a4aca7eeaa45d124526e389f7aec8e62f38" dependencies = [ "memchr", ] [[package]] name = "core-foundation" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "core-foundation-sys" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] [[package]] name = "crates-io" version = "0.40.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec97b1f074b7b2fe478fb89e51a26e25a75ae2de02d4c8cc85c5f206dd628286" dependencies = [ "curl", "percent-encoding", "serde", "serde_json", "thiserror", "url", ] [[package]] name = "crc32fast" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-deque" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-bigint" version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", "rand_core 0.6.4", "subtle", "zeroize", ] [[package]] name = "crypto-common" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", "typenum", ] [[package]] name = "ct-codecs" version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b10589d1a5e400d61f9f38f12f884cfd080ff345de8f17efda36fe0e4a02aa8" [[package]] name = "curl" version = "0.4.49" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79fc3b6dd0b87ba36e565715bf9a2ced221311db47bd18011676f24a6066edbc" dependencies = [ "curl-sys", "libc", "openssl-probe 0.1.6", "openssl-sys", "schannel", "socket2", "windows-sys 0.59.0", ] [[package]] name = "curl-sys" version = "0.4.87+curl-8.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61a460380f0ef783703dcbe909107f39c162adeac050d73c850055118b5b6327" dependencies = [ "cc", "libc", "libz-sys", "openssl-sys", "pkg-config", "vcpkg", "windows-sys 0.59.0", ] [[package]] name = "der" version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" dependencies = [ "const-oid", "pem-rfc7468", "zeroize", ] [[package]] name = "deranged" version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" dependencies = [ "powerfmt", "serde_core", ] [[package]] name = "digest" version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "const-oid", "crypto-common", "subtle", ] [[package]] name = "displaydoc" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "dunce" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "ecdsa" version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", "digest", "elliptic-curve", "rfc6979", "signature", "spki", ] [[package]] name = "ed25519-compact" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ce99a9e19c84beb4cc35ece85374335ccc398240712114c85038319ed709bd" dependencies = [ "getrandom 0.3.4", ] [[package]] name = "either" version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "elliptic-curve" version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", "digest", "ff", "generic-array", "group", "hkdf", "pem-rfc7468", "pkcs8", "rand_core 0.6.4", "sec1", "subtle", "zeroize", ] [[package]] name = "env_filter" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32e90c2accc4b07a8456ea0debdc2e7587bdd890680d71173a15d4ae604f6eef" dependencies = [ "log", "regex", ] [[package]] name = "env_logger" version = "0.11.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0621c04f2196ac3f488dd583365b9c09be011a4ab8b9f37248ffcc8f6198b56a" dependencies = [ "anstream 1.0.0", "anstyle", "env_filter", "jiff", "log", ] [[package]] name = "equivalent" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", "windows-sys 0.61.2", ] [[package]] name = "fastrand" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" [[package]] name = "ff" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ "rand_core 0.6.4", "subtle", ] [[package]] name = "fiat-crypto" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64cd1e32ddd350061ae6edb1b082d7c54915b5c672c389143b9a63403a109f24" [[package]] name = "filetime" version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" dependencies = [ "cfg-if", "libc", "libredox", ] [[package]] name = "find-msvc-tools" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" [[package]] name = "flate2" version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" dependencies = [ "crc32fast", "miniz_oxide", "zlib-rs", ] [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foldhash" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "form_urlencoded" version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] [[package]] name = "futures-channel" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" dependencies = [ "futures-core", "futures-sink", ] [[package]] name = "futures-core" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" [[package]] name = "futures-io" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" [[package]] name = "futures-sink" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" [[package]] name = "futures-task" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" [[package]] name = "futures-util" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" dependencies = [ "futures-core", "futures-io", "futures-sink", "futures-task", "memchr", "pin-project-lite", "slab", ] [[package]] name = "generic-array" version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" dependencies = [ "typenum", "version_check", "zeroize", ] [[package]] name = "getrandom" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", "js-sys", "libc", "wasi", "wasm-bindgen", ] [[package]] name = "getrandom" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "js-sys", "libc", "r-efi 5.3.0", "wasip2", "wasm-bindgen", ] [[package]] name = "getrandom" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" dependencies = [ "cfg-if", "libc", "r-efi 6.0.0", "wasip2", "wasip3", ] [[package]] name = "git2" version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b88256088d75a56f8ecfa070513a775dd9107f6530ef14919dac831af9cfe2b" dependencies = [ "bitflags 2.11.1", "libc", "libgit2-sys", "log", "openssl-probe 0.1.6", "openssl-sys", "url", ] [[package]] name = "glob" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" [[package]] name = "globset" version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3" dependencies = [ "aho-corasick", "bstr", "log", "regex-automata", "regex-syntax", ] [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", "rand_core 0.6.4", "subtle", ] [[package]] name = "h2" version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" dependencies = [ "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", "http", "indexmap", "slab", "tokio", "tokio-util", "tracing", ] [[package]] name = "hashbrown" version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "foldhash", ] [[package]] name = "hashbrown" version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] [[package]] name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hkdf" version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac", ] [[package]] name = "hmac" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ "digest", ] [[package]] name = "home" version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" dependencies = [ "windows-sys 0.61.2", ] [[package]] name = "html-escape" version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d1ad449764d627e22bfd7cd5e8868264fc9236e07c752972b4080cd351cb476" dependencies = [ "utf8-width", ] [[package]] name = "http" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" dependencies = [ "bytes", "itoa", ] [[package]] name = "http-body" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http", ] [[package]] name = "http-body-util" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", "futures-core", "http", "http-body", "pin-project-lite", ] [[package]] name = "httparse" version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "humantime" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" [[package]] name = "humantime-serde" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c" dependencies = [ "humantime", "serde", ] [[package]] name = "hyper" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" dependencies = [ "atomic-waker", "bytes", "futures-channel", "futures-core", "h2", "http", "http-body", "httparse", "itoa", "pin-project-lite", "smallvec", "tokio", "want", ] [[package]] name = "hyper-rustls" version = "0.27.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" dependencies = [ "http", "hyper", "hyper-util", "rustls", "rustls-native-certs", "tokio", "tokio-rustls", "tower-service", "webpki-roots", ] [[package]] name = "hyper-util" version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" dependencies = [ "base64", "bytes", "futures-channel", "futures-util", "http", "http-body", "hyper", "ipnet", "libc", "percent-encoding", "pin-project-lite", "socket2", "tokio", "tower-service", "tracing", ] [[package]] name = "icu_collections" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" dependencies = [ "displaydoc", "potential_utf", "utf8_iter", "yoke", "zerofrom", "zerovec", ] [[package]] name = "icu_locale_core" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" dependencies = [ "displaydoc", "litemap", "tinystr", "writeable", "zerovec", ] [[package]] name = "icu_normalizer" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" dependencies = [ "icu_collections", "icu_normalizer_data", "icu_properties", "icu_provider", "smallvec", "zerovec", ] [[package]] name = "icu_normalizer_data" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" [[package]] name = "icu_properties" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" dependencies = [ "icu_collections", "icu_locale_core", "icu_properties_data", "icu_provider", "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" [[package]] name = "icu_provider" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" dependencies = [ "displaydoc", "icu_locale_core", "writeable", "yoke", "zerofrom", "zerotrie", "zerovec", ] [[package]] name = "id-arena" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" [[package]] name = "idna" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ "idna_adapter", "smallvec", "utf8_iter", ] [[package]] name = "idna_adapter" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", ] [[package]] name = "ignore" version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3d782a365a015e0f5c04902246139249abf769125006fbe7649e2ee88169b4a" dependencies = [ "crossbeam-deque", "globset", "log", "memchr", "regex-automata", "same-file", "walkdir", "winapi-util", ] [[package]] name = "indexmap" version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", "hashbrown 0.17.0", "serde", "serde_core", ] [[package]] name = "ipnet" version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" [[package]] name = "iri-string" version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25e659a4bb38e810ebc252e53b5814ff908a8c58c2a9ce2fae1bbec24cbf4e20" dependencies = [ "memchr", "serde", ] [[package]] name = "is_terminal_polyfill" version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itertools" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] [[package]] name = "itoa" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "jiff" version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a3546dc96b6d42c5f24902af9e2538e82e39ad350b0c766eb3fbf2d8f3d8359" dependencies = [ "jiff-static", "log", "portable-atomic", "portable-atomic-util", "serde_core", ] [[package]] name = "jiff-static" version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "jobserver" version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" dependencies = [ "getrandom 0.3.4", "libc", ] [[package]] name = "js-sys" version = "0.3.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" dependencies = [ "cfg-if", "futures-util", "once_cell", "wasm-bindgen", ] [[package]] name = "leb128fmt" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" [[package]] name = "libc" version = "0.2.185" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" [[package]] name = "libgit2-sys" version = "0.18.3+1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9b3acc4b91781bb0b3386669d325163746af5f6e4f73e6d2d630e09a35f3487" dependencies = [ "cc", "libc", "libssh2-sys", "libz-sys", "openssl-sys", "pkg-config", ] [[package]] name = "libredox" version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" dependencies = [ "bitflags 2.11.1", "libc", "plain", "redox_syscall", ] [[package]] name = "libssh2-sys" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "220e4f05ad4a218192533b300327f5150e809b54c4ec83b5a1d91833601811b9" dependencies = [ "cc", "libc", "libz-sys", "openssl-sys", "pkg-config", "vcpkg", ] [[package]] name = "libz-sys" version = "1.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc3a226e576f50782b3305c5ccf458698f92798987f551c6a02efe8276721e22" dependencies = [ "cc", "libc", "pkg-config", "vcpkg", ] [[package]] name = "linux-raw-sys" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "litemap" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" [[package]] name = "log" version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "lru-slab" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" [[package]] name = "memchr" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" [[package]] name = "miniz_oxide" version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", "simd-adler32", ] [[package]] name = "mio" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" dependencies = [ "libc", "wasi", "windows-sys 0.61.2", ] [[package]] name = "miow" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "536bfad37a309d62069485248eeaba1e8d9853aaf951caaeaed0585a95346f08" dependencies = [ "windows-sys 0.61.2", ] [[package]] name = "normalize-line-endings" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "num-conv" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" [[package]] name = "once_cell" version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] name = "once_cell_polyfill" version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "openssl-probe" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-probe" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" [[package]] name = "openssl-sys" version = "0.9.113" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad2f2c0eba47118757e4c6d2bff2838f3e0523380021356e7875e858372ce644" dependencies = [ "cc", "libc", "pkg-config", "vcpkg", ] [[package]] name = "orion" version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58fa7b8bd24f9f1b7fa56de934075adba4b6fb1bf0bf38db74f4236e05e14776" dependencies = [ "fiat-crypto", "subtle", ] [[package]] name = "os_pipe" version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" dependencies = [ "libc", "windows-sys 0.61.2", ] [[package]] name = "p384" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe42f1670a52a47d448f14b6a5c61dd78fce51856e68edaa38f7ae3a46b8d6b6" dependencies = [ "ecdsa", "elliptic-curve", "primeorder", "sha2", ] [[package]] name = "pasetors" version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e838401fb2873bad417e6a03179014c748746f67311cb7317ab14fc0881fa9f0" dependencies = [ "ct-codecs", "ed25519-compact", "getrandom 0.4.2", "orion", "p384", "rand_core 0.6.4", "regex", "serde", "serde_derive", "serde_json", "sha2", "subtle", "time", "zeroize", ] [[package]] name = "pathdiff" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" [[package]] name = "pem-rfc7468" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" dependencies = [ "base64ct", ] [[package]] name = "percent-encoding" version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pin-project-lite" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]] name = "pkcs8" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der", "spki", ] [[package]] name = "pkg-config" version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" [[package]] name = "plain" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] name = "portable-atomic" version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" [[package]] name = "portable-atomic-util" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618" dependencies = [ "portable-atomic", ] [[package]] name = "potential_utf" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" dependencies = [ "zerovec", ] [[package]] name = "powerfmt" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ "zerocopy", ] [[package]] name = "prettyplease" version = "0.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", "syn", ] [[package]] name = "primeorder" version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ "elliptic-curve", ] [[package]] name = "proc-macro2" version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] [[package]] name = "quinn" version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" dependencies = [ "bytes", "cfg_aliases", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", "rustls", "socket2", "thiserror", "tokio", "tracing", "web-time", ] [[package]] name = "quinn-proto" version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" dependencies = [ "bytes", "getrandom 0.3.4", "lru-slab", "rand", "ring", "rustc-hash", "rustls", "rustls-pki-types", "slab", "thiserror", "tinyvec", "tracing", "web-time", ] [[package]] name = "quinn-udp" version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" dependencies = [ "cfg_aliases", "libc", "once_cell", "socket2", "tracing", "windows-sys 0.60.2", ] [[package]] name = "quote" version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] [[package]] name = "r-efi" version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "r-efi" version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "rand" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" dependencies = [ "rand_chacha", "rand_core 0.9.5", ] [[package]] name = "rand_chacha" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", "rand_core 0.9.5", ] [[package]] name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom 0.2.17", ] [[package]] name = "rand_core" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" dependencies = [ "getrandom 0.3.4", ] [[package]] name = "rayon" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" dependencies = [ "either", "rayon-core", ] [[package]] name = "rayon-core" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" dependencies = [ "crossbeam-deque", "crossbeam-utils", ] [[package]] name = "redox_syscall" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f450ad9c3b1da563fb6948a8e0fb0fb9269711c9c73d9ea1de5058c79c8d643a" dependencies = [ "bitflags 2.11.1", ] [[package]] name = "regex" version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" dependencies = [ "aho-corasick", "memchr", "regex-automata", "regex-syntax", ] [[package]] name = "regex-automata" version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" dependencies = [ "aho-corasick", "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" [[package]] name = "reqwest" version = "0.12.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" dependencies = [ "base64", "bytes", "futures-channel", "futures-core", "futures-util", "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", "hyper-util", "js-sys", "log", "percent-encoding", "pin-project-lite", "quinn", "rustls", "rustls-native-certs", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", "tokio", "tokio-rustls", "tower", "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", "webpki-roots", ] [[package]] name = "rfc6979" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ "hmac", "subtle", ] [[package]] name = "ring" version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", "getrandom 0.2.17", "libc", "untrusted", "windows-sys 0.52.0", ] [[package]] name = "rustc-hash" version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" [[package]] name = "rustc-stable-hash" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "781442f29170c5c93b7185ad559492601acdc71d5bb0706f5868094f45cfcd08" [[package]] name = "rustix" version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ "bitflags 2.11.1", "errno", "libc", "linux-raw-sys", "windows-sys 0.61.2", ] [[package]] name = "rustls" version = "0.23.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69f9466fb2c14ea04357e91413efb882e2a6d4a406e625449bc0a5d360d53a21" dependencies = [ "once_cell", "ring", "rustls-pki-types", "rustls-webpki", "subtle", "zeroize", ] [[package]] name = "rustls-native-certs" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" dependencies = [ "openssl-probe 0.2.1", "rustls-pki-types", "schannel", "security-framework", ] [[package]] name = "rustls-pki-types" version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" dependencies = [ "web-time", "zeroize", ] [[package]] name = "rustls-webpki" version = "0.103.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8279bb85272c9f10811ae6a6c547ff594d6a7f3c6c6b02ee9726d1d0dcfcdd06" dependencies = [ "ring", "rustls-pki-types", "untrusted", ] [[package]] name = "rustversion" version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" [[package]] name = "same-file" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ "winapi-util", ] [[package]] name = "schannel" version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" dependencies = [ "windows-sys 0.61.2", ] [[package]] name = "sec1" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", "generic-array", "pkcs8", "subtle", "zeroize", ] [[package]] name = "security-framework" version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ "bitflags 2.11.1", "core-foundation", "core-foundation-sys", "libc", "security-framework-sys", ] [[package]] name = "security-framework-sys" version = "2.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "semver" version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" dependencies = [ "serde", "serde_core", ] [[package]] name = "serde" version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ "serde_core", "serde_derive", ] [[package]] name = "serde_core" version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "serde_json" version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ "itoa", "memchr", "serde", "serde_core", "zmij", ] [[package]] name = "serde_spanned" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" dependencies = [ "serde_core", ] [[package]] name = "serde_urlencoded" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", "itoa", "ryu", "serde", ] [[package]] name = "sha2" version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", "digest", ] [[package]] name = "shell-escape" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f" [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signature" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", "rand_core 0.6.4", ] [[package]] name = "simd-adler32" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" [[package]] name = "similar" version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" [[package]] name = "slab" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "smallvec" version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "smol_str" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4aaa7368fcf4852a4c2dd92df0cace6a71f2091ca0a23391ce7f3a31833f1523" dependencies = [ "borsh", "serde_core", ] [[package]] name = "snapbox" version = "0.6.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c1abc378119f77310836665f8523018532cf7e3faeb3b10b01da5a7321bf8e1" dependencies = [ "anstream 0.6.21", "anstyle", "anstyle-svg", "content_inspector", "dunce", "filetime", "libc", "normalize-line-endings", "os_pipe", "regex", "serde", "serde_json", "similar", "snapbox-macros 0.4.0", "tempfile", "wait-timeout", "walkdir", "windows-sys 0.60.2", ] [[package]] name = "snapbox" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f92ac911648d788a6435401d9b4803959039d4de9919fdabdb415a8bebd027be" dependencies = [ "anstream 1.0.0", "anstyle", "content_inspector", "dunce", "filetime", "libc", "normalize-line-endings", "os_pipe", "similar", "snapbox-macros 1.1.0", "tempfile", "wait-timeout", "walkdir", "windows-sys 0.61.2", ] [[package]] name = "snapbox-macros" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b750c344002d7cc69afb9da00ebd9b5c0f8ac2eb7d115d9d45d5b5f47718d74" dependencies = [ "anstream 0.6.21", ] [[package]] name = "snapbox-macros" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed4a172e483585ebbc7c7f7d1705ca7e3f94f606ed78caa14805673189fd5455" dependencies = [ "anstream 1.0.0", ] [[package]] name = "socket2" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" dependencies = [ "libc", "windows-sys 0.61.2", ] [[package]] name = "spki" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", ] [[package]] name = "stable_deref_trait" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "strsim" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subtle" version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "sync_wrapper" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] [[package]] name = "synstructure" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "tame-index" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b180c2c9076c23d5588cb2fde0fdd012ff2bfcd97b1fdcb97e62903af2e44c7" dependencies = [ "bytes", "camino", "crossbeam-channel", "home", "http", "libc", "memchr", "rayon", "reqwest", "rustc-stable-hash", "semver", "serde", "serde_json", "sha2", "smol_str", "thiserror", "tokio", "toml-span", "twox-hash", ] [[package]] name = "tar" version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22692a6476a21fa75fdfc11d452fda482af402c008cdbaf3476414e122040973" dependencies = [ "filetime", "libc", ] [[package]] name = "tempfile" version = "3.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", "getrandom 0.4.2", "once_cell", "rustix", "windows-sys 0.61.2", ] [[package]] name = "termcolor" version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] [[package]] name = "terminal_size" version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" dependencies = [ "rustix", "windows-sys 0.61.2", ] [[package]] name = "thiserror" version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "time" version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" dependencies = [ "deranged", "itoa", "num-conv", "powerfmt", "serde_core", "time-core", "time-macros", ] [[package]] name = "time-core" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" [[package]] name = "time-macros" version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" dependencies = [ "num-conv", "time-core", ] [[package]] name = "tinystr" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" dependencies = [ "displaydoc", "zerovec", ] [[package]] name = "tinyvec" version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" version = "1.52.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b67dee974fe86fd92cc45b7a95fdd2f99a36a6d7b0d431a231178d3d670bbcc6" dependencies = [ "bytes", "libc", "mio", "pin-project-lite", "socket2", "windows-sys 0.61.2", ] [[package]] name = "tokio-rustls" version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ "rustls", "tokio", ] [[package]] name = "tokio-util" version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", ] [[package]] name = "toml" version = "0.9.12+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" dependencies = [ "serde_core", "serde_spanned", "toml_datetime 0.7.5+spec-1.1.0", "toml_writer", ] [[package]] name = "toml" version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee" dependencies = [ "indexmap", "serde_core", "serde_spanned", "toml_datetime 1.1.1+spec-1.1.0", "toml_parser", "toml_writer", "winnow", ] [[package]] name = "toml-span" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d36acfca70d66f9b5f9c4786fec60096c3594169bf77b8d4207174dc862e6a4" dependencies = [ "smallvec", ] [[package]] name = "toml_datetime" version = "0.7.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" dependencies = [ "serde_core", ] [[package]] name = "toml_datetime" version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" dependencies = [ "serde_core", ] [[package]] name = "toml_edit" version = "0.25.11+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" dependencies = [ "indexmap", "serde_core", "serde_spanned", "toml_datetime 1.1.1+spec-1.1.0", "toml_parser", "toml_writer", "winnow", ] [[package]] name = "toml_parser" version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" dependencies = [ "winnow", ] [[package]] name = "toml_writer" version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" [[package]] name = "tower" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" dependencies = [ "futures-core", "futures-util", "pin-project-lite", "sync_wrapper", "tokio", "tower-layer", "tower-service", ] [[package]] name = "tower-http" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ "async-compression", "bitflags 2.11.1", "bytes", "futures-core", "futures-util", "http", "http-body", "http-body-util", "iri-string", "pin-project-lite", "tokio", "tokio-util", "tower", "tower-layer", "tower-service", ] [[package]] name = "tower-layer" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", ] [[package]] name = "try-lock" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "trycmd" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "218889993f76bda9b2ef57c12c3cab0eef4fd54ec7b36d1704849867f69e7bb4" dependencies = [ "anstream 1.0.0", "automod", "glob", "humantime", "humantime-serde", "rayon", "serde", "shlex", "snapbox 1.2.1", "toml_edit", ] [[package]] name = "twox-hash" version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c" [[package]] name = "typenum" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" [[package]] name = "unicode-ident" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "unicode-width" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" [[package]] name = "unicode-xid" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "untrusted" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" version = "2.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" dependencies = [ "form_urlencoded", "idna", "percent-encoding", "serde", ] [[package]] name = "utf8-width" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1292c0d970b54115d14f2492fe0170adf21d68a1de108eebc51c1df4f346a091" [[package]] name = "utf8_iter" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "utf8parse" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "vcpkg" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wait-timeout" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" dependencies = [ "libc", ] [[package]] name = "walkdir" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", ] [[package]] name = "want" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ "try-lock", ] [[package]] name = "wasi" version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" version = "1.0.2+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" dependencies = [ "wit-bindgen", ] [[package]] name = "wasip3" version = "0.4.0+wasi-0.3.0-rc-2026-01-06" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" dependencies = [ "wit-bindgen", ] [[package]] name = "wasm-bindgen" version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" version = "0.4.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f371d383f2fb139252e0bfac3b81b265689bf45b6874af544ffa4c975ac1ebf8" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] name = "wasm-bindgen-macro" version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" dependencies = [ "quote", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" dependencies = [ "bumpalo", "proc-macro2", "quote", "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" dependencies = [ "unicode-ident", ] [[package]] name = "wasm-encoder" version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" dependencies = [ "leb128fmt", "wasmparser", ] [[package]] name = "wasm-metadata" version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" dependencies = [ "anyhow", "indexmap", "wasm-encoder", "wasmparser", ] [[package]] name = "wasmparser" version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" dependencies = [ "bitflags 2.11.1", "hashbrown 0.15.5", "indexmap", "semver", ] [[package]] name = "web-sys" version = "0.3.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f2dfbb17949fa2088e5d39408c48368947b86f7834484e87b73de55bc14d97d" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] name = "web-time" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] name = "webpki-roots" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52f5ee44c96cf55f1b349600768e3ece3a8f26010c05265ab73f945bb1a2eb9d" dependencies = [ "rustls-pki-types", ] [[package]] name = "winapi" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ "winapi-i686-pc-windows-gnu", "winapi-x86_64-pc-windows-gnu", ] [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ "windows-sys 0.61.2", ] [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-link" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets 0.52.6", ] [[package]] name = "windows-sys" version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets 0.52.6", ] [[package]] name = "windows-sys" version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ "windows-targets 0.53.5", ] [[package]] name = "windows-sys" version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ "windows-link", ] [[package]] name = "windows-targets" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] [[package]] name = "windows-targets" version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ "windows-link", "windows_aarch64_gnullvm 0.53.1", "windows_aarch64_msvc 0.53.1", "windows_i686_gnu 0.53.1", "windows_i686_gnullvm 0.53.1", "windows_i686_msvc 0.53.1", "windows_x86_64_gnu 0.53.1", "windows_x86_64_gnullvm 0.53.1", "windows_x86_64_msvc 0.53.1", ] [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_gnullvm" version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_aarch64_msvc" version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnu" version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_gnullvm" version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_i686_msvc" version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnu" version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_gnullvm" version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "windows_x86_64_msvc" version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09dac053f1cd375980747450bfc7250c264eaae0583872e845c0c7cd578872b5" dependencies = [ "memchr", ] [[package]] name = "wit-bindgen" version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" dependencies = [ "wit-bindgen-rust-macro", ] [[package]] name = "wit-bindgen-core" version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" dependencies = [ "anyhow", "heck", "wit-parser", ] [[package]] name = "wit-bindgen-rust" version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" dependencies = [ "anyhow", "heck", "indexmap", "prettyplease", "syn", "wasm-metadata", "wit-bindgen-core", "wit-component", ] [[package]] name = "wit-bindgen-rust-macro" version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" dependencies = [ "anyhow", "prettyplease", "proc-macro2", "quote", "syn", "wit-bindgen-core", "wit-bindgen-rust", ] [[package]] name = "wit-component" version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" dependencies = [ "anyhow", "bitflags 2.11.1", "indexmap", "log", "serde", "serde_derive", "serde_json", "wasm-encoder", "wasm-metadata", "wasmparser", "wit-parser", ] [[package]] name = "wit-parser" version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" dependencies = [ "anyhow", "id-arena", "indexmap", "log", "semver", "serde", "serde_derive", "serde_json", "unicode-xid", "wasmparser", ] [[package]] name = "writeable" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" [[package]] name = "yoke" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" dependencies = [ "stable_deref_trait", "yoke-derive", "zerofrom", ] [[package]] name = "yoke-derive" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" dependencies = [ "proc-macro2", "quote", "syn", "synstructure", ] [[package]] name = "zerocopy" version = "0.8.48" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" version = "0.8.48" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "zerofrom" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" dependencies = [ "proc-macro2", "quote", "syn", "synstructure", ] [[package]] name = "zeroize" version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" [[package]] name = "zerotrie" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" dependencies = [ "displaydoc", "yoke", "zerofrom", ] [[package]] name = "zerovec" version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" dependencies = [ "yoke", "zerofrom", "zerovec-derive", ] [[package]] name = "zerovec-derive" version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "zlib-rs" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3be3d40e40a133f9c916ee3f9f4fa2d9d63435b5fbe1bfc6d9dae0aa0ada1513" [[package]] name = "zmij" version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" cargo-edit-0.13.10/Cargo.toml0000644000000134511046102023000112400ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2024" name = "cargo-edit" version = "0.13.10" authors = [ "Without Boats ", "Pascal Hertleif ", "Sebastian Garrido ", "Jonas Platte ", "Benjamin Gill ", "Andronik Ordian ", ] build = false autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = "Cargo commands for modifying a `Cargo.toml` file.." homepage = "https://github.com/killercup/cargo-edit" documentation = "https://github.com/killercup/cargo-edit/blob/master/README.md#available-subcommands" readme = "README.md" keywords = [ "cargo", "cargo-subcommand", "cli", "dependencies", "crates", ] categories = [ "development-tools", "development-tools::cargo-plugins", ] license = "Apache-2.0 OR MIT" repository = "https://github.com/killercup/cargo-edit" [[package.metadata.release.pre-release-replacements]] file = "CHANGELOG.md" search = "Unreleased" replace = "{{version}}" min = 1 [[package.metadata.release.pre-release-replacements]] file = "CHANGELOG.md" search = "ReleaseDate" replace = "{{date}}" min = 1 [[package.metadata.release.pre-release-replacements]] file = "CHANGELOG.md" search = "" replace = """ ## Unreleased - ReleaseDate """ exactly = 1 [features] add = ["cli"] cli = [ "color", "clap", ] color = ["concolor-control/auto"] default = [ "add", "rm", "upgrade", "set-version", ] rm = ["cli"] set-version = ["cli"] test-external-apis = [] upgrade = ["cli"] [lib] name = "cargo_edit" path = "src/lib.rs" [[bin]] name = "cargo-add" path = "src/bin/add/main.rs" required-features = ["add"] [[bin]] name = "cargo-rm" path = "src/bin/rm/main.rs" required-features = ["rm"] [[bin]] name = "cargo-set-version" path = "src/bin/set-version/main.rs" required-features = ["set-version"] [[bin]] name = "cargo-upgrade" path = "src/bin/upgrade/main.rs" required-features = ["upgrade"] [[test]] name = "cargo-set-version" path = "tests/cargo-set-version/main.rs" [[test]] name = "cargo-upgrade" path = "tests/cargo-upgrade/main.rs" [[test]] name = "readme" path = "tests/readme.rs" [dependencies.anyhow] version = "1.0" [dependencies.cargo_metadata] version = "0.23.1" [dependencies.clap] version = "4.6.1" features = [ "derive", "wrap_help", ] optional = true [dependencies.clap-cargo] version = "0.18.3" [dependencies.clap-verbosity-flag] version = "3.0.4" [dependencies.concolor-control] version = "0.0.7" default-features = false [dependencies.dunce] version = "1.0" [dependencies.env_logger] version = "0.11.10" [dependencies.home] version = "0.5.12" [dependencies.indexmap] version = "2" [dependencies.log] version = "0.4.29" [dependencies.pathdiff] version = "0.2" [dependencies.semver] version = "1.0.28" features = ["serde"] [dependencies.serde] version = "1.0.228" [dependencies.serde_derive] version = "1.0.228" [dependencies.tame-index] version = "0.22.0" features = [ "sparse", "native-certs", "local", ] [dependencies.termcolor] version = "1.4.1" [dependencies.toml] version = "1.1.2" [dependencies.toml_edit] version = "0.25.11" [dependencies.url] version = "2.5.8" [dev-dependencies.cargo-test-support] version = "0.10.0" [dev-dependencies.snapbox] version = "0.6.24" features = [ "cmd", "path", ] [dev-dependencies.trycmd] version = "1.2.0" [lints.clippy] bool_assert_comparison = "allow" branches_sharing_code = "allow" checked_conversions = "warn" collapsible_else_if = "allow" create_dir = "warn" dbg_macro = "warn" debug_assert_with_mut_call = "warn" doc_markdown = "warn" empty_enum = "warn" enum_glob_use = "warn" expl_impl_clone_on_copy = "warn" explicit_deref_methods = "warn" explicit_into_iter_loop = "warn" fallible_impl_from = "warn" filter_map_next = "warn" flat_map_option = "warn" float_cmp_const = "warn" fn_params_excessive_bools = "warn" from_iter_instead_of_collect = "warn" if_same_then_else = "allow" implicit_clone = "warn" imprecise_flops = "warn" inconsistent_struct_constructor = "warn" inefficient_to_string = "warn" infinite_loop = "warn" invalid_upcast_comparisons = "warn" large_digit_groups = "warn" large_stack_arrays = "warn" large_types_passed_by_value = "warn" let_and_return = "allow" linkedlist = "warn" lossy_float_literal = "warn" macro_use_imports = "warn" mem_forget = "warn" mutex_integer = "warn" needless_continue = "allow" needless_for_each = "warn" negative_feature_names = "warn" path_buf_push_overwrite = "warn" ptr_as_ptr = "warn" rc_mutex = "warn" redundant_feature_names = "warn" ref_option_ref = "warn" rest_pat_in_fully_bound_structs = "warn" result_large_err = "allow" same_functions_in_if_condition = "warn" self_named_module_files = "allow" semicolon_if_nothing_returned = "warn" str_to_string = "warn" string_add = "warn" string_add_assign = "warn" string_lit_as_bytes = "warn" todo = "warn" trait_duplication_in_bounds = "warn" uninlined_format_args = "warn" verbose_file_reads = "warn" wildcard_imports = "warn" zero_sized_map_values = "warn" [lints.rust] unnameable_types = "warn" unreachable_pub = "warn" unsafe_op_in_unsafe_fn = "warn" unused_lifetimes = "warn" unused_macro_rules = "warn" unused_qualifications = "warn" [lints.rust.rust_2018_idioms] level = "warn" priority = -1 [profile.release] lto = true codegen-units = 1 panic = "abort" cargo-edit-0.13.10/Cargo.toml.orig000064400000000000000000000114271046102023000147000ustar 00000000000000[package] authors = [ "Without Boats ", "Pascal Hertleif ", "Sebastian Garrido ", "Jonas Platte ", "Benjamin Gill ", "Andronik Ordian ", ] categories = [ "development-tools", "development-tools::cargo-plugins", ] description = "Cargo commands for modifying a `Cargo.toml` file.." documentation = "https://github.com/killercup/cargo-edit/blob/master/README.md#available-subcommands" homepage = "https://github.com/killercup/cargo-edit" keywords = [ "cargo", "cargo-subcommand", "cli", "dependencies", "crates", ] license = "Apache-2.0 OR MIT" name = "cargo-edit" readme = "README.md" repository = "https://github.com/killercup/cargo-edit" version = "0.13.10" edition = "2024" [package.metadata.release] pre-release-replacements = [ {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, {file="CHANGELOG.md", search="", replace="\n## Unreleased - ReleaseDate\n", exactly=1}, ] [[bin]] name = "cargo-add" path = "src/bin/add/main.rs" required-features = ["add"] [[bin]] name = "cargo-rm" path = "src/bin/rm/main.rs" required-features = ["rm"] [[bin]] name = "cargo-upgrade" path = "src/bin/upgrade/main.rs" required-features = ["upgrade"] [[bin]] name = "cargo-set-version" path = "src/bin/set-version/main.rs" required-features = ["set-version"] [dependencies] concolor-control = { version = "0.0.7", default-features = false } cargo_metadata = "0.23.1" # Use this with default-features set to "true" (implicitly) so that reqwest, # a transitive dependency, is compiled with support for both webpki # certificates AND native certificates. We want support for both to be # present, and then to let the user _select_ through configuration which # one they want to be used. tame-index = { version = "0.22.0", features = ["sparse", "native-certs", "local"] } dunce = "1.0" anyhow = "1.0" home = "0.5.12" serde = "1.0.228" serde_derive = "1.0.228" clap = { version = "4.6.1", features = ["derive", "wrap_help"], optional = true } clap-cargo = "0.18.3" termcolor = "1.4.1" toml = "1.1.2" toml_edit = "0.25.11" indexmap = "2" url = "2.5.8" pathdiff = "0.2" env_logger = "0.11.10" clap-verbosity-flag = "3.0.4" log = "0.4.29" [dependencies.semver] features = ["serde"] version = "1.0.28" [dev-dependencies] trycmd = "1.2.0" snapbox = { version = "0.6.24", features = ["cmd", "path"] } cargo-test-support = "0.10.0" [profile.release] panic = "abort" codegen-units = 1 lto = true [features] default = [ "add", "rm", "upgrade", "set-version", ] add = ["cli"] rm = ["cli"] upgrade = ["cli"] set-version = ["cli"] cli = ["color", "clap"] color = ["concolor-control/auto"] test-external-apis = [] [lints.rust] rust_2018_idioms = { level = "warn", priority = -1 } unnameable_types = "warn" unreachable_pub = "warn" unsafe_op_in_unsafe_fn = "warn" unused_lifetimes = "warn" unused_macro_rules = "warn" unused_qualifications = "warn" [lints.clippy] bool_assert_comparison = "allow" branches_sharing_code = "allow" checked_conversions = "warn" collapsible_else_if = "allow" create_dir = "warn" dbg_macro = "warn" debug_assert_with_mut_call = "warn" doc_markdown = "warn" empty_enum = "warn" enum_glob_use = "warn" expl_impl_clone_on_copy = "warn" explicit_deref_methods = "warn" explicit_into_iter_loop = "warn" fallible_impl_from = "warn" filter_map_next = "warn" flat_map_option = "warn" float_cmp_const = "warn" fn_params_excessive_bools = "warn" from_iter_instead_of_collect = "warn" if_same_then_else = "allow" implicit_clone = "warn" imprecise_flops = "warn" inconsistent_struct_constructor = "warn" inefficient_to_string = "warn" infinite_loop = "warn" invalid_upcast_comparisons = "warn" large_digit_groups = "warn" large_stack_arrays = "warn" large_types_passed_by_value = "warn" let_and_return = "allow" # sometimes good to name what you are returning linkedlist = "warn" lossy_float_literal = "warn" macro_use_imports = "warn" mem_forget = "warn" mutex_integer = "warn" needless_continue = "allow" needless_for_each = "warn" negative_feature_names = "warn" path_buf_push_overwrite = "warn" ptr_as_ptr = "warn" rc_mutex = "warn" redundant_feature_names = "warn" ref_option_ref = "warn" rest_pat_in_fully_bound_structs = "warn" result_large_err = "allow" same_functions_in_if_condition = "warn" self_named_module_files = "allow" # false positive semicolon_if_nothing_returned = "warn" str_to_string = "warn" string_add = "warn" string_add_assign = "warn" string_lit_as_bytes = "warn" todo = "warn" trait_duplication_in_bounds = "warn" uninlined_format_args = "warn" verbose_file_reads = "warn" wildcard_imports = "warn" zero_sized_map_values = "warn" cargo-edit-0.13.10/LICENSE000064400000000000000000000020751046102023000130150ustar 00000000000000The MIT License (MIT) Copyright (c) Individual contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. cargo-edit-0.13.10/README.md000064400000000000000000000156511046102023000132730ustar 00000000000000# cargo edit This tool extends [Cargo](http://doc.crates.io/) to allow you to add, remove, and upgrade dependencies by modifying your `Cargo.toml` file from the command line. Currently available subcommands: - [`cargo upgrade`](#cargo-upgrade) - [`cargo set-version`](#cargo-set-version) [![Build Status](https://github.com/killercup/cargo-edit/workflows/build/badge.svg)](https://github.com/killercup/cargo-edit/actions) [![Coverage Status](https://coveralls.io/repos/killercup/cargo-edit/badge.svg?branch=master&service=github)](https://coveralls.io/github/killercup/cargo-edit?branch=master) [![crates.io](https://img.shields.io/crates/v/cargo-edit.svg)](https://crates.io/crates/cargo-edit) [![Join the chat at https://gitter.im/cargo-edit/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cargo-edit/Lobby) ## Installation Packaging status Ensure that you have a fairly recent version of rust/cargo installed. On Ubuntu you would also need to install `libssl-dev` and `pkg-config` packages. ```console,ignore $ cargo install cargo-edit ``` *Compiler support: requires rustc 1.44+* (Please check [`cargo`'s documentation](http://doc.crates.io/) to learn how `cargo install` works and how to set up your system so it finds binaries installed by `cargo`.) Install a sub-set of the commands with `cargo install -f --no-default-features --features ""`, where `` is a space-separated list of commands; i.e. `add rm upgrade` for the full set. ## Available Subcommands ### `cargo add` `cargo add` is now integrated into `cargo` as of v1.62. If you want access in older versions of `cargo`, you'll need to install `cargo-edit` v0.9 or earlier. Known differences from `cargo-edit` v0.9.1 - `cargo add ` is unsupported, instead use `cargo add --path ` - `cargo add +` is unsupported, instead use `cargo add -F ` - If adding multiple crates, qualify the feature like `cargo add serde -F serde/derive serde_json` - See [rust-lang/cargo#10809](https://github.com/rust-lang/cargo/issues/10809) ### `cargo rm` `cargo rm` is now integrated into `cargo` as of v1.66. If you want access in older versions of `cargo`, you'll need to install `cargo-edit` v0.11 or earlier. ### `cargo upgrade` Upgrade dependencies in your `Cargo.toml` to their latest versions. To specify a version to upgrade to, provide the dependencies in the `@` format, e.g. `cargo upgrade -p docopt@~0.9.0 -p serde@>=0.9,<2.0`. This command differs from `cargo update`, which updates the dependency versions recorded in the local lock file (Cargo.lock). #### Examples ```console,ignore # Upgrade all dependencies for the current crate $ cargo upgrade # Upgrade docopt (to ~0.9) and serde (to >=0.9,<2.0) $ cargo upgrade -p docopt@~0.9 -p serde@>=0.9,<2.0 # Upgrade all dependencies except docopt and serde $ cargo upgrade --exclude docopt --exclude serde ``` #### Usage ```console $ cargo-upgrade upgrade --help Upgrade dependency version requirements in Cargo.toml manifest files Usage: cargo upgrade [OPTIONS] Options: -n, --dry-run Print changes to be made without making them --manifest-path Path to the manifest to upgrade --rust-version Override `rust-version` --ignore-rust-version Ignore `rust-version` specification in packages --locked Require `Cargo.toml` to be up to date -v, --verbose... Increase logging verbosity -q, --quiet... Decrease logging verbosity -Z Unstable (nightly-only) flags -h, --help Print help -V, --version Print version Version: --compatible [] Upgrade to latest compatible version [default: allow] -i, --incompatible [] Upgrade to latest incompatible version [default: ignore] --pinned [] Upgrade pinned to latest incompatible version [default: ignore] Dependencies: -p, --package ]> Crate to be upgraded --exclude Crates to exclude and not upgrade --recursive [] Recursively update locked dependencies ``` ### `cargo set-version` Set the version in your `Cargo.toml`. #### Examples ```console,ignore # Set the version to the version 1.0.0 $ cargo set-version 1.0.0 # Bump the version to the next major $ cargo set-version --bump major # Bump version to the next minor $ cargo set-version --bump minor # Bump version to the next patch $ cargo set-version --bump patch ``` #### Usage ```console $ cargo-set-version set-version --help Change a package's version in the local manifest file (i.e. Cargo.toml) Usage: cargo set-version [OPTIONS] [TARGET] Arguments: [TARGET] Version to change manifests to Options: --bump Increment manifest version -m, --metadata Specify the version metadata field (e.g. a wrapped libraries version) --manifest-path Path to the manifest to upgrade -p, --package Package id of the crate to change the version of --all [deprecated in favor of `--workspace`] --workspace Modify all packages in the workspace -n, --dry-run Print changes to be made without making them --exclude Crates to exclude and not modify --offline Run without accessing the network --locked Require `Cargo.toml` to be up to date -v, --verbose... Increase logging verbosity -q, --quiet... Decrease logging verbosity -Z Unstable (nightly-only) flags -h, --help Print help -V, --version Print version ``` For more on `metadata`, see the [semver crate's documentation](https://docs.rs/semver/1.0.4/semver/struct.BuildMetadata.html). ## Related Cargo Commands - [`cargo feature`](https://github.com/Riey/cargo-feature) - [`cargo override`](https://github.com/eopb/cargo-override) ## Contribution Thanks for your interest - we gratefully welcome contributions. Questions can be asked in [issues](https://github.com/killercup/cargo-edit/issues), or on [Gitter](https://gitter.im/cargo-edit/Lobby). To help us help you get pull requests merged quickly and smoothly, open an issue before submitted large changes. Please keep the contents of pull requests and commits short. Commit messages should include the intent of the commit. `cargo-edit` has a moderately comprehensive test suite. Contributions that add/improve tests are awesome. Please add tests for every change. `cargo-edit` uses [`rustfmt`](https://github.com/rust-lang-nursery/rustfmt) for formatting and [`clippy`](https://github.com/rust-lang-nursery/rust-clippy) for linting. ## License Apache-2.0/MIT cargo-edit-0.13.10/release.toml000064400000000000000000000000321046102023000143140ustar 00000000000000allow-branch = ["master"] cargo-edit-0.13.10/src/bin/add/add.rs000064400000000000000000000113471046102023000151770ustar 00000000000000#![allow(clippy::bool_assert_comparison)] use cargo_edit::CargoResult; use clap::Args; /// Add dependencies to a Cargo.toml manifest file. #[derive(Debug, Args)] #[command(version)] #[command(after_help = "\ Examples: $ cargo add regex --build $ cargo add trycmd --dev $ cargo add ./crate/parser/ $ cargo add serde +derive serde_json ")] #[command(override_usage = "\ cargo add [OPTIONS] [@] [+,...] ... cargo add [OPTIONS] [+,...] ...")] pub(crate) struct AddArgs { /// Reference to a package to add as a dependency /// /// You can reference a packages by:{n} /// - ``, like `cargo add serde` (latest version will be used){n} /// - `@`, like `cargo add serde@1` or `cargo add serde@=1.0.38`{n} /// - ``, like `cargo add ./crates/parser/` /// /// Additionally, you can specify features for a dependency by following it with a /// `+`. #[arg(value_name = "DEP_ID")] pub crates: Vec, /// Disable the default features #[arg(long)] no_default_features: bool, /// Re-enable the default features #[arg(long, overrides_with = "no_default_features")] default_features: bool, /// Space-separated list of features to add /// /// Alternatively, you can specify features for a dependency by following it with a /// `+`. #[arg(short = 'F', long)] pub features: Option>, /// Mark the dependency as optional /// /// The package name will be exposed as feature of your crate. #[arg(long, conflicts_with = "dev")] pub optional: bool, /// Mark the dependency as required /// /// The package will be removed from your features. #[arg(long, conflicts_with = "dev", overrides_with = "optional")] pub no_optional: bool, /// Rename the dependency /// /// Example uses:{n} /// - Depending on multiple versions of a crate{n} /// - Depend on crates with the same name from different registries #[arg(long, short)] pub rename: Option, /// Package registry for this dependency #[arg(long, conflicts_with = "git")] pub registry: Option, /// Add as development dependency /// /// Dev-dependencies are not used when compiling a package for building, but are used for compiling tests, examples, and benchmarks. /// /// These dependencies are not propagated to other packages which depend on this package. #[arg(short = 'D', long, help_heading = "Section", group = "section")] pub dev: bool, /// Add as build dependency /// /// Build-dependencies are the only dependencies available for use by build scripts (`build.rs` /// files). #[arg(short = 'B', long, help_heading = "Section", group = "section")] pub build: bool, /// Add as dependency to the given target platform. #[arg(long, help_heading = "Section", group = "section")] pub target: Option, /// Path to `Cargo.toml` #[arg(long, value_name = "PATH")] pub manifest_path: Option, /// Package to modify #[arg(short = 'p', long = "package", value_name = "PKGID")] pub pkgid: Option, /// Run without accessing the network #[arg(long)] pub offline: bool, /// Don't actually write the manifest #[arg(long)] pub dry_run: bool, /// Do not print any output in case of success. #[arg(long)] pub quiet: bool, /// Git repository location /// /// Without any other information, cargo will use latest commit on the main branch. #[arg(long, value_name = "URI", help_heading = "Unstable")] pub git: Option, /// Git branch to download the crate from. #[arg( long, value_name = "BRANCH", help_heading = "Unstable", requires = "git", group = "git-ref" )] pub branch: Option, /// Git tag to download the crate from. #[arg( long, value_name = "TAG", help_heading = "Unstable", requires = "git", group = "git-ref" )] pub tag: Option, /// Git reference to download the crate from /// /// This is the catch all, handling hashes to named references in remote repositories. #[arg( long, value_name = "REV", help_heading = "Unstable", requires = "git", group = "git-ref" )] pub rev: Option, } impl AddArgs { pub(crate) fn exec(self) -> CargoResult<()> { anyhow::bail!( "`cargo add` has been merged into cargo 1.62+ as of cargo-edit 0.10, either - Upgrade cargo, like with `rustup update` - Downgrade `cargo-edit`, like with `cargo install cargo-edit --version 0.9.1`" ); } } cargo-edit-0.13.10/src/bin/add/cli.rs000064400000000000000000000006271046102023000152150ustar 00000000000000use cargo_edit::CargoResult; use clap::Parser; #[derive(Debug, Parser)] #[command(bin_name = "cargo")] pub(crate) enum Command { Add(crate::add::AddArgs), } impl Command { pub(crate) fn exec(self) -> CargoResult<()> { match self { Self::Add(add) => add.exec(), } } } #[test] fn verify_app() { use clap::CommandFactory; Command::command().debug_assert(); } cargo-edit-0.13.10/src/bin/add/main.rs000064400000000000000000000007261046102023000153720ustar 00000000000000//! `cargo add` #![warn( missing_docs, missing_debug_implementations, missing_copy_implementations, trivial_casts, trivial_numeric_casts, unsafe_code, unstable_features, unused_import_braces, unused_qualifications )] mod add; mod cli; use std::process; use clap::Parser; fn main() { let args = cli::Command::parse(); if let Err(err) = args.exec() { eprintln!("Error: {err:?}"); process::exit(1); } } cargo-edit-0.13.10/src/bin/rm/cli.rs000064400000000000000000000006231046102023000150770ustar 00000000000000use cargo_edit::CargoResult; use clap::Parser; #[derive(Debug, Parser)] #[command(bin_name = "cargo")] pub(crate) enum Command { Rm(crate::rm::RmArgs), } impl Command { pub(crate) fn exec(self) -> CargoResult<()> { match self { Self::Rm(add) => add.exec(), } } } #[test] fn verify_app() { use clap::CommandFactory; Command::command().debug_assert(); } cargo-edit-0.13.10/src/bin/rm/main.rs000064400000000000000000000007241046102023000152560ustar 00000000000000//! `cargo rm` #![warn( missing_docs, missing_debug_implementations, missing_copy_implementations, trivial_casts, trivial_numeric_casts, unsafe_code, unstable_features, unused_import_braces, unused_qualifications )] mod cli; mod rm; use std::process; use clap::Parser; fn main() { let args = cli::Command::parse(); if let Err(err) = args.exec() { eprintln!("Error: {err:?}"); process::exit(1); } } cargo-edit-0.13.10/src/bin/rm/rm.rs000064400000000000000000000033451046102023000147520ustar 00000000000000use cargo_edit::CargoResult; use clap::Args; use std::path::PathBuf; /// Remove a dependency from a Cargo.toml manifest file. #[derive(Debug, Args)] #[command(version)] pub(crate) struct RmArgs { /// Dependencies to be removed #[arg(value_name = "DEP_ID", required = true)] crates: Vec, /// Remove as development dependency #[arg(long, short = 'D', conflicts_with = "build", help_heading = "Section")] dev: bool, /// Remove as build dependency #[arg(long, short = 'B', conflicts_with = "dev", help_heading = "Section")] build: bool, /// Remove as dependency from the given target platform #[arg(long, value_parser = clap::builder::NonEmptyStringValueParser::new(), help_heading = "Section")] target: Option, /// Path to the manifest to remove a dependency from #[arg(long, value_name = "PATH")] manifest_path: Option, /// Package to remove from #[arg(long = "package", short = 'p', value_name = "PKGID")] pkgid: Option, /// Unstable (nightly-only) flags #[arg(short = 'Z', value_name = "FLAG", global = true, value_enum)] unstable_features: Vec, /// Don't actually write the manifest #[arg(long)] dry_run: bool, /// Do not print any output in case of success #[arg(long, short)] quiet: bool, } impl RmArgs { pub(crate) fn exec(&self) -> CargoResult<()> { anyhow::bail!( "`cargo rm` has been merged into cargo 1.66+ as of cargo-edit 0.12, either - Upgrade cargo, like with `rustup update` - Downgrade `cargo-edit`, like with `cargo install cargo-edit --version 0.11`" ); } } #[derive(Copy, Clone, Debug, PartialEq, Eq, clap::ValueEnum)] enum UnstableOptions {} cargo-edit-0.13.10/src/bin/set-version/cli.rs000064400000000000000000000007461046102023000167450ustar 00000000000000use cargo_edit::CargoResult; use clap::Parser; #[derive(Debug, Parser)] #[command(bin_name = "cargo")] #[command(styles = clap_cargo::style::CLAP_STYLING)] pub(crate) enum Command { SetVersion(crate::set_version::VersionArgs), } impl Command { pub(crate) fn exec(self) -> CargoResult<()> { match self { Self::SetVersion(add) => add.exec(), } } } #[test] fn verify_app() { use clap::CommandFactory; Command::command().debug_assert(); } cargo-edit-0.13.10/src/bin/set-version/errors.rs000064400000000000000000000004671046102023000175120ustar 00000000000000use std::fmt::Display; pub(crate) use cargo_edit::CargoResult; pub(crate) use cargo_edit::Error; /// User requested to downgrade a crate pub(crate) fn version_downgrade_err(current: impl Display, requested: impl Display) -> Error { anyhow::format_err!("Cannot downgrade from {current} to {requested}") } cargo-edit-0.13.10/src/bin/set-version/main.rs000064400000000000000000000010371046102023000171140ustar 00000000000000//! `cargo version` #![warn( missing_docs, missing_debug_implementations, missing_copy_implementations, trivial_casts, trivial_numeric_casts, unsafe_code, unstable_features, unused_import_braces, unused_qualifications )] #![allow(clippy::comparison_chain)] mod cli; mod errors; mod set_version; mod version; use std::process; use clap::Parser; fn main() { let args = cli::Command::parse(); if let Err(err) = args.exec() { eprintln!("Error: {err:?}"); process::exit(1); } } cargo-edit-0.13.10/src/bin/set-version/set_version.rs000064400000000000000000000250751046102023000205400ustar 00000000000000use std::path::Path; use std::path::PathBuf; use cargo_edit::{LocalManifest, shell_status, shell_warn, upgrade_requirement}; use clap::Args; use crate::errors::CargoResult; use crate::version::BumpLevel; use crate::version::TargetVersion; /// Change a package's version in the local manifest file (i.e. Cargo.toml). #[derive(Debug, Args)] #[command(version)] #[command(group = clap::ArgGroup::new("ver").multiple(false))] pub(crate) struct VersionArgs { /// Version to change manifests to #[arg(group = "ver")] target: Option, /// Increment manifest version #[arg(long, group = "ver")] bump: Option, /// Specify the version metadata field (e.g. a wrapped libraries version) #[arg(short, long)] pub metadata: Option, /// Path to the manifest to upgrade #[arg(long, value_name = "PATH")] manifest_path: Option, /// Package id of the crate to change the version of. #[arg( long = "package", short = 'p', value_name = "PKGID", conflicts_with = "all", conflicts_with = "workspace" )] pkgid: Vec, /// Modify all packages in the workspace. #[arg( long, help = "[deprecated in favor of `--workspace`]", conflicts_with = "workspace", conflicts_with = "pkgid" )] all: bool, /// Modify all packages in the workspace. #[arg(long, conflicts_with = "all", conflicts_with = "pkgid")] workspace: bool, /// Print changes to be made without making them. #[arg(long, short = 'n')] dry_run: bool, /// Crates to exclude and not modify. #[arg(long)] exclude: Vec, /// Run without accessing the network #[arg(long)] offline: bool, /// Require `Cargo.toml` to be up to date #[arg(long)] locked: bool, #[command(flatten)] verbose: clap_verbosity_flag::Verbosity, /// Unstable (nightly-only) flags #[arg(short = 'Z', value_name = "FLAG", global = true, value_enum)] unstable_features: Vec, } impl VersionArgs { pub(crate) fn exec(self) -> CargoResult<()> { exec(self) } } #[derive(Copy, Clone, Debug, PartialEq, Eq, clap::ValueEnum)] enum UnstableOptions {} /// Main processing function. Allows us to return a `Result` so that `main` can print pretty error /// messages. fn exec(args: VersionArgs) -> CargoResult<()> { env_logger::Builder::from_env("CARGO_LOG") .filter_level(args.verbose.log_level_filter()) .init(); let VersionArgs { target, bump, metadata, manifest_path, pkgid, all, dry_run, workspace, exclude, locked, offline, verbose: _, unstable_features: _, } = args; let target = match (target, bump) { (None, None) => TargetVersion::Relative(BumpLevel::Release), (None, Some(level)) => TargetVersion::Relative(level), (Some(version), None) => TargetVersion::Absolute(version), (Some(_), Some(_)) => unreachable!("clap groups should prevent this"), }; let ws_metadata = resolve_ws(manifest_path.as_deref(), locked, offline)?; let root_manifest_path = ws_metadata.workspace_root.as_std_path().join("Cargo.toml"); let workspace_members = find_ws_members(&ws_metadata); if all { shell_warn("The flag `--all` has been deprecated in favor of `--workspace`")?; } let workspace = workspace || all || pkgid.is_empty(); let mut selected = if workspace { workspace_members .iter() .filter(|p| !exclude.contains(&p.name)) .collect::>() } else { workspace_members .iter() .filter(|p| pkgid.contains(&p.name)) .collect::>() }; let update_workspace_version; let mut changed = false; if workspace && exclude.is_empty() { // Fast path update_workspace_version = true; } else { let explicit_selected = selected .iter() .filter(|p| { LocalManifest::try_new(Path::new(&p.manifest_path)) .map(|m| m.version_is_inherited()) .unwrap_or(false) }) .map(|p| p.name.as_str()) .collect::>(); update_workspace_version = !explicit_selected.is_empty(); if update_workspace_version { let implicit = workspace_members .iter() .filter(|i| !selected.iter().any(|s| i.id == s.id)) .filter(|i| { LocalManifest::try_new(Path::new(&i.manifest_path)) .map(|m| m.version_is_inherited()) .unwrap_or(false) }) .collect::>(); let exclude_implicit = implicit .iter() .filter(|p| exclude.contains(&p.name)) .map(|p| p.name.as_str()) .collect::>(); if !exclude_implicit.is_empty() { anyhow::bail!( "Cannot exclude {} package(s) when {} package(s) modify `workspace.package.version`", exclude_implicit.join(", "), explicit_selected.join(", ") ); } selected.extend(implicit); } } if update_workspace_version { let mut ws_manifest = LocalManifest::try_new(&root_manifest_path)?; if let Some(current) = ws_manifest.get_workspace_version() && let Some(next) = target.bump(¤t, metadata.as_deref())? { shell_status( "Upgrading", &format!("workspace version from {current} to {next}"), )?; ws_manifest.set_workspace_version(&next); changed = true; if !dry_run { ws_manifest.write()?; } // Deferring `update_dependents` to the per-package logic } } for package in selected { let current = &package.version; let next = target.bump(current, metadata.as_deref())?; if let Some(next) = next { let mut manifest = LocalManifest::try_new(Path::new(&package.manifest_path))?; if manifest.version_is_inherited() { shell_status( "Upgrading", &format!( "{} from {} to {} (inherited from workspace)", package.name, current, next, ), )?; } else { shell_status( "Upgrading", &format!("{} from {} to {}", package.name, current, next), )?; manifest.set_package_version(&next); changed = true; if !dry_run { manifest.write()?; } } let crate_root = dunce::canonicalize(package.manifest_path.parent().expect("at least a parent"))?; update_dependents( &crate_root, &next, &root_manifest_path, &workspace_members, dry_run, )?; } } if changed { resolve_ws(manifest_path.as_deref(), locked, offline)?; } if dry_run { shell_warn("aborting set-version due to dry run")?; } Ok(()) } fn update_dependents( crate_root: &Path, next: &semver::Version, root_manifest_path: &Path, workspace_members: &[cargo_metadata::Package], dry_run: bool, ) -> CargoResult<()> { // This is redundant with iterating over `workspace_members` // - As `get_dependency_tables_mut` returns workspace dependencies // - If there is a root package // // But split this out for // - Virtual manifests // - Nicer message to the user { update_dependent(crate_root, next, root_manifest_path, "workspace", dry_run)?; } for member in workspace_members.iter() { update_dependent( crate_root, next, member.manifest_path.as_std_path(), &member.name, dry_run, )?; } Ok(()) } fn is_relevant(d: &dyn toml_edit::TableLike, dep_crate_root: &Path, crate_root: &Path) -> bool { if !d.contains_key("version") { return false; } match d .get("path") .and_then(|i| i.as_str()) .and_then(|relpath| dunce::canonicalize(dep_crate_root.join(relpath)).ok()) { Some(dep_path) => dep_path == crate_root, None => false, } } fn update_dependent( crate_root: &Path, next: &semver::Version, manifest_path: &Path, name: &str, dry_run: bool, ) -> CargoResult<()> { let mut dep_manifest = LocalManifest::try_new(manifest_path)?; let mut changed = false; let dep_crate_root = dep_manifest .path .parent() .expect("at least a parent") .to_owned(); for dep in dep_manifest .get_dependency_tables_mut() .flat_map(|t| t.iter_mut().filter_map(|(_, d)| d.as_table_like_mut())) .filter(|d| is_relevant(*d, &dep_crate_root, crate_root)) { let old_req = dep .get("version") .expect("filter ensures this") .as_str() .unwrap_or("*"); if let Some(new_req) = upgrade_requirement(old_req, next)? { shell_status( "Updating", &format!("{name}'s dependency from {old_req} to {new_req}"), )?; dep.insert("version", toml_edit::value(new_req)); changed = true; } } if changed && !dry_run { dep_manifest.write()?; } Ok(()) } fn resolve_ws( manifest_path: Option<&Path>, locked: bool, offline: bool, ) -> CargoResult { let mut cmd = cargo_metadata::MetadataCommand::new(); if let Some(manifest_path) = manifest_path { cmd.manifest_path(manifest_path); } cmd.features(cargo_metadata::CargoOpt::AllFeatures); let mut other = Vec::new(); if locked { other.push("--locked".to_owned()); } if offline { other.push("--offline".to_owned()); } cmd.other_options(other); let ws = cmd.exec()?; Ok(ws) } fn find_ws_members(ws: &cargo_metadata::Metadata) -> Vec { let workspace_members: std::collections::HashSet<_> = ws.workspace_members.iter().collect(); ws.packages .iter() .filter(|p| workspace_members.contains(&p.id)) .cloned() .collect() } cargo-edit-0.13.10/src/bin/set-version/version.rs000064400000000000000000000101751046102023000176600ustar 00000000000000use std::str::FromStr; use cargo_edit::VersionExt; use crate::errors::{CargoResult, version_downgrade_err}; #[derive(Clone, Debug)] pub(crate) enum TargetVersion { Relative(BumpLevel), Absolute(semver::Version), } impl TargetVersion { pub(crate) fn bump( &self, current: &semver::Version, metadata: Option<&str>, ) -> CargoResult> { match self { TargetVersion::Relative(bump_level) => { let mut potential_version = current.to_owned(); bump_level.bump_version(&mut potential_version, metadata)?; if potential_version != *current { let version = potential_version; Ok(Some(version)) } else { Ok(None) } } TargetVersion::Absolute(version) => { if current < version { let mut version = version.clone(); if version.build.is_empty() { if let Some(metadata) = metadata { version.build = semver::BuildMetadata::new(metadata)?; } else { version.build = current.build.clone(); } } Ok(Some(version)) } else if current == version { Ok(None) } else { Err(version_downgrade_err(current, version)) } } } } } impl Default for TargetVersion { fn default() -> Self { TargetVersion::Relative(BumpLevel::Release) } } #[derive(Debug, Clone, Copy)] pub(crate) enum BumpLevel { Major, Minor, Patch, /// Strip all pre-release flags Release, Rc, Beta, Alpha, } impl FromStr for BumpLevel { type Err = String; fn from_str(s: &str) -> Result { match s { "major" => Ok(BumpLevel::Major), "minor" => Ok(BumpLevel::Minor), "patch" => Ok(BumpLevel::Patch), "release" => Ok(BumpLevel::Release), "rc" => Ok(BumpLevel::Rc), "beta" => Ok(BumpLevel::Beta), "alpha" => Ok(BumpLevel::Alpha), _ => Err(String::from( "[valid values: major, minor, patch, rc, beta, alpha]", )), } } } impl BumpLevel { pub(crate) fn bump_version( self, version: &mut semver::Version, metadata: Option<&str>, ) -> CargoResult<()> { match self { BumpLevel::Major => { version.increment_major(); } BumpLevel::Minor => { version.increment_minor(); } BumpLevel::Patch => { if !version.is_prerelease() { version.increment_patch(); } else { version.pre = semver::Prerelease::EMPTY; } } BumpLevel::Release => { if version.is_prerelease() { version.pre = semver::Prerelease::EMPTY; } } BumpLevel::Rc => { version.increment_rc()?; } BumpLevel::Beta => { version.increment_beta()?; } BumpLevel::Alpha => { version.increment_alpha()?; } }; if let Some(metadata) = metadata { version.metadata(metadata)?; } Ok(()) } } #[cfg(test)] mod test { use super::*; fn abs(version: &str) -> TargetVersion { let abs = semver::Version::parse(version).unwrap(); TargetVersion::Absolute(abs) } #[test] fn abs_bump_from_dev() { let expected = "2022.3.0"; let current = "2022.3.0-dev-12345"; let target = abs(expected); let current = semver::Version::parse(current).unwrap(); let actual = target.bump(¤t, None).unwrap(); let actual = actual.expect("Version changed").to_string(); assert_eq!(actual, expected); } } cargo-edit-0.13.10/src/bin/upgrade/cli.rs000064400000000000000000000007341046102023000161130ustar 00000000000000use cargo_edit::CargoResult; use clap::Parser; #[derive(Debug, Parser)] #[command(bin_name = "cargo")] #[command(styles = clap_cargo::style::CLAP_STYLING)] pub(crate) enum Command { Upgrade(crate::upgrade::UpgradeArgs), } impl Command { pub(crate) fn exec(self) -> CargoResult<()> { match self { Self::Upgrade(add) => add.exec(), } } } #[test] fn verify_app() { use clap::CommandFactory; Command::command().debug_assert(); } cargo-edit-0.13.10/src/bin/upgrade/main.rs000064400000000000000000000007361046102023000162720ustar 00000000000000//! `cargo upgrade` #![warn( missing_docs, missing_debug_implementations, missing_copy_implementations, trivial_casts, trivial_numeric_casts, unsafe_code, unstable_features, unused_import_braces, unused_qualifications )] mod cli; mod upgrade; use std::process; use clap::Parser; fn main() { let args = cli::Command::parse(); if let Err(err) = args.exec() { eprintln!("Error: {err:?}"); process::exit(1); } } cargo-edit-0.13.10/src/bin/upgrade/upgrade.rs000064400000000000000000001101511046102023000167660ustar 00000000000000use std::collections::BTreeMap; use std::collections::BTreeSet; use std::path::Path; use std::path::PathBuf; use anyhow::Context as _; use cargo_edit::{ CargoResult, CertsSource, CrateSpec, Dependency, IndexCache, LocalManifest, RustVersion, Source, find_compatible_version, find_latest_version, registry_url, set_dep_version, shell_note, shell_status, shell_warn, shell_write_stdout, }; use clap::Args; use indexmap::IndexMap; use semver::{Op, VersionReq}; use termcolor::{Color, ColorSpec}; /// Upgrade dependency version requirements in Cargo.toml manifest files #[derive(Debug, Args)] #[command(version)] pub(crate) struct UpgradeArgs { /// Print changes to be made without making them. #[arg(long, short = 'n')] dry_run: bool, /// Path to the manifest to upgrade #[arg(long, value_name = "PATH")] manifest_path: Option, /// Override `rust-version` #[arg(long, value_name = "VER", conflicts_with = "ignore_rust_version")] rust_version: Option, /// Ignore `rust-version` specification in packages #[arg(long)] ignore_rust_version: bool, /// Require `Cargo.toml` to be up to date #[arg(long)] locked: bool, #[command(flatten)] verbose: clap_verbosity_flag::Verbosity, /// Unstable (nightly-only) flags #[arg(short = 'Z', value_name = "FLAG", global = true, value_enum)] unstable_features: Vec, /// Upgrade to latest compatible version #[arg( long, num_args=0..=1, value_name = "allow|ignore", hide_possible_values = true, default_value = "allow", default_missing_value = "allow", help_heading = "Version", value_enum, )] compatible: Status, /// Upgrade to latest incompatible version #[arg( short, long, num_args=0..=1, value_name = "allow|ignore", hide_possible_values = true, default_value = "ignore", default_missing_value = "allow", help_heading = "Version", value_enum, )] incompatible: Status, /// Upgrade pinned to latest incompatible version #[arg( long, num_args=0..=1, value_name = "allow|ignore", hide_possible_values = true, default_value = "ignore", default_missing_value = "allow", help_heading = "Version", value_enum, )] pinned: Status, /// Crate to be upgraded #[arg( long, short, value_name = "PKGID[@]", help_heading = "Dependencies" )] package: Vec, /// Crates to exclude and not upgrade. #[arg(long, value_name = "PKGID", help_heading = "Dependencies")] exclude: Vec, /// Recursively update locked dependencies #[arg( long, num_args=0..=1, action = clap::ArgAction::Set, value_name = "true|false", default_missing_value = "true", hide_possible_values = true, help_heading = "Dependencies" )] recursive: Option, } impl UpgradeArgs { pub(crate) fn exec(self) -> CargoResult<()> { exec(self) } fn verbose_num(&self) -> i8 { match self.verbose.filter() { clap_verbosity_flag::VerbosityFilter::Off => -1, clap_verbosity_flag::VerbosityFilter::Error => 0, clap_verbosity_flag::VerbosityFilter::Warn => 1, clap_verbosity_flag::VerbosityFilter::Info => 2, clap_verbosity_flag::VerbosityFilter::Debug => 3, clap_verbosity_flag::VerbosityFilter::Trace => 4, } } fn is_verbose(&self) -> bool { 0 < self.verbose_num() } fn verbose(&self, mut callback: F) -> CargoResult<()> where F: FnMut() -> CargoResult<()>, { if self.is_verbose() { callback() } else { Ok(()) } } } #[derive(Copy, Clone, Debug, PartialEq, Eq, clap::ValueEnum)] enum Status { #[value(alias = "true")] Allow, #[value(alias = "false")] Ignore, } impl Status { fn as_bool(&self) -> bool { match self { Self::Allow => true, Self::Ignore => false, } } } #[derive(Copy, Clone, Debug, PartialEq, Eq, clap::ValueEnum)] enum UnstableOptions {} /// Main processing function. Allows us to return a `Result` so that `main` can print pretty error /// messages. fn exec(args: UpgradeArgs) -> CargoResult<()> { env_logger::Builder::from_env("CARGO_LOG") .filter_level(args.verbose.log_level_filter()) .init(); let offline = false; let mut index = IndexCache::new(CertsSource::Native); let metadata = resolve_ws(args.manifest_path.as_deref(), args.locked, offline)?; let root_manifest_path = metadata.workspace_root.as_std_path().join("Cargo.toml"); let manifests = find_ws_members(&metadata); let mut manifests = manifests .into_iter() .map(|p| { let rust_version = if args.rust_version.is_some() { args.rust_version } else if args.ignore_rust_version { None } else { p.rust_version.as_ref().map(RustVersion::from) }; ( p.name.to_string(), p.manifest_path.as_std_path().to_owned(), rust_version, ) }) .collect::>(); if !manifests.iter().any(|(_, p, _)| *p == root_manifest_path) { let workspace_rust_version = manifests .iter() .map(|(_, _, msrv)| *msrv) .min_by_key(|msrv| msrv.unwrap_or(RustVersion::MAX)) .flatten(); manifests.insert( 0, ( "virtual workspace".to_owned(), root_manifest_path.clone(), workspace_rust_version, ), ); } let selected_dependencies = args .package .iter() .map(|name| { let spec = CrateSpec::resolve(name)?; Ok((spec.name, spec.version_req)) }) .collect::>>>()?; let mut processed_keys = BTreeSet::new(); let mut modified_crates = BTreeSet::new(); let mut git_crates = BTreeSet::new(); let mut pinned_present = false; let mut incompatible_present = false; let mut uninteresting_crates = BTreeSet::new(); for (pkg_name, manifest_path, rust_version) in manifests { let mut manifest = LocalManifest::try_new(&manifest_path)?; let mut crate_modified = false; let mut table = Vec::new(); shell_status("Checking", &format!("{pkg_name}'s dependencies"))?; for dep_table in manifest.get_dependency_tables_mut() { for (dep_key, dep_item) in dep_table.iter_mut() { let mut reason = None; let dep_key = dep_key.get(); let dependency = match Dependency::from_toml(&manifest_path, dep_key, dep_item) { Ok(dependency) => dependency, Err(err) => { shell_warn(&format!("ignoring {dep_key}, unsupported entry: {err}"))?; continue; } }; processed_keys.insert(dependency.name.clone()); if !selected_dependencies.is_empty() && !selected_dependencies.contains_key(&dependency.name) { reason.get_or_insert(Reason::Excluded); } if args.exclude.contains(&dependency.name) { reason.get_or_insert(Reason::Excluded); } let old_version_req = match dependency.version() { Some(version_req) => version_req.to_owned(), None => { let maybe_reason = match dependency.source() { Some(Source::Git(_)) => { if reason.is_none() { git_crates.insert(dependency.name.clone()); } Some(Reason::GitSource) } Some(Source::Path(_)) => Some(Reason::PathSource), Some(Source::Workspace(_)) | Some(Source::Registry(_)) | None => None, }; if let Some(maybe_reason) = maybe_reason { reason.get_or_insert(maybe_reason); let display_name = if let Some(rename) = &dependency.rename { format!("{} ({})", dependency.name, rename) } else { dependency.name.clone() }; table.push(Dep { name: display_name, old_version_req: None, compatible_version: None, latest_version: None, new_version_req: None, reason, }); } else { args.verbose(|| { let source = dependency .source() .map(|s| s.to_string()) .unwrap_or_else(|| "unknown".to_owned()); shell_warn(&format!( "ignoring {}, source is {}", dependency.toml_key(), source, )) })?; } continue; } }; let (latest_compatible, latest_incompatible) = if dependency .source .as_ref() .and_then(|s| s.as_registry()) .is_some() { // Update indices for any alternative registries, unless // we're offline. let registry_url = registry_url(&manifest_path, dependency.registry())?; let krate = index.krate(®istry_url, &dependency.name)?; let versions = krate .as_ref() .map(|k| k.versions.as_slice()) .unwrap_or_default(); let is_prerelease = old_version_req.contains('-'); let latest_compatible = VersionReq::parse(&old_version_req) .ok() .and_then(|old_version_req| { find_compatible_version(versions, &old_version_req, rust_version) }) .map(|d| { d.version() .expect("registry packages always have a version") .to_owned() }); let latest_version = find_latest_version(versions, is_prerelease, rust_version) .map(|d| { d.version() .expect("registry packages always have a version") .to_owned() }); let latest_incompatible = if latest_version != latest_compatible { latest_version } else { // Its compatible None }; (latest_compatible, latest_incompatible) } else { (None, None) }; let is_pinned_dep = dependency.rename.is_some() || is_pinned_req(&old_version_req); let mut new_version_req = if reason.is_some() { Some(old_version_req.clone()) } else { None }; if new_version_req.is_none() && let Some(Some(explicit_version_req)) = selected_dependencies.get(&dependency.name) { if is_pinned_dep && !args.pinned.as_bool() { // `--pinned` is required in case the user meant an unpinned version // in the dependency tree reason.get_or_insert(Reason::Pinned); pinned_present = true; } else { new_version_req = Some(explicit_version_req.to_owned()); } } if new_version_req.is_none() && let Some(latest_incompatible) = &latest_incompatible { let new_version: semver::Version = latest_incompatible.parse()?; let req_candidate = match cargo_edit::upgrade_requirement(&old_version_req, &new_version) { Ok(Some(version_req)) => Some(version_req), Err(_) => { // Didn't know how to preserve existing format, so abandon it Some(latest_incompatible.clone()) } _ => { // Already at latest None } }; if req_candidate.is_some() { if is_pinned_dep && !args.pinned.as_bool() { // `--pinned` is required for incompatible upgrades reason.get_or_insert(Reason::Pinned); pinned_present = true; } else if !args.incompatible.as_bool() && !is_pinned_dep { // `--incompatible` is required for non-pinned deps reason.get_or_insert(Reason::Incompatible); incompatible_present = true; } else { new_version_req = req_candidate; } } } if new_version_req.is_none() && let Some(latest_compatible) = &latest_compatible { // Compatible upgrades are allowed for pinned let new_version: semver::Version = latest_compatible.parse()?; let req_candidate = match cargo_edit::upgrade_requirement(&old_version_req, &new_version) { Ok(Some(version_req)) => Some(version_req), Err(_) => { // Do not change syntax for compatible upgrades Some(old_version_req.clone()) } _ => { // Already at latest None } }; if req_candidate.is_some() { if !args.compatible.as_bool() { reason.get_or_insert(Reason::Compatible); } else { new_version_req = req_candidate; } } } let new_version_req = new_version_req.unwrap_or_else(|| old_version_req.clone()); if new_version_req == old_version_req { reason.get_or_insert(Reason::Latest); } else { set_dep_version(dep_item, &new_version_req)?; crate_modified = true; modified_crates.insert(dependency.name.clone()); } let display_name = if let Some(rename) = &dependency.rename { format!("{} ({})", dependency.name, rename) } else { dependency.name.clone() }; let compatible_version = latest_compatible; let latest_version = latest_incompatible.or_else(|| compatible_version.clone()); table.push(Dep { name: display_name, old_version_req: Some(old_version_req), compatible_version, latest_version, new_version_req: Some(new_version_req), reason, }); } } if !table.is_empty() { let (interesting, uninteresting) = table .into_iter() .partition::, _>(|d| d.show_for(args.verbose_num())); print_upgrade(interesting)?; uninteresting_crates.extend(uninteresting); } if !args.dry_run && !args.locked && crate_modified { manifest.write()?; } } if modified_crates.is_empty() { } else if args.locked { anyhow::bail!("cannot upgrade due to `--locked`"); } else if args.dry_run { } else { // Ensure lock file is updated and collect data for `recursive` let metadata = resolve_ws(Some(&root_manifest_path), args.locked, offline)?; let mut locked = metadata.packages; let precise_deps = selected_dependencies .iter() .filter_map(|(name, req)| { req.as_ref() .and_then(|req| VersionReq::parse(req).ok()) .and_then(|req| { let precise = precise_version(&req)?; Some((name, (req, precise))) }) }) .collect::>(); if !precise_deps.is_empty() { // Rollback the updates to the precise version // // Reusing updates (resolve_ws) so we know what lock_version to reference for (name, (req, precise)) in &precise_deps { for lock_version in locked .iter() .filter(|p| p.name.as_str() == *name) .map(|p| &p.version) .filter(|v| req.matches(v)) { let mut cmd = std::process::Command::new("cargo"); cmd.arg("update"); cmd.arg("--manifest-path").arg(&root_manifest_path); if args.locked { cmd.arg("--locked"); } // NOTE: This will skip the official recursive check and we don't // recursively update its dependencies let dep = format!("{name}@{lock_version}"); cmd.arg("--precise").arg(precise); cmd.arg("--package").arg(dep); // If we're going to request an update, it would have already been done by now cmd.arg("--offline"); log::trace!("Running {cmd:?}"); let output = cmd.output().context("failed to lock to precise version")?; if !output.status.success() { return Err(anyhow::format_err!( "{}", String::from_utf8_lossy(&output.stderr) )) .context("failed to lock to precise version"); } } } // Update data for `recursive` with precise_deps let offline = true; // index should already be updated let metadata = resolve_ws(Some(&root_manifest_path), args.locked, offline)?; locked = metadata.packages; } if !git_crates.is_empty() && args.compatible.as_bool() { shell_status("Upgrading", "git dependencies")?; let mut cmd = std::process::Command::new("cargo"); cmd.arg("update"); cmd.arg("--manifest-path").arg(&root_manifest_path); if args.locked { cmd.arg("--locked"); } for dep in git_crates.iter() { for lock_version in locked .iter() .filter(|p| { p.name.as_str() == *dep && p.source .as_ref() .map(|s| s.repr.starts_with("git+")) .unwrap_or(false) }) .map(|p| &p.version) { let dep = format!("{dep}@{lock_version}"); cmd.arg("--package").arg(dep); } } // If we're going to request an update, it would have already been done by now cmd.arg("--offline"); log::trace!("Running {cmd:?}"); let status = cmd.status().context("recursive dependency update failed")?; if !status.success() { anyhow::bail!("recursive dependency update failed"); } // Update data for `recursive` with precise_deps let offline = true; // index should already be updated let metadata = resolve_ws(Some(&root_manifest_path), args.locked, offline)?; locked = metadata.packages; } if args.recursive.unwrap_or_else(|| args.compatible.as_bool()) { shell_status("Upgrading", "recursive dependencies")?; let mut cmd = std::process::Command::new("cargo"); cmd.arg("update"); cmd.arg("--manifest-path").arg(&root_manifest_path); if args.locked { cmd.arg("--locked"); } // Limit recursive update to what we touched cmd.arg("--aggressive"); let mut still_run = false; for dep in modified_crates .iter() // Already updated so avoid discarding the precise version selection .filter(|c| !precise_deps.contains_key(c)) { for lock_version in locked .iter() .filter(|p| p.name.as_str() == *dep) .map(|p| &p.version) { let dep = format!("{dep}@{lock_version}"); cmd.arg("--package").arg(dep); still_run = true; } } // If we're going to request an update, it would have already been done by now cmd.arg("--offline"); if still_run { log::trace!("Running {cmd:?}"); let status = cmd.status().context("recursive dependency update failed")?; if !status.success() { anyhow::bail!("recursive dependency update failed"); } } } } let unused = selected_dependencies .keys() .filter(|k| !processed_keys.contains(k.as_str())) .map(|k| k.as_str()) .collect::>(); match unused.len() { 0 => {} 1 => anyhow::bail!("dependency {} doesn't exist", unused.join(", ")), _ => anyhow::bail!("dependencies {} don't exist", unused.join(", ")), } if pinned_present { shell_note("Re-run with `--pinned` to upgrade pinned version requirements")?; } if incompatible_present { shell_note("Re-run with `--incompatible` to upgrade incompatible version requirements")?; } if !uninteresting_crates.is_empty() { let mut categorize = BTreeMap::new(); for dep in uninteresting_crates { categorize .entry(dep.long_reason()) .or_insert_with(BTreeSet::new) .insert(dep.name); } let mut note = "Re-run with `--verbose` to show more dependencies".to_owned(); for (reason, deps) in categorize { use std::fmt::Write; write!(&mut note, "\n {reason}: ")?; if deps.len() <= 3 { for (i, dep) in deps.into_iter().enumerate() { if 0 < i { note.push_str(", "); } note.push_str(&dep); } } else { let number = deps.len(); let plural = if number == 1 { "" } else { "s" }; write!(&mut note, "{number} package{plural}")?; } } shell_note(¬e)?; } if args.dry_run { shell_warn("aborting upgrade due to dry run")?; } Ok(()) } fn resolve_ws( manifest_path: Option<&Path>, locked: bool, offline: bool, ) -> CargoResult { let mut cmd = cargo_metadata::MetadataCommand::new(); if let Some(manifest_path) = manifest_path { cmd.manifest_path(manifest_path); } cmd.features(cargo_metadata::CargoOpt::AllFeatures); let mut other = Vec::new(); if locked { other.push("--locked".to_owned()); } if offline { other.push("--offline".to_owned()); } cmd.other_options(other); let ws = cmd.exec().or_else(|_| { cmd.no_deps(); cmd.exec() })?; Ok(ws) } fn find_ws_members(ws: &cargo_metadata::Metadata) -> Vec { let workspace_members: std::collections::HashSet<_> = ws.workspace_members.iter().collect(); ws.packages .iter() .filter(|p| workspace_members.contains(&p.id)) .cloned() .collect() } fn is_pinned_req(old_version_req: &str) -> bool { if let Ok(version_req) = VersionReq::parse(old_version_req) { version_req.comparators.iter().any(|comparator| { matches!( comparator.op, Op::Exact | Op::Less | Op::LessEq | Op::Wildcard ) }) } else { false } } fn precise_version(version_req: &VersionReq) -> Option { version_req .comparators .iter() .filter(|c| { matches!( c.op, // Only ops we can determine a precise version from Op::Exact | Op::GreaterEq | Op::LessEq | Op::Tilde | Op::Caret | Op::Wildcard ) }) .filter_map(|c| { // Only do it when full precision is specified c.minor.and_then(|minor| { c.patch.map(|patch| semver::Version { major: c.major, minor, patch, pre: c.pre.clone(), build: Default::default(), }) }) }) .max() .map(|v| v.to_string()) } #[derive(PartialEq, Eq, PartialOrd, Ord)] struct Dep { name: String, old_version_req: Option, compatible_version: Option, latest_version: Option, new_version_req: Option, reason: Option, } impl Dep { fn old_version_req(&self) -> &str { self.old_version_req.as_deref().unwrap_or("-") } fn old_version_req_spec(&self) -> ColorSpec { ColorSpec::new() } fn compatible_version(&self) -> &str { self.compatible_version.as_deref().unwrap_or("-") } fn compatible_version_spec(&self) -> ColorSpec { let mut spec = ColorSpec::new(); if !self.is_compatible_latest() { spec.set_fg(Some(Color::Yellow)); } spec } fn is_compatible_latest(&self) -> bool { if self.compatible_version.is_none() || self.latest_version.is_none() { true } else { self.compatible_version == self.latest_version } } fn latest_version(&self) -> &str { self.latest_version.as_deref().unwrap_or("-") } fn new_version_req(&self) -> &str { self.new_version_req.as_deref().unwrap_or("-") } fn new_version_req_spec(&self) -> ColorSpec { let mut spec = ColorSpec::new(); if self.req_changed() { spec.set_fg(Some(Color::Green)); } if self.reason.unwrap_or(Reason::Latest).is_upgradeable() { spec.set_fg(Some(Color::Yellow)); } if let Some(latest_version) = self .latest_version .as_ref() .and_then(|v| semver::Version::parse(v).ok()) && let Some(new_version_req) = &self.new_version_req && let Ok(new_version_req) = VersionReq::parse(new_version_req) && !new_version_req.matches(&latest_version) { spec.set_fg(Some(Color::Red)); } spec } fn req_changed(&self) -> bool { self.new_version_req != self.old_version_req } fn short_reason(&self) -> &'static str { self.reason.map(|r| r.as_short()).unwrap_or("") } fn long_reason(&self) -> &'static str { self.reason.map(|r| r.as_long()).unwrap_or("") } fn reason_spec(&self) -> ColorSpec { let mut spec = ColorSpec::new(); if self.reason.unwrap_or(Reason::Latest).is_warning() { spec.set_fg(Some(Color::Yellow)); } spec } fn show_for(&self, verbosity: i8) -> bool { if 2 <= verbosity { return true; } if self.req_changed() { return true; } if 0 < verbosity { if self.reason.unwrap_or(Reason::Latest).is_upgradeable() { return true; } if !self.old_req_matches_latest() { // Show excluded cases with potential return true; } } false } fn old_req_matches_latest(&self) -> bool { if let Some(latest_version) = self .latest_version .as_ref() .and_then(|v| semver::Version::parse(v).ok()) && let Some(old_version_req) = &self.old_version_req && let Ok(old_version_req) = VersionReq::parse(old_version_req) { return old_version_req.matches(&latest_version); } true } } #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] enum Reason { Latest, Compatible, Incompatible, Pinned, GitSource, PathSource, Excluded, } impl Reason { fn is_upgradeable(&self) -> bool { match self { Self::Latest => false, Self::Compatible => true, Self::Incompatible => true, Self::Pinned => true, Self::GitSource => false, Self::PathSource => false, Self::Excluded => false, } } fn is_warning(&self) -> bool { match self { Self::Latest => false, Self::Compatible => false, Self::Incompatible => true, Self::Pinned => true, Self::GitSource => false, Self::PathSource => false, Self::Excluded => false, } } fn as_short(&self) -> &'static str { match self { Self::Latest => "", Self::Compatible => "compatible", Self::Incompatible => "incompatible", Self::Pinned => "pinned", Self::GitSource => "git", Self::PathSource => "local", Self::Excluded => "excluded", } } fn as_long(&self) -> &'static str { match self { Self::Latest => "latest", Self::Compatible => "compatible", Self::Incompatible => "incompatible", Self::Pinned => "pinned", Self::GitSource => "git", Self::PathSource => "local", Self::Excluded => "excluded", } } } /// Print a message if the new dependency version is different from the old one. fn print_upgrade(mut interesting: Vec) -> CargoResult<()> { if interesting.is_empty() { return Ok(()); } interesting.splice( 0..0, [ Dep { name: "name".to_owned(), old_version_req: Some("old req".to_owned()), compatible_version: Some("compatible".to_owned()), latest_version: Some("latest".to_owned()), new_version_req: Some("new req".to_owned()), reason: None, }, Dep { name: "====".to_owned(), old_version_req: Some("=======".to_owned()), compatible_version: Some("==========".to_owned()), latest_version: Some("======".to_owned()), new_version_req: Some("=======".to_owned()), reason: None, }, ], ); let mut width = [0; 6]; for (i, dep) in interesting.iter().enumerate() { width[0] = width[0].max(dep.name.len()); width[1] = width[1].max(dep.old_version_req().len()); width[2] = width[2].max(dep.compatible_version().len()); width[3] = width[3].max(dep.latest_version().len()); width[4] = width[4].max(dep.new_version_req().len()); if 1 < i { width[5] = width[5].max(dep.short_reason().len()); } } if 0 < width[5] { width[5] = width[5].max("note".len()); } for (i, dep) in interesting.iter().enumerate() { let is_header = (0..=1).contains(&i); let mut header_spec = ColorSpec::new(); header_spec.set_bold(true); let spec = if is_header { header_spec.clone() } else { ColorSpec::new() }; write_cell(&dep.name, width[0], &spec)?; shell_write_stdout(" ", &ColorSpec::new())?; let spec = if is_header { header_spec.clone() } else { dep.old_version_req_spec() }; write_cell(dep.old_version_req(), width[1], &spec)?; shell_write_stdout(" ", &ColorSpec::new())?; let spec = if is_header { header_spec.clone() } else { dep.compatible_version_spec() }; write_cell(dep.compatible_version(), width[2], &spec)?; shell_write_stdout(" ", &ColorSpec::new())?; let spec = if is_header { header_spec.clone() } else { ColorSpec::new() }; write_cell(dep.latest_version(), width[3], &spec)?; shell_write_stdout(" ", &ColorSpec::new())?; let spec = if is_header { header_spec.clone() } else { dep.new_version_req_spec() }; write_cell(dep.new_version_req(), width[4], &spec)?; if 0 < width[5] { shell_write_stdout(" ", &ColorSpec::new())?; let spec = if is_header { header_spec.clone() } else { dep.reason_spec() }; let reason = match i { 0 => "note", 1 => "====", _ => dep.short_reason(), }; write_cell(reason, width[5], &spec)?; } shell_write_stdout("\n", &ColorSpec::new())?; } Ok(()) } fn write_cell(content: &str, width: usize, spec: &ColorSpec) -> CargoResult<()> { shell_write_stdout(content, spec)?; for _ in 0..(width - content.len()) { shell_write_stdout(" ", &ColorSpec::new())?; } Ok(()) } #[cfg(test)] mod test { use super::*; #[test] fn exact_is_pinned_req() { let req = "=3"; assert!(is_pinned_req(req)); } #[test] fn less_than_is_pinned_req() { let req = "<3"; assert!(is_pinned_req(req)); } #[test] fn less_than_equal_is_pinned_req() { let req = "<=3"; assert!(is_pinned_req(req)); } #[test] fn minor_wildcard_is_pinned_req() { let req = "3.*"; assert!(is_pinned_req(req)); } #[test] fn major_wildcard_is_not_pinned() { let req = "*"; assert!(!is_pinned_req(req)); } #[test] fn greater_than_is_not_pinned() { let req = ">3"; assert!(!is_pinned_req(req)); } #[test] fn greater_than_equal_is_not_pinned() { let req = ">=3"; assert!(!is_pinned_req(req)); } #[test] fn caret_is_not_pinned() { let req = "^3"; assert!(!is_pinned_req(req)); } #[test] fn default_is_not_pinned() { let req = "3"; assert!(!is_pinned_req(req)); } } cargo-edit-0.13.10/src/crate_spec.rs000064400000000000000000000027761046102023000152650ustar 00000000000000//! Crate name parsing. use super::errors::{CargoResult, Context, Error}; /// User-specified crate /// /// This can be a /// - Name (e.g. `docopt`) /// - Name and a version req (e.g. `docopt@^0.8`) /// - Path #[derive(Debug)] pub struct CrateSpec { /// Crate name pub name: String, /// Optional version requirement pub version_req: Option, } impl CrateSpec { /// Convert a string to a `Crate` pub fn resolve(pkg_id: &str) -> CargoResult { let (name, version) = pkg_id .split_once('@') .map(|(n, v)| (n, Some(v))) .unwrap_or((pkg_id, None)); let invalid: Vec<_> = name .chars() .filter(|c| !is_name_char(*c)) .map(|c| c.to_string()) .collect(); if !invalid.is_empty() { return Err(anyhow::format_err!( "Invalid name `{}`: {}", name, invalid.join(", ") )); } if let Some(version) = version { semver::VersionReq::parse(version) .with_context(|| format!("Invalid version requirement `{version}`"))?; } Ok(Self { name: name.to_owned(), version_req: version.map(|s| s.to_owned()), }) } } impl std::str::FromStr for CrateSpec { type Err = Error; fn from_str(s: &str) -> CargoResult { Self::resolve(s) } } fn is_name_char(c: char) -> bool { c.is_alphanumeric() || ['-', '_'].contains(&c) } cargo-edit-0.13.10/src/dependency.rs000064400000000000000000001052431046102023000152640ustar 00000000000000use std::collections::BTreeMap; use std::path::{Path, PathBuf}; use indexmap::IndexSet; use toml_edit::KeyMut; use super::manifest::str_or_1_len_table; use crate::CargoResult; /// A dependency handled by Cargo /// /// `None` means the field will be blank in TOML #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone)] #[non_exhaustive] pub struct Dependency { /// The name of the dependency (as it is set in its `Cargo.toml` and known to crates.io) pub name: String, /// Whether the dependency is opted-in with a feature flag pub optional: Option, /// List of features to add (or None to keep features unchanged). pub features: Option>, /// Whether default features are enabled pub default_features: Option, /// List of features inherited from a workspace dependency pub inherited_features: Option>, /// Where the dependency comes from pub source: Option, /// Non-default registry pub registry: Option, /// If the dependency is renamed, this is the new name for the dependency /// as a string. None if it is not renamed. pub rename: Option, /// Features that are exposed by the dependency pub available_features: BTreeMap>, } impl Dependency { /// Create a new dependency with a name pub fn new(name: &str) -> Self { Self { name: name.into(), optional: None, features: None, default_features: None, inherited_features: None, source: None, registry: None, rename: None, available_features: Default::default(), } } /// Set dependency to a given version pub fn set_source(mut self, source: impl Into) -> Self { self.source = Some(source.into()); self } /// Set the available features of the dependency to a given vec pub fn set_available_features( mut self, available_features: BTreeMap>, ) -> Self { self.available_features = available_features; self } /// Set whether the dependency is optional #[allow(dead_code)] pub fn set_optional(mut self, opt: bool) -> Self { self.optional = Some(opt); self } /// Set features as an array of string (does some basic parsing) #[allow(dead_code)] pub fn set_features(mut self, features: Vec) -> Self { self.features = Some(features); self } /// Set features as an array of string (does some basic parsing) pub fn extend_features(mut self, features: impl IntoIterator) -> Self { self.features .get_or_insert_with(Default::default) .extend(features); self } /// Set the value of default-features for the dependency #[allow(dead_code)] pub fn set_default_features(mut self, default_features: bool) -> Self { self.default_features = Some(default_features); self } /// Set the alias for the dependency pub fn set_rename(mut self, rename: &str) -> Self { self.rename = Some(rename.into()); self } /// Set the value of registry for the dependency pub fn set_registry(mut self, registry: impl Into) -> Self { self.registry = Some(registry.into()); self } /// Set features as an array of string (does some basic parsing) pub fn set_inherited_features(mut self, features: Vec) -> Self { self.inherited_features = Some(features); self } /// Get the dependency source pub fn source(&self) -> Option<&Source> { self.source.as_ref() } /// Get version of dependency pub fn version(&self) -> Option<&str> { match self.source()? { Source::Registry(src) => Some(src.version.as_str()), Source::Path(src) => src.version.as_deref(), Source::Git(src) => src.version.as_deref(), Source::Workspace(_) => None, } } /// Get registry of the dependency pub fn registry(&self) -> Option<&str> { self.registry.as_deref() } /// Get the alias for the dependency (if any) pub fn rename(&self) -> Option<&str> { self.rename.as_deref() } /// Whether default features are activated pub fn default_features(&self) -> Option { self.default_features } /// Get whether the dep is optional pub fn optional(&self) -> Option { self.optional } } impl Dependency { /// Create a dependency from a TOML table entry pub fn from_toml(crate_root: &Path, key: &str, item: &toml_edit::Item) -> CargoResult { if let Some(version) = item.as_str() { let dep = Self::new(key).set_source(RegistrySource::new(version)); Ok(dep) } else if let Some(table) = item.as_table_like() { let (name, rename) = if let Some(value) = table.get("package") { ( value .as_str() .ok_or_else(|| invalid_type(key, "package", value.type_name(), "string"))? .to_owned(), Some(key.to_owned()), ) } else { (key.to_owned(), None) }; let source: Source = if let Some(git) = table.get("git") { let mut src = GitSource::new( git.as_str() .ok_or_else(|| invalid_type(key, "git", git.type_name(), "string"))?, ); if let Some(value) = table.get("branch") { src = src.set_branch(value.as_str().ok_or_else(|| { invalid_type(key, "branch", value.type_name(), "string") })?); } if let Some(value) = table.get("tag") { src = src.set_tag(value.as_str().ok_or_else(|| { invalid_type(key, "tag", value.type_name(), "string") })?); } if let Some(value) = table.get("rev") { src = src.set_rev(value.as_str().ok_or_else(|| { invalid_type(key, "rev", value.type_name(), "string") })?); } if let Some(value) = table.get("version") { src = src.set_version(value.as_str().ok_or_else(|| { invalid_type(key, "version", value.type_name(), "string") })?); } src.into() } else if let Some(path) = table.get("path") { let path = crate_root .join(path.as_str().ok_or_else(|| { invalid_type(key, "path", path.type_name(), "string") })?); let mut src = PathSource::new(path); if let Some(value) = table.get("version") { src = src.set_version(value.as_str().ok_or_else(|| { invalid_type(key, "version", value.type_name(), "string") })?); } src.into() } else if let Some(version) = table.get("version") { let src = RegistrySource::new(version.as_str().ok_or_else(|| { invalid_type(key, "version", version.type_name(), "string") })?); src.into() } else if let Some(workspace) = table.get("workspace") { let workspace_bool = workspace.as_bool().ok_or_else(|| { invalid_type(key, "workspace", workspace.type_name(), "bool") })?; if !workspace_bool { anyhow::bail!("`{key}.workspace = false` is unsupported") } let src = WorkspaceSource::new(); src.into() } else { anyhow::bail!("Unrecognized dependency source for `{key}`"); }; let registry = if let Some(value) = table.get("registry") { Some( value .as_str() .ok_or_else(|| invalid_type(key, "registry", value.type_name(), "string"))? .to_owned(), ) } else { None }; let default_features = table.get("default-features").and_then(|v| v.as_bool()); if table.contains_key("default_features") { anyhow::bail!( "Use of `default_features` in `{key}` is unsupported, please switch to `default-features`" ); } let features = if let Some(value) = table.get("features") { Some( value .as_array() .ok_or_else(|| invalid_type(key, "features", value.type_name(), "array"))? .iter() .map(|v| { v.as_str().map(|s| s.to_owned()).ok_or_else(|| { invalid_type(key, "features", v.type_name(), "string") }) }) .collect::>>()?, ) } else { None }; let available_features = BTreeMap::default(); let optional = table.get("optional").and_then(|v| v.as_bool()); let dep = Self { name, rename, source: Some(source), registry, default_features, features, available_features, optional, inherited_features: None, }; Ok(dep) } else { anyhow::bail!("Unrecognized` dependency entry format for `{key}"); } } /// Get the dependency name as defined in the manifest, /// that is, either the alias (rename field if Some), /// or the official package name (name field). pub fn toml_key(&self) -> &str { self.rename().unwrap_or(&self.name) } /// Convert dependency to TOML /// /// Returns a tuple with the dependency's name and either the version as a `String` /// or the path/git repository as an `InlineTable`. /// (If the dependency is set as `optional` or `default-features` is set to `false`, /// an `InlineTable` is returned in any case.) /// /// # Panic /// /// Panics if the path is relative pub fn to_toml(&self, crate_root: &Path) -> toml_edit::Item { assert!( crate_root.is_absolute(), "Absolute path needed, got: {}", crate_root.display() ); let table: toml_edit::Item = match ( self.optional.unwrap_or(false), self.features.as_ref(), self.default_features.unwrap_or(true), self.source.as_ref(), self.registry.as_ref(), self.rename.as_ref(), ) { // Extra short when version flag only ( false, None, true, Some(Source::Registry(RegistrySource { version: v })), None, None, ) => toml_edit::value(v), (false, None, true, Some(Source::Workspace(WorkspaceSource {})), None, None) => { let mut table = toml_edit::InlineTable::default(); table.set_dotted(true); table.insert("workspace", true.into()); toml_edit::value(toml_edit::Value::InlineTable(table)) } // Other cases are represented as an inline table (_, _, _, _, _, _) => { let mut table = toml_edit::InlineTable::default(); match &self.source { Some(Source::Registry(src)) => { table.insert("version", src.version.as_str().into()); } Some(Source::Path(src)) => { let relpath = path_field(crate_root, &src.path); if let Some(r) = src.version.as_deref() { table.insert("version", r.into()); } table.insert("path", relpath.into()); } Some(Source::Git(src)) => { table.insert("git", src.git.as_str().into()); if let Some(branch) = src.branch.as_deref() { table.insert("branch", branch.into()); } if let Some(tag) = src.tag.as_deref() { table.insert("tag", tag.into()); } if let Some(rev) = src.rev.as_deref() { table.insert("rev", rev.into()); } if let Some(r) = src.version.as_deref() { table.insert("version", r.into()); } } Some(Source::Workspace(_)) => { table.insert("workspace", true.into()); } None => {} } if table.contains_key("version") && let Some(r) = self.registry.as_deref() { table.insert("registry", r.into()); } if self.rename.is_some() { table.insert("package", self.name.as_str().into()); } if let Some(v) = self.default_features { table.insert("default-features", v.into()); } if let Some(features) = self.features.as_ref() { let features: toml_edit::Value = features.iter().cloned().collect(); table.insert("features", features); } if let Some(v) = self.optional { table.insert("optional", v.into()); } toml_edit::value(toml_edit::Value::InlineTable(table)) } }; table } /// Modify existing entry to match this dependency pub fn update_toml(&self, crate_root: &Path, key: &mut KeyMut<'_>, item: &mut toml_edit::Item) { if str_or_1_len_table(item) { // Nothing to preserve *item = self.to_toml(crate_root); key.fmt(); } else if let Some(table) = item.as_table_like_mut() { match &self.source { Some(Source::Registry(src)) => { overwrite_value(table, "version", src.version.as_str()); for key in ["path", "git", "branch", "tag", "rev", "workspace"] { table.remove(key); } } Some(Source::Path(src)) => { let relpath = path_field(crate_root, &src.path); overwrite_value(table, "path", relpath); if let Some(r) = src.version.as_deref() { overwrite_value(table, "version", r); } else { table.remove("version"); } for key in ["git", "branch", "tag", "rev", "workspace"] { table.remove(key); } } Some(Source::Git(src)) => { overwrite_value(table, "git", src.git.as_str()); if let Some(branch) = src.branch.as_deref() { overwrite_value(table, "branch", branch); } else { table.remove("branch"); } if let Some(tag) = src.tag.as_deref() { overwrite_value(table, "tag", tag); } else { table.remove("tag"); } if let Some(rev) = src.rev.as_deref() { overwrite_value(table, "rev", rev); } else { table.remove("rev"); } if let Some(r) = src.version.as_deref() { overwrite_value(table, "version", r); } else { table.remove("version"); } for key in ["path", "workspace"] { table.remove(key); } } Some(Source::Workspace(_)) => { overwrite_value(table, "workspace", true); table.set_dotted(true); key.fmt(); for key in [ "version", "registry", "registry-index", "path", "git", "branch", "tag", "rev", "package", "default-features", ] { table.remove(key); } } None => {} } if table.contains_key("version") { if let Some(r) = self.registry.as_deref() { overwrite_value(table, "registry", r); } else { table.remove("registry"); } } else { table.remove("registry"); } if self.rename.is_some() { overwrite_value(table, "package", self.name.as_str()); } match self.default_features { Some(v) => { overwrite_value(table, "default-features", v); } None => { table.remove("default-features"); } } if let Some(new_features) = self.features.as_ref() { let mut features = table .get("features") .and_then(|i| i.as_value()) .and_then(|v| v.as_array()) .and_then(|a| { a.iter() .map(|v| v.as_str()) .collect::>>() }) .unwrap_or_default(); features.extend(new_features.iter().map(|s| s.as_str())); let features = features.into_iter().collect::(); table.set_dotted(false); overwrite_value(table, "features", features); } else { table.remove("features"); } match self.optional { Some(v) => { table.set_dotted(false); overwrite_value(table, "optional", v); } None => { table.remove("optional"); } } } else { unreachable!("Invalid dependency type: {}", item.type_name()); } } } impl Default for WorkspaceSource { fn default() -> Self { Self::new() } } /// Overwrite a value while preserving the original formatting fn overwrite_value( table: &mut dyn toml_edit::TableLike, key: &str, value: impl Into, ) { let mut value = value.into(); let existing = table.entry(key).or_insert(toml_edit::Item::None); let existing_decor = existing .as_value() .map(|v| v.decor().clone()) .unwrap_or_default(); *value.decor_mut() = existing_decor; *existing = toml_edit::Item::Value(value); } fn invalid_type(dep: &str, key: &str, actual: &str, expected: &str) -> anyhow::Error { anyhow::format_err!("Found {actual} for {key} when {expected} was expected for {dep}") } impl std::fmt::Display for Dependency { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { if let Some(source) = self.source() { write!(f, "{}@{}", self.name, source) } else { self.toml_key().fmt(f) } } } fn path_field(crate_root: &Path, abs_path: &Path) -> String { let relpath = pathdiff::diff_paths(abs_path, crate_root).expect("both paths are absolute"); relpath.to_str().unwrap().replace('\\', "/") } /// Primary location of a dependency #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone)] pub enum Source { /// Dependency from a registry Registry(RegistrySource), /// Dependency from a local path Path(PathSource), /// Dependency from a git repo Git(GitSource), /// Dependency from a workspace Workspace(WorkspaceSource), } impl Source { /// Access the registry source, if present pub fn as_registry(&self) -> Option<&RegistrySource> { match self { Self::Registry(src) => Some(src), _ => None, } } /// Access the path source, if present #[allow(dead_code)] pub fn as_path(&self) -> Option<&PathSource> { match self { Self::Path(src) => Some(src), _ => None, } } /// Access the git source, if present #[allow(dead_code)] pub fn as_git(&self) -> Option<&GitSource> { match self { Self::Git(src) => Some(src), _ => None, } } /// Access the workspace source, if present #[allow(dead_code)] pub fn as_workspace(&self) -> Option<&WorkspaceSource> { match self { Self::Workspace(src) => Some(src), _ => None, } } } impl std::fmt::Display for Source { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::Registry(src) => src.fmt(f), Self::Path(src) => src.fmt(f), Self::Git(src) => src.fmt(f), Self::Workspace(src) => src.fmt(f), } } } impl<'s> From<&'s Source> for Source { fn from(inner: &'s Source) -> Self { inner.clone() } } impl From for Source { fn from(inner: RegistrySource) -> Self { Self::Registry(inner) } } impl From for Source { fn from(inner: PathSource) -> Self { Self::Path(inner) } } impl From for Source { fn from(inner: GitSource) -> Self { Self::Git(inner) } } impl From for Source { fn from(inner: WorkspaceSource) -> Self { Self::Workspace(inner) } } /// Dependency from a registry #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone)] #[non_exhaustive] pub struct RegistrySource { /// Version requirement pub version: String, } impl RegistrySource { /// Specify dependency by version requirement pub fn new(version: impl AsRef) -> Self { // versions might have semver metadata appended which we do not want to // store in the cargo toml files. This would cause a warning upon compilation // ("version requirement […] includes semver metadata which will be ignored") let version = version.as_ref().split('+').next().unwrap(); Self { version: version.to_owned(), } } } impl std::fmt::Display for RegistrySource { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { self.version.fmt(f) } } /// Dependency from a local path #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone)] #[non_exhaustive] pub struct PathSource { /// Local, absolute path pub path: PathBuf, /// Version requirement for when published pub version: Option, } impl PathSource { /// Specify dependency from a path pub fn new(path: impl Into) -> Self { Self { path: path.into(), version: None, } } /// Set an optional version requirement pub fn set_version(mut self, version: impl AsRef) -> Self { // versions might have semver metadata appended which we do not want to // store in the cargo toml files. This would cause a warning upon compilation // ("version requirement […] includes semver metadata which will be ignored") let version = version.as_ref().split('+').next().unwrap(); self.version = Some(version.to_owned()); self } } impl std::fmt::Display for PathSource { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { self.path.display().fmt(f) } } /// Dependency from a git repo #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone)] #[non_exhaustive] pub struct GitSource { /// Repo URL pub git: String, /// Select specific branch pub branch: Option, /// Select specific tag pub tag: Option, /// Select specific rev pub rev: Option, /// Version requirement for when published pub version: Option, } impl GitSource { /// Specify dependency from a git repo pub fn new(git: impl Into) -> Self { Self { git: git.into(), branch: None, tag: None, rev: None, version: None, } } /// Specify an optional branch pub fn set_branch(mut self, branch: impl Into) -> Self { self.branch = Some(branch.into()); self.tag = None; self.rev = None; self } /// Specify an optional tag pub fn set_tag(mut self, tag: impl Into) -> Self { self.branch = None; self.tag = Some(tag.into()); self.rev = None; self } /// Specify an optional rev pub fn set_rev(mut self, rev: impl Into) -> Self { self.branch = None; self.tag = None; self.rev = Some(rev.into()); self } /// Set an optional version requirement pub fn set_version(mut self, version: impl AsRef) -> Self { // versions might have semver metadata appended which we do not want to // store in the cargo toml files. This would cause a warning upon compilation // ("version requirement […] includes semver metadata which will be ignored") let version = version.as_ref().split('+').next().unwrap(); self.version = Some(version.to_owned()); self } } impl std::fmt::Display for GitSource { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.git)?; if let Some(branch) = &self.branch { write!(f, "?branch={branch}")?; } else if let Some(tag) = &self.tag { write!(f, "?tag={tag}")?; } else if let Some(rev) = &self.rev { write!(f, "?rev={rev}")?; } Ok(()) } } /// Dependency from a workspace #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Copy, Clone)] #[non_exhaustive] pub struct WorkspaceSource; impl WorkspaceSource { pub fn new() -> Self { Self } } impl std::fmt::Display for WorkspaceSource { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { "workspace".fmt(f) } } #[cfg(test)] mod tests { use std::path::Path; use super::*; #[test] fn to_toml_simple_dep() { let crate_root = dunce::canonicalize(std::env::current_dir().unwrap().join(Path::new("/"))) .expect("root exists"); let dep = Dependency::new("dep").set_source(RegistrySource::new("1.0")); let key = dep.toml_key(); let item = dep.to_toml(&crate_root); assert_eq!(key, "dep".to_owned()); verify_roundtrip(&crate_root, key, &item); } #[test] fn to_toml_simple_dep_with_version() { let crate_root = dunce::canonicalize(std::env::current_dir().unwrap().join(Path::new("/"))) .expect("root exists"); let dep = Dependency::new("dep").set_source(RegistrySource::new("1.0")); let key = dep.toml_key(); let item = dep.to_toml(&crate_root); assert_eq!(key, "dep".to_owned()); assert_eq!(item.as_str(), Some("1.0")); verify_roundtrip(&crate_root, key, &item); } #[test] fn to_toml_optional_dep() { let crate_root = dunce::canonicalize(std::env::current_dir().unwrap().join(Path::new("/"))) .expect("root exists"); let dep = Dependency::new("dep") .set_source(RegistrySource::new("1.0")) .set_optional(true); let key = dep.toml_key(); let item = dep.to_toml(&crate_root); assert_eq!(key, "dep".to_owned()); assert!(item.is_inline_table()); let dep = item.as_inline_table().unwrap(); assert_eq!(dep.get("optional").unwrap().as_bool(), Some(true)); verify_roundtrip(&crate_root, key, &item); } #[test] fn to_toml_dep_without_default_features() { let crate_root = dunce::canonicalize(std::env::current_dir().unwrap().join(Path::new("/"))) .expect("root exists"); let dep = Dependency::new("dep") .set_source(RegistrySource::new("1.0")) .set_default_features(false); let key = dep.toml_key(); let item = dep.to_toml(&crate_root); assert_eq!(key, "dep".to_owned()); assert!(item.is_inline_table()); let dep = item.as_inline_table().unwrap(); assert_eq!(dep.get("default-features").unwrap().as_bool(), Some(false)); verify_roundtrip(&crate_root, key, &item); } #[test] fn to_toml_dep_with_path_source() { let root = dunce::canonicalize(std::env::current_dir().unwrap().join(Path::new("/"))) .expect("root exists"); let crate_root = root.join("foo"); let dep = Dependency::new("dep").set_source(PathSource::new(root.join("bar"))); let key = dep.toml_key(); let item = dep.to_toml(&crate_root); assert_eq!(key, "dep".to_owned()); assert!(item.is_inline_table()); let dep = item.as_inline_table().unwrap(); assert_eq!(dep.get("path").unwrap().as_str(), Some("../bar")); verify_roundtrip(&crate_root, key, &item); } #[test] fn to_toml_dep_with_git_source() { let crate_root = dunce::canonicalize(std::env::current_dir().unwrap().join(Path::new("/"))) .expect("root exists"); let dep = Dependency::new("dep").set_source(GitSource::new("https://foor/bar.git")); let key = dep.toml_key(); let item = dep.to_toml(&crate_root); assert_eq!(key, "dep".to_owned()); assert!(item.is_inline_table()); let dep = item.as_inline_table().unwrap(); assert_eq!( dep.get("git").unwrap().as_str(), Some("https://foor/bar.git") ); verify_roundtrip(&crate_root, key, &item); } #[test] fn to_toml_renamed_dep() { let crate_root = dunce::canonicalize(std::env::current_dir().unwrap().join(Path::new("/"))) .expect("root exists"); let dep = Dependency::new("dep") .set_source(RegistrySource::new("1.0")) .set_rename("d"); let key = dep.toml_key(); let item = dep.to_toml(&crate_root); assert_eq!(key, "d".to_owned()); assert!(item.is_inline_table()); let dep = item.as_inline_table().unwrap(); assert_eq!(dep.get("package").unwrap().as_str(), Some("dep")); verify_roundtrip(&crate_root, key, &item); } #[test] fn to_toml_dep_from_alt_registry() { let crate_root = dunce::canonicalize(std::env::current_dir().unwrap().join(Path::new("/"))) .expect("root exists"); let dep = Dependency::new("dep") .set_source(RegistrySource::new("1.0")) .set_registry("alternative"); let key = dep.toml_key(); let item = dep.to_toml(&crate_root); assert_eq!(key, "dep".to_owned()); assert!(item.is_inline_table()); let dep = item.as_inline_table().unwrap(); assert_eq!(dep.get("registry").unwrap().as_str(), Some("alternative")); verify_roundtrip(&crate_root, key, &item); } #[test] fn to_toml_complex_dep() { let crate_root = dunce::canonicalize(std::env::current_dir().unwrap().join(Path::new("/"))) .expect("root exists"); let dep = Dependency::new("dep") .set_source(RegistrySource::new("1.0")) .set_default_features(false) .set_rename("d"); let key = dep.toml_key(); let item = dep.to_toml(&crate_root); assert_eq!(key, "d".to_owned()); assert!(item.is_inline_table()); let dep = item.as_inline_table().unwrap(); assert_eq!(dep.get("package").unwrap().as_str(), Some("dep")); assert_eq!(dep.get("version").unwrap().as_str(), Some("1.0")); assert_eq!(dep.get("default-features").unwrap().as_bool(), Some(false)); verify_roundtrip(&crate_root, key, &item); } #[test] fn paths_with_forward_slashes_are_left_as_is() { let crate_root = dunce::canonicalize(std::env::current_dir().unwrap().join(Path::new("/"))) .expect("root exists"); let path = crate_root.join("sibling/crate"); let relpath = "sibling/crate"; let dep = Dependency::new("dep").set_source(PathSource::new(path)); let key = dep.toml_key(); let item = dep.to_toml(&crate_root); let table = item.as_inline_table().unwrap(); let got = table.get("path").unwrap().as_str().unwrap(); assert_eq!(got, relpath); verify_roundtrip(&crate_root, key, &item); } #[test] #[cfg(windows)] fn normalise_windows_style_paths() { let crate_root = dunce::canonicalize(&std::env::current_dir().unwrap().join(Path::new("/"))) .expect("root exists"); let original = crate_root.join(r"sibling\crate"); let should_be = "sibling/crate"; let dep = Dependency::new("dep").set_source(PathSource::new(original)); let key = dep.toml_key(); let item = dep.to_toml(&crate_root); let table = item.as_inline_table().unwrap(); let got = table.get("path").unwrap().as_str().unwrap(); assert_eq!(got, should_be); verify_roundtrip(&crate_root, key, &item); } #[track_caller] fn verify_roundtrip(crate_root: &Path, key: &str, item: &toml_edit::Item) { let roundtrip = Dependency::from_toml(crate_root, key, item).unwrap(); let round_key = roundtrip.toml_key(); let round_item = roundtrip.to_toml(crate_root); assert_eq!(key, round_key); assert_eq!(item.to_string(), round_item.to_string()); } } cargo-edit-0.13.10/src/errors.rs000064400000000000000000000046141046102023000144620ustar 00000000000000use std::fmt::Display; /// Common result type pub type CargoResult = anyhow::Result; /// Common error type pub type Error = anyhow::Error; pub use anyhow::Context; /// CLI-specific result pub type CliResult = Result<(), CliError>; #[derive(Debug)] /// The CLI error is the error type used at Cargo's CLI-layer. /// /// All errors from the lib side of Cargo will get wrapped with this error. /// Other errors (such as command-line argument validation) will create this /// directly. pub struct CliError { /// The error to display. This can be `None` in rare cases to exit with a /// code without displaying a message. For example `cargo run -q` where /// the resulting process exits with a nonzero code (on Windows), or an /// external subcommand that exits nonzero (we assume it printed its own /// message). pub error: Option, /// The process exit code. pub exit_code: i32, } impl CliError { /// Attach an error code to an error pub fn new(error: anyhow::Error, code: i32) -> CliError { CliError { error: Some(error), exit_code: code, } } /// Silent error pub fn code(code: i32) -> CliError { CliError { error: None, exit_code: code, } } } impl From for CliError { fn from(err: anyhow::Error) -> CliError { CliError::new(err, 101) } } impl From for CliError { fn from(err: clap::Error) -> CliError { #[allow(clippy::bool_to_int_with_if)] let code = if err.use_stderr() { 1 } else { 0 }; CliError::new(err.into(), code) } } impl From for CliError { fn from(err: std::io::Error) -> CliError { CliError::new(err.into(), 1) } } pub(crate) fn non_existent_table_err(table: impl Display) -> Error { anyhow::format_err!("The table `{table}` could not be found.") } pub(crate) fn non_existent_dependency_err(name: impl Display, table: impl Display) -> Error { anyhow::format_err!("The dependency `{name}` could not be found in `{table}`.",) } pub(crate) fn unsupported_version_req(req: impl Display) -> Error { anyhow::format_err!("Support for modifying {req} is currently unsupported") } pub(crate) fn invalid_release_level(actual: impl Display, version: impl Display) -> Error { anyhow::format_err!("Cannot increment the {actual} field for {version}") } cargo-edit-0.13.10/src/fetch.rs000064400000000000000000000111041046102023000142270ustar 00000000000000use super::Dependency; use super::RegistrySource; use super::VersionExt; /// Simplified represetation of `package.rust-version` #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] pub struct RustVersion { #[allow(missing_docs)] pub major: u64, #[allow(missing_docs)] pub minor: u64, #[allow(missing_docs)] pub patch: u64, } impl RustVersion { /// Minimum-possible `package.rust-version` pub const MIN: Self = RustVersion { major: 1, minor: 0, patch: 0, }; /// Maximum-possible `package.rust-version` pub const MAX: Self = RustVersion { major: u64::MAX, minor: u64::MAX, patch: u64::MAX, }; } impl std::str::FromStr for RustVersion { type Err = anyhow::Error; fn from_str(text: &str) -> Result { let version_req = text.parse::()?; anyhow::ensure!( version_req.comparators.len() == 1, "rust-version must be a value like `1.32`" ); let comp = &version_req.comparators[0]; anyhow::ensure!( comp.op == semver::Op::Caret, "rust-version must be a value like `1.32`" ); anyhow::ensure!( comp.pre == semver::Prerelease::EMPTY, "rust-version must be a value like `1.32`" ); Ok(Self { major: comp.major, minor: comp.minor.unwrap_or(0), patch: comp.patch.unwrap_or(0), }) } } impl From<&'_ semver::VersionReq> for RustVersion { fn from(version_req: &semver::VersionReq) -> Self { // HACK: `rust-version` is a subset of the `VersionReq` syntax that only ever // has one comparator with a required minor and optional patch, and uses no // other features. If in the future this syntax is expanded, this code will need // to be updated. assert!(version_req.comparators.len() == 1); let comp = &version_req.comparators[0]; assert_eq!(comp.op, semver::Op::Caret); assert_eq!(comp.pre, semver::Prerelease::EMPTY); Self { major: comp.major, minor: comp.minor.unwrap_or(0), patch: comp.patch.unwrap_or(0), } } } impl From<&'_ semver::Version> for RustVersion { fn from(version: &semver::Version) -> Self { Self { major: version.major, minor: version.minor, patch: version.patch, } } } // Checks whether a version object is a stable release fn version_is_stable(version: &semver::Version) -> bool { !version.is_prerelease() } /// Read latest version from Versions structure pub fn find_latest_version( versions: &[tame_index::IndexVersion], flag_allow_prerelease: bool, rust_version: Option, ) -> Option { let (latest, _) = versions .iter() .filter_map(|k| Some((k, k.version.parse::().ok()?))) .filter(|(_, v)| flag_allow_prerelease || version_is_stable(v)) .filter(|(k, _)| !k.yanked) .filter(|(k, _)| { rust_version .and_then(|rust_version| { k.rust_version .as_ref() .and_then(|k_rust_version| k_rust_version.parse::().ok()) .map(|k_rust_version| k_rust_version <= rust_version) }) .unwrap_or(true) }) .max_by_key(|(_, v)| v.clone())?; let name = &latest.name; let version = latest.version.to_string(); Some(Dependency::new(name).set_source(RegistrySource::new(version))) } pub fn find_compatible_version( versions: &[tame_index::IndexVersion], version_req: &semver::VersionReq, rust_version: Option, ) -> Option { let (latest, _) = versions .iter() .filter_map(|k| Some((k, k.version.parse::().ok()?))) .filter(|(_, v)| version_req.matches(v)) .filter(|(k, _)| !k.yanked) .filter(|(k, _)| { rust_version .and_then(|rust_version| { k.rust_version .as_ref() .and_then(|k_rust_version| k_rust_version.parse::().ok()) .map(|k_rust_version| k_rust_version <= rust_version) }) .unwrap_or(true) }) .max_by_key(|(_, v)| v.clone())?; let name = &latest.name; let version = latest.version.to_string(); Some(Dependency::new(name).set_source(RegistrySource::new(version))) } cargo-edit-0.13.10/src/index.rs000064400000000000000000000206501046102023000142530ustar 00000000000000use tame_index::krate::IndexKrate; use tame_index::utils::flock::FileLock; use url::Url; use super::errors::{CargoResult, Context}; #[derive(Default, Debug, Clone, Copy, PartialEq, Eq)] pub enum CertsSource { /// Use certs from Mozilla's root certificate store. #[default] Webpki, /// Use certs from the system root certificate store. Native, } pub struct IndexCache { certs_source: CertsSource, index: std::collections::HashMap, } impl IndexCache { #[inline] pub fn new(certs_source: CertsSource) -> Self { Self { certs_source, index: Default::default(), } } /// Determines if the specified crate exists in the crates.io index #[inline] pub fn has_krate(&mut self, registry: &Url, name: &str) -> CargoResult { self.index(registry) .with_context(|| format!("failed to look up {name}"))? .has_krate(name) } /// Determines if the specified crate version exists in the crates.io index #[inline] pub fn has_krate_version( &mut self, registry: &Url, name: &str, version: &str, ) -> CargoResult> { self.index(registry) .with_context(|| format!("failed to look up {name}@{version}"))? .has_krate_version(name, version) } #[inline] pub fn update_krate(&mut self, registry: &Url, name: &str) -> CargoResult<()> { self.index(registry) .with_context(|| format!("failed to look up {name}"))? .update_krate(name); Ok(()) } pub fn krate(&mut self, registry: &Url, name: &str) -> CargoResult> { self.index(registry) .with_context(|| format!("failed to look up {name}"))? .krate(name) } fn index<'s>(&'s mut self, registry: &Url) -> CargoResult<&'s mut AnyIndexCache> { if !self.index.contains_key(registry) { let index = AnyIndex::open(registry, self.certs_source)?; let index = AnyIndexCache::new(index); self.index.insert(registry.clone(), index); } Ok(self.index.get_mut(registry).unwrap()) } } struct AnyIndexCache { index: AnyIndex, cache: std::collections::HashMap>, } impl AnyIndexCache { #[inline] fn new(index: AnyIndex) -> Self { Self { index, cache: std::collections::HashMap::new(), } } /// Determines if the specified crate exists in the crates.io index #[inline] fn has_krate(&mut self, name: &str) -> CargoResult { Ok(self.krate(name)?.map(|_| true).unwrap_or(false)) } /// Determines if the specified crate version exists in the crates.io index #[inline] fn has_krate_version(&mut self, name: &str, version: &str) -> CargoResult> { let krate = self.krate(name)?; Ok(krate.map(|ik| ik.versions.iter().any(|iv| iv.version == version))) } #[inline] fn update_krate(&mut self, name: &str) { self.cache.remove(name); } fn krate(&mut self, name: &str) -> CargoResult> { if let Some(entry) = self.cache.get(name) { return Ok(entry.clone()); } let entry = self.index.krate(name)?; self.cache.insert(name.to_owned(), entry.clone()); Ok(entry) } } enum AnyIndex { Local(LocalIndex), Remote(RemoteIndex), } impl AnyIndex { fn open(url: &Url, certs_source: CertsSource) -> CargoResult { if url.scheme() == "file" { LocalIndex::open(url) .map(Self::Local) .with_context(|| format!("invalid local registry {url:?}")) } else { RemoteIndex::open(url, certs_source) .map(Self::Remote) .with_context(|| format!("invalid registry {url:?}")) } } fn krate(&mut self, name: &str) -> CargoResult> { match self { Self::Local(index) => index.krate(name), Self::Remote(index) => index.krate(name), } } } struct LocalIndex { index: tame_index::index::LocalRegistry, root: tame_index::PathBuf, } impl LocalIndex { fn open(url: &Url) -> CargoResult { let path = url .to_file_path() .map_err(|_err| anyhow::format_err!("invalid file path {url:?}"))?; let path = tame_index::PathBuf::from_path_buf(path) .map_err(|_err| anyhow::format_err!("invalid file path {url:?}"))?; let index = tame_index::index::LocalRegistry::open(path.clone(), false)?; Ok(Self { index, root: path }) } fn krate(&mut self, name: &str) -> CargoResult> { let name = tame_index::KrateName::cargo(name)?; // HACK: for some reason, `tame_index` puts `index` in the middle let entry_path = self.index.krate_path(name); let rel_path = entry_path .strip_prefix(&self.root) .map_err(|_err| anyhow::format_err!("invalid index path {entry_path:?}"))?; let rel_path = rel_path .strip_prefix("index") .map_err(|_err| anyhow::format_err!("invalid index path {entry_path:?}"))?; let entry_path = self.root.join(rel_path); let Ok(entry) = std::fs::read(&entry_path) else { return Ok(None); }; let results = IndexKrate::from_slice(&entry)?; Ok(Some(results)) } } struct RemoteIndex { index: tame_index::SparseIndex, client: tame_index::external::reqwest::blocking::Client, lock: FileLock, etags: Vec<(String, String)>, } impl RemoteIndex { fn open(url: &Url, certs_source: CertsSource) -> CargoResult { log::trace!("opening index entry for {url}"); let url = url.to_string(); let url = tame_index::IndexUrl::NonCratesIo(std::borrow::Cow::Owned(url)); let index = tame_index::SparseIndex::new(tame_index::IndexLocation::new(url))?; let client = { let builder = tame_index::external::reqwest::blocking::ClientBuilder::new(); let builder = match certs_source { CertsSource::Webpki => builder.tls_built_in_webpki_certs(true), CertsSource::Native => builder.tls_built_in_native_certs(true), }; builder.build()? }; let lock = FileLock::unlocked(); Ok(Self { index, client, lock, etags: Vec::new(), }) } fn krate(&mut self, name: &str) -> CargoResult> { log::trace!("krate {name}"); let etag = self .etags .iter() .find_map(|(krate, etag)| (krate == name).then_some(etag.as_str())) .unwrap_or(""); let krate_name = name.try_into()?; let req = self .index .make_remote_request(krate_name, Some(etag), &self.lock)?; let ( tame_index::external::http::request::Parts { method, uri, version, headers, .. }, _, ) = req.into_parts(); let mut req = self.client.request(method, uri.to_string()); req = req.version(version); req = req.headers(headers); let res = self.client.execute(req.build()?)?; // Grab the etag if it exists for future requests if let Some(etag) = res .headers() .get(tame_index::external::reqwest::header::ETAG) && let Ok(etag) = etag.to_str() { if let Some(i) = self.etags.iter().position(|(krate, _)| krate == name) { etag.clone_into(&mut self.etags[i].1); } else { self.etags.push((name.to_owned(), etag.to_owned())); } } let mut builder = tame_index::external::http::Response::builder() .status(res.status()) .version(res.version()); builder .headers_mut() .unwrap() .extend(res.headers().iter().map(|(k, v)| (k.clone(), v.clone()))); let body = res.bytes()?; let response = builder .body(body.to_vec()) .map_err(|e| tame_index::Error::from(tame_index::error::HttpError::from(e)))?; self.index .parse_remote_response(krate_name, response, false, &self.lock) .map_err(Into::into) } } cargo-edit-0.13.10/src/lib.rs000064400000000000000000000027711046102023000137160ustar 00000000000000//! Show and Edit Cargo's Manifest Files //! //! # Semver Compatibility //! //! cargo-edit's versioning tracks compatibility for the binaries, not the API. We upload to //! crates.io to distribute the binary. If using this as a library, be sure to pin the version //! with a `=` version requirement operator. Note though that our goal is for `cargo-edit` to go //! away as we move things into cargo. #![recursion_limit = "256"] #![cfg_attr(test, allow(dead_code))] #![warn( missing_copy_implementations, trivial_casts, trivial_numeric_casts, unsafe_code, unstable_features, unused_import_braces, unused_qualifications )] #[macro_use] extern crate serde_derive; mod crate_spec; mod dependency; mod errors; mod fetch; mod index; mod manifest; mod metadata; mod registry; mod util; mod version; pub use crate_spec::CrateSpec; pub use dependency::Dependency; pub use dependency::GitSource; pub use dependency::PathSource; pub use dependency::RegistrySource; pub use dependency::Source; pub use dependency::WorkspaceSource; pub use errors::*; pub use fetch::{RustVersion, find_compatible_version, find_latest_version}; pub use index::*; pub use manifest::{LocalManifest, Manifest, find, get_dep_version, set_dep_version}; pub use metadata::manifest_from_pkgid; pub use registry::registry_url; pub use util::{ Color, ColorChoice, colorize_stderr, shell_note, shell_print, shell_status, shell_warn, shell_write_stderr, shell_write_stdout, }; pub use version::{VersionExt, upgrade_requirement}; cargo-edit-0.13.10/src/manifest.rs000064400000000000000000000406401046102023000147530ustar 00000000000000use std::fs; use std::ops::{Deref, DerefMut}; use std::path::{Path, PathBuf}; use std::{env, str}; use semver::Version; use super::errors::{CargoResult, Context, non_existent_dependency_err, non_existent_table_err}; use super::metadata::find_manifest_path; #[derive(PartialEq, Eq, Hash, Ord, PartialOrd, Clone, Debug, Copy)] pub(crate) enum DepKind { Normal, Development, Build, } /// Dependency table to add dep to #[derive(Clone, Debug, PartialEq, Eq)] pub(crate) struct DepTable { kind: DepKind, target: Option, } impl DepTable { const KINDS: &'static [Self] = &[ Self::new().set_kind(DepKind::Normal), Self::new().set_kind(DepKind::Development), Self::new().set_kind(DepKind::Build), ]; /// Reference to a Dependency Table pub(crate) const fn new() -> Self { Self { kind: DepKind::Normal, target: None, } } /// Choose the type of dependency pub(crate) const fn set_kind(mut self, kind: DepKind) -> Self { self.kind = kind; self } /// Choose the platform for the dependency pub(crate) fn set_target(mut self, target: impl Into) -> Self { self.target = Some(target.into()); self } fn kind_table(&self) -> &str { match self.kind { DepKind::Normal => "dependencies", DepKind::Development => "dev-dependencies", DepKind::Build => "build-dependencies", } } } impl Default for DepTable { fn default() -> Self { Self::new() } } impl From for DepTable { fn from(other: DepKind) -> Self { Self::new().set_kind(other) } } /// A Cargo manifest #[derive(Debug, Clone)] pub struct Manifest { /// Manifest contents as TOML data pub data: toml_edit::DocumentMut, } impl Manifest { /// Get the specified table from the manifest. /// /// If there is no table at the specified path, then a non-existent table /// error will be returned. pub(crate) fn get_table_mut<'a>( &'a mut self, table_path: &[String], ) -> CargoResult<&'a mut toml_edit::Item> { self.get_table_mut_internal(table_path, false) } /// Get all sections in the manifest that exist and might contain dependencies. /// The returned items are always `Table` or `InlineTable`. pub(crate) fn get_sections(&self) -> Vec<(DepTable, toml_edit::Item)> { let mut sections = Vec::new(); for table in DepTable::KINDS { let dependency_type = table.kind_table(); // Dependencies can be in the three standard sections... if self .data .get(dependency_type) .map(|t| t.is_table_like()) .unwrap_or(false) { sections.push((table.clone(), self.data[dependency_type].clone())); } // ... and in `target..(build-/dev-)dependencies`. let target_sections = self .data .as_table() .get("target") .and_then(toml_edit::Item::as_table_like) .into_iter() .flat_map(toml_edit::TableLike::iter) .filter_map(|(target_name, target_table)| { let dependency_table = target_table.get(dependency_type)?; dependency_table.as_table_like().map(|_| { ( table.clone().set_target(target_name), dependency_table.clone(), ) }) }); sections.extend(target_sections); } sections } fn get_table_mut_internal<'a>( &'a mut self, table_path: &[String], insert_if_not_exists: bool, ) -> CargoResult<&'a mut toml_edit::Item> { /// Descend into a manifest until the required table is found. fn descend<'a>( input: &'a mut toml_edit::Item, path: &[String], insert_if_not_exists: bool, ) -> CargoResult<&'a mut toml_edit::Item> { if let Some(segment) = path.first() { let value = if insert_if_not_exists { input[&segment].or_insert(toml_edit::table()) } else { input .get_mut(segment) .ok_or_else(|| non_existent_table_err(segment))? }; if value.is_table_like() { descend(value, &path[1..], insert_if_not_exists) } else { Err(non_existent_table_err(segment)) } } else { Ok(input) } } descend(self.data.as_item_mut(), table_path, insert_if_not_exists) } } impl str::FromStr for Manifest { type Err = anyhow::Error; /// Read manifest data from string fn from_str(input: &str) -> ::std::result::Result { let d: toml_edit::DocumentMut = input.parse().context("Manifest not valid TOML")?; Ok(Manifest { data: d }) } } impl std::fmt::Display for Manifest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let s = self.data.to_string(); s.fmt(f) } } /// A Cargo manifest that is available locally. #[derive(Debug)] pub struct LocalManifest { /// Path to the manifest pub path: PathBuf, /// Manifest contents pub manifest: Manifest, } impl Deref for LocalManifest { type Target = Manifest; fn deref(&self) -> &Manifest { &self.manifest } } impl DerefMut for LocalManifest { fn deref_mut(&mut self) -> &mut Manifest { &mut self.manifest } } impl LocalManifest { /// Construct a `LocalManifest`. If no path is provided, make an educated guess as to which one /// the user means. pub fn find(path: Option<&Path>) -> CargoResult { let path = dunce::canonicalize(find(path)?)?; Self::try_new(&path) } /// Construct the `LocalManifest` corresponding to the `Path` provided. pub fn try_new(path: &Path) -> CargoResult { if !path.is_absolute() { anyhow::bail!("can only edit absolute paths, got {}", path.display()); } let data = fs::read_to_string(path).with_context(|| "Failed to read manifest contents")?; let manifest = data.parse().context("Unable to parse Cargo.toml")?; Ok(LocalManifest { manifest, path: path.to_owned(), }) } /// Write changes back to the file pub fn write(&self) -> CargoResult<()> { let s = self.manifest.data.to_string(); let new_contents_bytes = s.as_bytes(); fs::write(&self.path, new_contents_bytes).context("Failed to write updated Cargo.toml") } /// Remove entry from a Cargo.toml. /// /// # Examples /// /// ``` /// use cargo_edit::{LocalManifest, Manifest}; /// use toml_edit::DocumentMut; /// /// let root = std::path::PathBuf::from("/").canonicalize().unwrap(); /// let path = root.join("Cargo.toml"); /// let manifest = " /// [dependencies] /// cargo-edit = '0.1.0' /// ".parse::().unwrap(); /// let mut manifest = LocalManifest { path, manifest: Manifest { data: manifest } }; /// assert!(manifest.remove_from_table(&["dependencies".to_owned()], "cargo-edit").is_ok()); /// assert!(manifest.remove_from_table(&["dependencies".to_owned()], "cargo-edit").is_err()); /// assert!(!manifest.data.contains_key("dependencies")); /// ``` pub fn remove_from_table(&mut self, table_path: &[String], name: &str) -> CargoResult<()> { let parent_table = self.get_table_mut(table_path)?; { let dep = parent_table .get_mut(name) .filter(|t| !t.is_none()) .ok_or_else(|| non_existent_dependency_err(name, table_path.join(".")))?; // remove the dependency *dep = toml_edit::Item::None; } // remove table if empty if parent_table.as_table_like().unwrap().is_empty() { *parent_table = toml_edit::Item::None; } Ok(()) } /// Allow mutating depedencies, wherever they live pub fn get_dependency_tables_mut( &mut self, ) -> impl Iterator + '_ { let root = self.data.as_table_mut(); root.iter_mut().flat_map(|(k, v)| { if DepTable::KINDS .iter() .any(|kind| kind.kind_table() == k.get()) { v.as_table_like_mut().into_iter().collect::>() } else if k == "workspace" { v.as_table_like_mut() .unwrap() .iter_mut() .filter_map(|(k, v)| { if k.get() == "dependencies" { v.as_table_like_mut() } else { None } }) .collect::>() } else if k == "target" { v.as_table_like_mut() .unwrap() .iter_mut() .flat_map(|(_, v)| { v.as_table_like_mut().into_iter().flat_map(|v| { v.iter_mut().filter_map(|(k, v)| { if DepTable::KINDS .iter() .any(|kind| kind.kind_table() == k.get()) { v.as_table_like_mut() } else { None } }) }) }) .collect::>() } else { Vec::new() } }) } /// Iterates mutably over the `[workspace.dependencies]`. pub fn get_workspace_dependency_table_mut(&mut self) -> Option<&mut dyn toml_edit::TableLike> { self.data .get_mut("workspace")? .get_mut("dependencies")? .as_table_like_mut() } /// Override the manifest's version pub fn set_package_version(&mut self, version: &Version) { self.data["package"]["version"] = toml_edit::value(version.to_string()); } /// `true` if the package inherits the workspace version pub fn version_is_inherited(&self) -> bool { fn inherits_workspace_version_impl(this: &Manifest) -> Option { this.data .get("package")? .get("version")? .get("workspace")? .as_bool() } inherits_workspace_version_impl(self).unwrap_or(false) } /// Get the current workspace version, if any. pub fn get_workspace_version(&self) -> Option { let version = self .data .get("workspace")? .get("package")? .get("version")? .as_str()?; Version::parse(version).ok() } /// Override the workspace's version. pub fn set_workspace_version(&mut self, version: &Version) { self.data["workspace"]["package"]["version"] = toml_edit::value(version.to_string()); } /// Remove references to `dep_key` if its no longer present pub fn gc_dep(&mut self, dep_key: &str) { let status = self.dep_feature(dep_key); if matches!(status, FeatureStatus::None | FeatureStatus::DepFeature) && let toml_edit::Item::Table(feature_table) = &mut self.data.as_table_mut()["features"] { for (_feature, mut activated_crates) in feature_table.iter_mut() { if let toml_edit::Item::Value(toml_edit::Value::Array(feature_activations)) = &mut activated_crates { remove_feature_activation(feature_activations, dep_key, status); } } } } fn dep_feature(&self, dep_key: &str) -> FeatureStatus { let mut status = FeatureStatus::None; for (_, tbl) in self.get_sections() { if let toml_edit::Item::Table(tbl) = tbl && let Some(dep_item) = tbl.get(dep_key) { let optional = dep_item.get("optional"); let optional = optional.and_then(|i| i.as_value()); let optional = optional.and_then(|i| i.as_bool()); let optional = optional.unwrap_or(false); if optional { return FeatureStatus::Feature; } else { status = FeatureStatus::DepFeature; } } } status } } #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)] enum FeatureStatus { None, DepFeature, Feature, } fn remove_feature_activation( feature_activations: &mut toml_edit::Array, dep: &str, status: FeatureStatus, ) { let dep_feature: &str = &format!("{dep}/",); let remove_list: Vec = feature_activations .iter() .enumerate() .filter_map(|(idx, feature_activation)| { if let toml_edit::Value::String(feature_activation) = feature_activation { let activation = feature_activation.value(); #[allow(clippy::unnecessary_lazy_evaluations)] // requires 1.62 match status { FeatureStatus::None => activation == dep || activation.starts_with(dep_feature), FeatureStatus::DepFeature => activation == dep, FeatureStatus::Feature => false, } .then(|| idx) } else { None } }) .collect(); // Remove found idx in revers order so we don't invalidate the idx. for idx in remove_list.iter().rev() { feature_activations.remove(*idx); } } /// If a manifest is specified, return that one, otherise perform a manifest search starting from /// the current directory. /// If a manifest is specified, return that one. If a path is specified, perform a manifest search /// starting from there. If nothing is specified, start searching from the current directory /// (`cwd`). pub fn find(specified: Option<&Path>) -> CargoResult { match specified { Some(path) if fs::metadata(path) .with_context(|| "Failed to get cargo file metadata")? .is_file() => { Ok(path.to_owned()) } Some(path) => find_manifest_path(path), None => find_manifest_path( &env::current_dir().with_context(|| "Failed to get current directory")?, ), } } /// Get a dependency's version from its entry in the dependency table pub fn get_dep_version(dep_item: &toml_edit::Item) -> CargoResult<&str> { if let Some(req) = dep_item.as_str() { Ok(req) } else if dep_item.is_table_like() { let version = dep_item .get("version") .ok_or_else(|| anyhow::format_err!("Missing version field"))?; version .as_str() .ok_or_else(|| anyhow::format_err!("Expect version to be a string")) } else { anyhow::bail!("Invalid dependency type"); } } /// Set a dependency's version in its entry in the dependency table pub fn set_dep_version(dep_item: &mut toml_edit::Item, new_version: &str) -> CargoResult<()> { if dep_item.is_str() { overwrite_value(dep_item, new_version); } else if let Some(table) = dep_item.as_table_like_mut() { let version = table .get_mut("version") .ok_or_else(|| anyhow::format_err!("Missing version field"))?; overwrite_value(version, new_version); } else { anyhow::bail!("Invalid dependency type"); } Ok(()) } /// Overwrite a value while preserving the original formatting fn overwrite_value(item: &mut toml_edit::Item, value: impl Into) { let mut value = value.into(); let existing_decor = item .as_value() .map(|v| v.decor().clone()) .unwrap_or_default(); *value.decor_mut() = existing_decor; *item = toml_edit::Item::Value(value); } pub(crate) fn str_or_1_len_table(item: &toml_edit::Item) -> bool { item.is_str() || item.as_table_like().map(|t| t.len() == 1).unwrap_or(false) } cargo-edit-0.13.10/src/metadata.rs000064400000000000000000000025141046102023000147230ustar 00000000000000use super::errors::{CargoResult, Context}; use cargo_metadata::Package; use std::path::Path; /// Takes a pkgid and attempts to find the path to it's `Cargo.toml`, using `cargo`'s metadata pub fn manifest_from_pkgid(manifest_path: Option<&Path>, pkgid: &str) -> CargoResult { let mut cmd = cargo_metadata::MetadataCommand::new(); cmd.no_deps(); if let Some(manifest_path) = manifest_path { cmd.manifest_path(manifest_path); } let result = cmd.exec().with_context(|| "Invalid manifest")?; let packages = result.packages; let package = packages .into_iter() .find(|pkg| pkg.name.as_ref() == pkgid) .with_context(|| { "Found virtual manifest, but this command requires running against an \ actual package in this workspace. Try adding `--workspace`." })?; Ok(package) } /// Search for Cargo.toml in this directory and recursively up the tree until one is found. pub(crate) fn find_manifest_path(dir: &Path) -> CargoResult { const MANIFEST_FILENAME: &str = "Cargo.toml"; for path in dir.ancestors() { let manifest = path.join(MANIFEST_FILENAME); if std::fs::metadata(&manifest).is_ok() { return Ok(manifest); } } anyhow::bail!("Unable to find Cargo.toml for {}", dir.display()); } cargo-edit-0.13.10/src/registry.rs000064400000000000000000000111021046102023000150040ustar 00000000000000use super::errors::{CargoResult, Context}; use std::collections::HashMap; use std::path::Path; use url::Url; const CRATES_IO_INDEX: &str = tame_index::index::sparse::CRATES_IO_HTTP_INDEX; const CRATES_IO_REGISTRY: &str = "crates-io"; /// Find the URL of a registry pub fn registry_url(manifest_path: &Path, registry: Option<&str>) -> CargoResult { // TODO support local registry sources, directory sources, git sources: https://doc.rust-lang.org/cargo/reference/source-replacement.html?highlight=replace-with#source-replacement fn read_config( registries: &mut HashMap, path: impl AsRef, ) -> CargoResult<()> { let path = path.as_ref(); // TODO unit test for source replacement let content = std::fs::read_to_string(path)?; let config = toml::from_str::(&content) .with_context(|| anyhow::format_err!("invalid cargo config at {}", path.display()))?; for (key, value) in config.registries { registries.entry(key).or_insert(Source { registry: value.index, replace_with: None, }); } for (key, value) in config.source { registries.entry(key).or_insert(value); } Ok(()) } // registry might be replaced with another source // it's looks like a singly linked list // put relations in this map. let mut registries: HashMap = HashMap::new(); // ref: https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure for work_dir in manifest_path .parent() .expect("there must be a parent directory") .ancestors() { let work_cargo_dir = work_dir.join(".cargo"); let config_path = work_cargo_dir.join("config"); if config_path.is_file() { read_config(&mut registries, config_path)?; } else { let config_path = work_cargo_dir.join("config.toml"); if config_path.is_file() { read_config(&mut registries, config_path)?; } } } let default_cargo_home = home::cargo_home()?; let default_config_path = default_cargo_home.join("config"); if default_config_path.is_file() { read_config(&mut registries, default_config_path)?; } else { let default_config_path = default_cargo_home.join("config.toml"); if default_config_path.is_file() { read_config(&mut registries, default_config_path)?; } } // find head of the relevant linked list let mut source = match registry { Some(CRATES_IO_INDEX) | None => { let mut source = registries.remove(CRATES_IO_REGISTRY).unwrap_or_default(); source .registry .get_or_insert_with(|| CRATES_IO_INDEX.to_owned()); source } Some(r) => registries .remove(r) .with_context(|| anyhow::format_err!("The registry '{r}' could not be found"))?, }; // search this linked list and find the tail while let Some(replace_with) = &source.replace_with { let is_crates_io = replace_with == CRATES_IO_INDEX; source = registries.remove(replace_with).with_context(|| { anyhow::format_err!("The source '{replace_with}' could not be found") })?; if is_crates_io { source .registry .get_or_insert_with(|| CRATES_IO_INDEX.to_owned()); } } let registry_url = source .registry .ok_or_else(|| anyhow::format_err!("missing `registry`"))?; let registry_url = Url::parse(®istry_url) .with_context(|| anyhow::format_err!("invalid `registry` field"))?; Ok(registry_url) } #[derive(Debug, Deserialize)] struct CargoConfig { #[serde(default)] registries: HashMap, #[serde(default)] source: HashMap, } #[derive(Default, Debug, Deserialize)] struct Source { #[serde(rename = "replace-with")] replace_with: Option, registry: Option, } #[derive(Debug, Deserialize)] struct Registry { index: Option, } mod code_from_cargo { #![allow(dead_code)] #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub(super) enum Kind { Git(GitReference), Path, Registry, LocalRegistry, Directory, } #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub(super) enum GitReference { Tag(String), Branch(String), Rev(String), DefaultBranch, } } cargo-edit-0.13.10/src/util.rs000064400000000000000000000046071046102023000141250ustar 00000000000000use std::io::Write; pub use termcolor::{Color, ColorChoice}; use termcolor::{ColorSpec, StandardStream, WriteColor}; use crate::{CargoResult, Context}; /// Whether to color logged output pub fn colorize_stderr() -> ColorChoice { if concolor_control::get(concolor_control::Stream::Stderr).color() { ColorChoice::Always } else { ColorChoice::Never } } /// Whether to color logged output pub(crate) fn colorize_stdout() -> ColorChoice { if concolor_control::get(concolor_control::Stream::Stdout).color() { ColorChoice::Always } else { ColorChoice::Never } } /// Print a message with a colored title in the style of Cargo shell messages. pub fn shell_print(status: &str, message: &str, color: Color, justified: bool) -> CargoResult<()> { let color_choice = colorize_stderr(); let mut output = StandardStream::stderr(color_choice); output.set_color(ColorSpec::new().set_fg(Some(color)).set_bold(true))?; if justified { write!(output, "{status:>12}")?; } else { write!(output, "{status}")?; output.set_color(ColorSpec::new().set_bold(true))?; write!(output, ":")?; } output.reset()?; writeln!(output, " {message}").with_context(|| "Failed to write message")?; Ok(()) } /// Print a styled action message. pub fn shell_status(action: &str, message: &str) -> CargoResult<()> { shell_print(action, message, Color::Green, true) } /// Print a styled warning message. pub fn shell_warn(message: &str) -> CargoResult<()> { shell_print("warning", message, Color::Yellow, false) } /// Print a styled warning message. pub fn shell_note(message: &str) -> CargoResult<()> { shell_print("note", message, Color::Cyan, false) } /// Print a part of a line with formatting pub fn shell_write_stderr(fragment: impl std::fmt::Display, spec: &ColorSpec) -> CargoResult<()> { let color_choice = colorize_stderr(); let mut output = StandardStream::stderr(color_choice); output.set_color(spec)?; write!(output, "{fragment}")?; output.reset()?; Ok(()) } /// Print a part of a line with formatting pub fn shell_write_stdout(fragment: impl std::fmt::Display, spec: &ColorSpec) -> CargoResult<()> { let color_choice = colorize_stdout(); let mut output = StandardStream::stdout(color_choice); output.set_color(spec)?; write!(output, "{fragment}")?; output.reset()?; Ok(()) } cargo-edit-0.13.10/src/version.rs000064400000000000000000000333501046102023000146320ustar 00000000000000use std::str::FromStr; use super::errors::{CargoResult, invalid_release_level, unsupported_version_req}; /// Additional version functionality pub trait VersionExt { /// Increments the major version number for this Version. fn increment_major(&mut self); /// Increments the minor version number for this Version. fn increment_minor(&mut self); /// Increments the patch version number for this Version. fn increment_patch(&mut self); /// Increment the alpha pre-release number for this Version. /// /// If this isn't alpha, switch to it. /// /// Errors if this would decrement the pre-release phase. fn increment_alpha(&mut self) -> CargoResult<()>; /// Increment the beta pre-release number for this Version. /// /// If this isn't beta, switch to it. /// /// Errors if this would decrement the pre-release phase. fn increment_beta(&mut self) -> CargoResult<()>; /// Increment the rc pre-release number for this Version. /// /// If this isn't rc, switch to it. /// /// Errors if this would decrement the pre-release phase. fn increment_rc(&mut self) -> CargoResult<()>; /// Append informational-only metadata. fn metadata(&mut self, metadata: &str) -> CargoResult<()>; /// Checks to see if the current Version is in pre-release status fn is_prerelease(&self) -> bool; } impl VersionExt for semver::Version { fn increment_major(&mut self) { self.major += 1; self.minor = 0; self.patch = 0; self.pre = semver::Prerelease::EMPTY; self.build = semver::BuildMetadata::EMPTY; } fn increment_minor(&mut self) { self.minor += 1; self.patch = 0; self.pre = semver::Prerelease::EMPTY; self.build = semver::BuildMetadata::EMPTY; } fn increment_patch(&mut self) { self.patch += 1; self.pre = semver::Prerelease::EMPTY; self.build = semver::BuildMetadata::EMPTY; } fn increment_alpha(&mut self) -> CargoResult<()> { if let Some((pre_ext, pre_ext_ver)) = prerelease_id_version(self)? { if pre_ext == VERSION_BETA || pre_ext == VERSION_RC { Err(invalid_release_level(VERSION_ALPHA, self.clone())) } else { let new_ext_ver = if pre_ext == VERSION_ALPHA { pre_ext_ver.unwrap_or(0) + 1 } else { 1 }; self.pre = semver::Prerelease::new(&format!("{VERSION_ALPHA}.{new_ext_ver}"))?; Ok(()) } } else { self.increment_patch(); self.pre = semver::Prerelease::new(&format!("{VERSION_ALPHA}.1",))?; Ok(()) } } fn increment_beta(&mut self) -> CargoResult<()> { if let Some((pre_ext, pre_ext_ver)) = prerelease_id_version(self)? { if pre_ext == VERSION_RC { Err(invalid_release_level(VERSION_BETA, self.clone())) } else { let new_ext_ver = if pre_ext == VERSION_BETA { pre_ext_ver.unwrap_or(0) + 1 } else { 1 }; self.pre = semver::Prerelease::new(&format!("{VERSION_BETA}.{new_ext_ver}"))?; Ok(()) } } else { self.increment_patch(); self.pre = semver::Prerelease::new(&format!("{VERSION_BETA}.1"))?; Ok(()) } } fn increment_rc(&mut self) -> CargoResult<()> { if let Some((pre_ext, pre_ext_ver)) = prerelease_id_version(self)? { let new_ext_ver = if pre_ext == VERSION_RC { pre_ext_ver.unwrap_or(0) + 1 } else { 1 }; self.pre = semver::Prerelease::new(&format!("{VERSION_RC}.{new_ext_ver}"))?; Ok(()) } else { self.increment_patch(); self.pre = semver::Prerelease::new(&format!("{VERSION_RC}.1"))?; Ok(()) } } fn metadata(&mut self, build: &str) -> CargoResult<()> { self.build = semver::BuildMetadata::new(build)?; Ok(()) } fn is_prerelease(&self) -> bool { !self.pre.is_empty() } } static VERSION_ALPHA: &str = "alpha"; static VERSION_BETA: &str = "beta"; static VERSION_RC: &str = "rc"; fn prerelease_id_version(version: &semver::Version) -> CargoResult)>> { if !version.pre.is_empty() { if let Some((alpha, numeric)) = version.pre.as_str().split_once('.') { let alpha = alpha.to_owned(); let numeric = u64::from_str(numeric) .map_err(|_| anyhow::format_err!("This version scheme is not supported. Use format like `pre`, `dev` or `alpha.1` for prerelease symbol"))?; Ok(Some((alpha, Some(numeric)))) } else { Ok(Some((version.pre.as_str().to_owned(), None))) } } else { Ok(None) } } /// Upgrade an existing requirement to a new version pub fn upgrade_requirement(req: &str, version: &semver::Version) -> CargoResult> { let req_text = req.to_owned(); let raw_req = semver::VersionReq::parse(&req_text) .expect("semver to generate valid version requirements"); if raw_req.comparators.is_empty() { // Empty matches everything, no-change. Ok(None) } else { let comparators: CargoResult> = raw_req .comparators .into_iter() .map(|p| set_comparator(p, version)) .collect(); let comparators = comparators?; let new_req = semver::VersionReq { comparators }; let mut new_req_text = new_req.to_string(); if new_req_text.starts_with('^') && !req.starts_with('^') { new_req_text.remove(0); } // Validate contract #[cfg(debug_assertions)] { assert!( new_req.matches(version), "Invalid req created: {new_req_text}" ); } if new_req_text == req_text { Ok(None) } else { Ok(Some(new_req_text)) } } } fn set_comparator( mut pred: semver::Comparator, version: &semver::Version, ) -> CargoResult { match pred.op { semver::Op::Wildcard => { pred.major = version.major; if pred.minor.is_some() { pred.minor = Some(version.minor); } if pred.patch.is_some() { pred.patch = Some(version.patch); } Ok(pred) } semver::Op::Exact => Ok(assign_partial_req(version, pred)), semver::Op::Greater | semver::Op::GreaterEq | semver::Op::Less | semver::Op::LessEq => { let user_pred = pred.to_string(); Err(unsupported_version_req(user_pred)) } semver::Op::Tilde => Ok(assign_partial_req(version, pred)), semver::Op::Caret => Ok(assign_partial_req(version, pred)), _ => { let user_pred = pred.to_string(); Err(unsupported_version_req(user_pred)) } } } fn assign_partial_req( version: &semver::Version, mut pred: semver::Comparator, ) -> semver::Comparator { pred.major = version.major; if pred.minor.is_some() { pred.minor = Some(version.minor); } if pred.patch.is_some() { pred.patch = Some(version.patch); } pred.pre = version.pre.clone(); pred } #[cfg(test)] mod test { use super::*; mod increment { use super::*; #[test] fn alpha() { let mut v = semver::Version::parse("1.0.0").unwrap(); v.increment_alpha().unwrap(); assert_eq!(v, semver::Version::parse("1.0.1-alpha.1").unwrap()); let mut v2 = semver::Version::parse("1.0.1-dev").unwrap(); v2.increment_alpha().unwrap(); assert_eq!(v2, semver::Version::parse("1.0.1-alpha.1").unwrap()); let mut v3 = semver::Version::parse("1.0.1-alpha.1").unwrap(); v3.increment_alpha().unwrap(); assert_eq!(v3, semver::Version::parse("1.0.1-alpha.2").unwrap()); let mut v4 = semver::Version::parse("1.0.1-beta.1").unwrap(); assert!(v4.increment_alpha().is_err()); } #[test] fn beta() { let mut v = semver::Version::parse("1.0.0").unwrap(); v.increment_beta().unwrap(); assert_eq!(v, semver::Version::parse("1.0.1-beta.1").unwrap()); let mut v2 = semver::Version::parse("1.0.1-dev").unwrap(); v2.increment_beta().unwrap(); assert_eq!(v2, semver::Version::parse("1.0.1-beta.1").unwrap()); let mut v2 = semver::Version::parse("1.0.1-alpha.1").unwrap(); v2.increment_beta().unwrap(); assert_eq!(v2, semver::Version::parse("1.0.1-beta.1").unwrap()); let mut v3 = semver::Version::parse("1.0.1-beta.1").unwrap(); v3.increment_beta().unwrap(); assert_eq!(v3, semver::Version::parse("1.0.1-beta.2").unwrap()); let mut v4 = semver::Version::parse("1.0.1-rc.1").unwrap(); assert!(v4.increment_beta().is_err()); } #[test] fn rc() { let mut v = semver::Version::parse("1.0.0").unwrap(); v.increment_rc().unwrap(); assert_eq!(v, semver::Version::parse("1.0.1-rc.1").unwrap()); let mut v2 = semver::Version::parse("1.0.1-dev").unwrap(); v2.increment_rc().unwrap(); assert_eq!(v2, semver::Version::parse("1.0.1-rc.1").unwrap()); let mut v3 = semver::Version::parse("1.0.1-rc.1").unwrap(); v3.increment_rc().unwrap(); assert_eq!(v3, semver::Version::parse("1.0.1-rc.2").unwrap()); } #[test] fn metadata() { let mut v = semver::Version::parse("1.0.0").unwrap(); v.metadata("git.123456").unwrap(); assert_eq!(v, semver::Version::parse("1.0.0+git.123456").unwrap()); } } mod upgrade_requirement { use super::*; #[track_caller] fn assert_req_bump<'a, O: Into>>(version: &str, req: &str, expected: O) { let version = semver::Version::parse(version).unwrap(); let actual = upgrade_requirement(req, &version).unwrap(); let expected = expected.into(); assert_eq!(actual.as_deref(), expected); } #[test] fn wildcard_major() { assert_req_bump("1.0.0", "*", None); } #[test] fn wildcard_minor() { assert_req_bump("1.0.0", "1.*", None); assert_req_bump("1.1.0", "1.*", None); assert_req_bump("2.0.0", "1.*", "2.*"); } #[test] fn wildcard_patch() { assert_req_bump("1.0.0", "1.0.*", None); assert_req_bump("1.1.0", "1.0.*", "1.1.*"); assert_req_bump("1.1.1", "1.0.*", "1.1.*"); assert_req_bump("2.0.0", "1.0.*", "2.0.*"); } #[test] fn caret_major() { assert_req_bump("1.0.0", "1", None); assert_req_bump("1.0.0", "^1", None); assert_req_bump("1.1.0", "1", None); assert_req_bump("1.1.0", "^1", None); assert_req_bump("2.0.0", "1", "2"); assert_req_bump("2.0.0", "^1", "^2"); } #[test] fn caret_minor() { assert_req_bump("1.0.0", "1.0", None); assert_req_bump("1.0.0", "^1.0", None); assert_req_bump("1.1.0", "1.0", "1.1"); assert_req_bump("1.1.0", "^1.0", "^1.1"); assert_req_bump("1.1.1", "1.0", "1.1"); assert_req_bump("1.1.1", "^1.0", "^1.1"); assert_req_bump("2.0.0", "1.0", "2.0"); assert_req_bump("2.0.0", "^1.0", "^2.0"); } #[test] fn caret_patch() { assert_req_bump("1.0.0", "1.0.0", None); assert_req_bump("1.0.0", "^1.0.0", None); assert_req_bump("1.1.0", "1.0.0", "1.1.0"); assert_req_bump("1.1.0", "^1.0.0", "^1.1.0"); assert_req_bump("1.1.1", "1.0.0", "1.1.1"); assert_req_bump("1.1.1", "^1.0.0", "^1.1.1"); assert_req_bump("2.0.0", "1.0.0", "2.0.0"); assert_req_bump("2.0.0", "^1.0.0", "^2.0.0"); } #[test] fn tilde_major() { assert_req_bump("1.0.0", "~1", None); assert_req_bump("1.1.0", "~1", None); assert_req_bump("2.0.0", "~1", "~2"); } #[test] fn tilde_minor() { assert_req_bump("1.0.0", "~1.0", None); assert_req_bump("1.1.0", "~1.0", "~1.1"); assert_req_bump("1.1.1", "~1.0", "~1.1"); assert_req_bump("2.0.0", "~1.0", "~2.0"); } #[test] fn tilde_patch() { assert_req_bump("1.0.0", "~1.0.0", None); assert_req_bump("1.1.0", "~1.0.0", "~1.1.0"); assert_req_bump("1.1.1", "~1.0.0", "~1.1.1"); assert_req_bump("2.0.0", "~1.0.0", "~2.0.0"); } #[test] fn equal_major() { assert_req_bump("1.0.0", "=1", None); assert_req_bump("1.1.0", "=1", None); assert_req_bump("2.0.0", "=1", "=2"); } #[test] fn equal_minor() { assert_req_bump("1.0.0", "=1.0", None); assert_req_bump("1.1.0", "=1.0", "=1.1"); assert_req_bump("1.1.1", "=1.0", "=1.1"); assert_req_bump("2.0.0", "=1.0", "=2.0"); } #[test] fn equal_patch() { assert_req_bump("1.0.0", "=1.0.0", None); assert_req_bump("1.1.0", "=1.0.0", "=1.1.0"); assert_req_bump("1.1.1", "=1.0.0", "=1.1.1"); assert_req_bump("2.0.0", "=1.0.0", "=2.0.0"); } } } cargo-edit-0.13.10/tests/cargo-set-version/downgrade_error/mod.rs000064400000000000000000000013431046102023000230260ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("set-version") .args(["0.0.1"]) .current_dir(cwd) .assert() .code(1) .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-set-version/downgrade_error/stderr.term.svg000064400000000000000000000011731046102023000246740ustar 00000000000000 Error: Cannot downgrade from 0.1.0 to 0.0.1 cargo-edit-0.13.10/tests/cargo-set-version/downgrade_error/stdout.term.svg000064400000000000000000000007631046102023000247170ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-set-version/dry_run/mod.rs000064400000000000000000000013621046102023000213260ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("set-version") .args(["2.0.0", "--dry-run"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-set-version/dry_run/stderr.term.svg000064400000000000000000000013311046102023000231670ustar 00000000000000 Upgrading sample from 0.1.0 to 2.0.0 warning: aborting set-version due to dry run cargo-edit-0.13.10/tests/cargo-set-version/dry_run/stdout.term.svg000064400000000000000000000007631046102023000232160ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-set-version/ignore_dependent/mod.rs000064400000000000000000000014061046102023000231540ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("set-version") .args(["2.0.0", "-p", "cargo-list-test-fixture"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-set-version/ignore_dependent/stderr.term.svg000064400000000000000000000012101046102023000250120ustar 00000000000000 Upgrading cargo-list-test-fixture from 0.0.0 to 2.0.0 cargo-edit-0.13.10/tests/cargo-set-version/ignore_dependent/stdout.term.svg000064400000000000000000000007631046102023000250450ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-set-version/main.rs000064400000000000000000000071461046102023000200170ustar 00000000000000#![allow(clippy::all)] #![warn(clippy::needless_borrow)] #![warn(clippy::redundant_clone)] mod downgrade_error; mod dry_run; mod ignore_dependent; mod relative_absolute_conflict; mod set_absolute_version; mod set_absolute_workspace_version; mod set_relative_version; mod set_relative_workspace_version; mod upgrade_compatible_dependency; mod upgrade_incompatible_dependency; mod upgrade_workspace; mod virtual_workspace_deps; mod workspace_deps; mod workspace_version_exclude; mod workspace_version_subset; fn init_registry() { cargo_test_support::registry::init(); add_registry_packages(false); } fn add_registry_packages(alt: bool) { for name in [ "my-package", "my-package1", "my-package2", "my-dev-package1", "my-dev-package2", "my-build-package1", "my-build-package2", "toml", "versioned-package", "cargo-list-test-fixture-dependency", "unrelateed-crate", ] { cargo_test_support::registry::Package::new(name, "0.1.1+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "0.2.0+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "0.2.3+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "0.4.1+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "20.0.0+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "99999.0.0+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "99999.0.0-alpha.1+my-package") .alternative(alt) .publish(); } cargo_test_support::registry::Package::new("prerelease_only", "0.2.0-alpha.1") .alternative(alt) .publish(); cargo_test_support::registry::Package::new("test_breaking", "0.2.0") .alternative(alt) .publish(); cargo_test_support::registry::Package::new("test_nonbreaking", "0.1.1") .alternative(alt) .publish(); // Normalization cargo_test_support::registry::Package::new("linked-hash-map", "0.5.4") .alternative(alt) .feature("clippy", &[]) .feature("heapsize", &[]) .feature("heapsize_impl", &[]) .feature("nightly", &[]) .feature("serde", &[]) .feature("serde_impl", &[]) .feature("serde_test", &[]) .publish(); cargo_test_support::registry::Package::new("inflector", "0.11.4") .alternative(alt) .feature("default", &["heavyweight", "lazy_static", "regex"]) .feature("heavyweight", &[]) .feature("lazy_static", &[]) .feature("regex", &[]) .feature("unstable", &[]) .publish(); cargo_test_support::registry::Package::new("your-face", "99999.0.0+my-package") .alternative(alt) .feature("nose", &[]) .feature("mouth", &[]) .feature("eyes", &[]) .feature("ears", &[]) .publish(); } pub fn cargo_exe() -> &'static std::path::Path { snapbox::cmd::cargo_bin!("cargo-set-version") } /// Test the cargo command pub trait CargoCommand { fn cargo_ui() -> Self; } impl CargoCommand for snapbox::cmd::Command { fn cargo_ui() -> Self { use cargo_test_support::TestEnvCommandExt; Self::new(cargo_exe()) .with_assert(cargo_test_support::compare::assert_ui()) .test_env() } } cargo-edit-0.13.10/tests/cargo-set-version/relative_absolute_conflict/mod.rs000064400000000000000000000013661046102023000252420ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("set-version") .args(["1.0.0", "--bump", "major"]) .current_dir(cwd) .assert() .code(2) .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-set-version/relative_absolute_conflict/stderr.term.svg000064400000000000000000000016371046102023000271100ustar 00000000000000 error: the argument '[TARGET]' cannot be used with '--bump <BUMP>' Usage: cargo set-version <TARGET> For more information, try '--help'. cargo-edit-0.13.10/tests/cargo-set-version/relative_absolute_conflict/stdout.term.svg000064400000000000000000000007631046102023000271260ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-set-version/set_absolute_version/mod.rs000064400000000000000000000013451046102023000241030ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("set-version") .args(["2.0.0"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-set-version/set_absolute_version/stderr.term.svg000064400000000000000000000011671046102023000257520ustar 00000000000000 Upgrading sample from 0.1.0 to 2.0.0 cargo-edit-0.13.10/tests/cargo-set-version/set_absolute_version/stdout.term.svg000064400000000000000000000007631046102023000257720ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-set-version/set_absolute_workspace_version/mod.rs000064400000000000000000000014101046102023000261520ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("set-version") .args(["2.0.0", "--package", "inherit_ws_version"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-set-version/set_absolute_workspace_version/stderr.term.svg000064400000000000000000000017401046102023000300250ustar 00000000000000 Upgrading workspace version from 0.2.0 to 2.0.0 Upgrading inherit_ws_version from 0.2.0 to 2.0.0 (inherited from workspace) Updating workspace's dependency from 0.2 to 2.0 Updating with_direct_dep's dependency from 0.2 to 2.0 cargo-edit-0.13.10/tests/cargo-set-version/set_absolute_workspace_version/stdout.term.svg000064400000000000000000000007631046102023000300500ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-set-version/set_relative_version/mod.rs000064400000000000000000000013571046102023000241030ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("set-version") .args(["--bump", "major"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-set-version/set_relative_version/stderr.term.svg000064400000000000000000000011671046102023000257470ustar 00000000000000 Upgrading sample from 0.1.0 to 1.0.0 cargo-edit-0.13.10/tests/cargo-set-version/set_relative_version/stdout.term.svg000064400000000000000000000007631046102023000257670ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-set-version/set_relative_workspace_version/mod.rs000064400000000000000000000014221046102023000261520ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("set-version") .args(["--bump", "major", "--package", "inherit_ws_version"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-set-version/set_relative_workspace_version/stderr.term.svg000064400000000000000000000017401046102023000300220ustar 00000000000000 Upgrading workspace version from 0.2.0 to 1.0.0 Upgrading inherit_ws_version from 0.2.0 to 1.0.0 (inherited from workspace) Updating workspace's dependency from 0.2 to 1.0 Updating with_direct_dep's dependency from 0.2 to 1.0 cargo-edit-0.13.10/tests/cargo-set-version/set_relative_workspace_version/stdout.term.svg000064400000000000000000000007631046102023000300450ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-set-version/upgrade_compatible_dependency/mod.rs000064400000000000000000000014211046102023000256640ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("set-version") .args(["0.4.5", "-p", "cargo-list-test-fixture-dependency"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-set-version/upgrade_compatible_dependency/stderr.term.svg000064400000000000000000000014161046102023000275350ustar 00000000000000 Upgrading cargo-list-test-fixture-dependency from 0.4.3 to 0.4.5 Updating cargo-list-test-fixture's dependency from 0.4.3 to 0.4.5 cargo-edit-0.13.10/tests/cargo-set-version/upgrade_compatible_dependency/stdout.term.svg000064400000000000000000000007631046102023000275600ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-set-version/upgrade_incompatible_dependency/mod.rs000064400000000000000000000014211046102023000262130ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("set-version") .args(["2.0.0", "-p", "cargo-list-test-fixture-dependency"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-set-version/upgrade_incompatible_dependency/stderr.term.svg000064400000000000000000000014161046102023000300640ustar 00000000000000 Upgrading cargo-list-test-fixture-dependency from 0.4.3 to 2.0.0 Updating cargo-list-test-fixture's dependency from 0.4.3 to 2.0.0 cargo-edit-0.13.10/tests/cargo-set-version/upgrade_incompatible_dependency/stdout.term.svg000064400000000000000000000007631046102023000301070ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-set-version/upgrade_workspace/mod.rs000064400000000000000000000013641046102023000233530ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("set-version") .args(["2.0.0", "--workspace"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-set-version/upgrade_workspace/stderr.term.svg000064400000000000000000000015741046102023000252230ustar 00000000000000 Upgrading cargo-list-test-fixture from 0.0.0 to 2.0.0 Upgrading cargo-list-test-fixture-dependency from 0.4.3 to 2.0.0 Updating cargo-list-test-fixture's dependency from 0.4.3 to 2.0.0 cargo-edit-0.13.10/tests/cargo-set-version/upgrade_workspace/stdout.term.svg000064400000000000000000000007631046102023000252410ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-set-version/virtual_workspace_deps/mod.rs000064400000000000000000000013641046102023000244250ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("set-version") .args(["2.0.0", "--workspace"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-set-version/virtual_workspace_deps/stderr.term.svg000064400000000000000000000015561046102023000262750ustar 00000000000000 Upgrading cargo-list-test-fixture from 0.0.0 to 2.0.0 Upgrading cargo-list-test-fixture-dependency from 0.4.3 to 2.0.0 Updating workspace's dependency from 0.4.3 to 2.0.0 cargo-edit-0.13.10/tests/cargo-set-version/virtual_workspace_deps/stdout.term.svg000064400000000000000000000007631046102023000263130ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-set-version/workspace_deps/mod.rs000064400000000000000000000013641046102023000226570ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("set-version") .args(["2.0.0", "--workspace"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-set-version/workspace_deps/stderr.term.svg000064400000000000000000000015561046102023000245270ustar 00000000000000 Upgrading cargo-list-test-fixture from 0.0.0 to 2.0.0 Upgrading cargo-list-test-fixture-dependency from 0.4.3 to 2.0.0 Updating workspace's dependency from 0.4.3 to 2.0.0 cargo-edit-0.13.10/tests/cargo-set-version/workspace_deps/stdout.term.svg000064400000000000000000000007631046102023000245450ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-set-version/workspace_version_exclude/mod.rs000064400000000000000000000014111046102023000251130ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("set-version") .args(["2.0.0", "--workspace", "--exclude", "root"]) .current_dir(cwd) .assert() .failure() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-set-version/workspace_version_exclude/stderr.term.svg000064400000000000000000000012711046102023000267640ustar 00000000000000 Error: Cannot exclude root package(s) when inherits-version package(s) modify `workspace.package.version` cargo-edit-0.13.10/tests/cargo-set-version/workspace_version_exclude/stdout.term.svg000064400000000000000000000007631046102023000270100ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-set-version/workspace_version_subset/mod.rs000064400000000000000000000013721046102023000247750ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("set-version") .args(["2.0.0", "--package", "root"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-set-version/workspace_version_subset/stderr.term.svg000064400000000000000000000017511046102023000266430ustar 00000000000000 Upgrading workspace version from 0.1.0 to 2.0.0 Upgrading root from 0.1.0 to 2.0.0 (inherited from workspace) Upgrading inherits-version from 0.1.0 to 2.0.0 (inherited from workspace) Updating workspace's dependency from 0.1.0 to 2.0.0 cargo-edit-0.13.10/tests/cargo-set-version/workspace_version_subset/stdout.term.svg000064400000000000000000000007631046102023000266640ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-upgrade/alt_registry/mod.rs000064400000000000000000000013621046102023000215250ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_alt_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_alt_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/alt_registry/stderr.term.svg000064400000000000000000000014641046102023000233750ustar 00000000000000 Checking none's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/alt_registry/stdout.term.svg000064400000000000000000000016741046102023000234170ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package1 0.1.1 0.1.1 99999.0.0 99999.0.0 my-package2 0.2 0.2.3 99999.0.0 99999.0 cargo-edit-0.13.10/tests/cargo-upgrade/cli_rust_version/mod.rs000064400000000000000000000026441046102023000224120ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use cargo_test_support::current_dir; #[cargo_test] fn case() { cargo_test_support::registry::Package::new("my-package", "0.1.1") .rust_version("1.60.0") .publish(); cargo_test_support::registry::Package::new("my-package", "0.1.2") .rust_version("1.64.0") .publish(); cargo_test_support::registry::Package::new("my-package", "0.1.3") .rust_version("1.68.0") .publish(); cargo_test_support::registry::Package::new("my-package", "0.2.0") .rust_version("1.68.0") .publish(); cargo_test_support::registry::Package::new("my-package", "0.3.0") .rust_version("1.72.0") .publish(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args([ "--verbose", "--verbose", "--pinned", "--incompatible", "--rust-version=1.70.0", ]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/cli_rust_version/stderr.term.svg000064400000000000000000000015071046102023000242540ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/cli_rust_version/stdout.term.svg000064400000000000000000000015001046102023000242640ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1.1 0.1.3 0.2.0 0.2.0 cargo-edit-0.13.10/tests/cargo-upgrade/dry_run/mod.rs000064400000000000000000000013671046102023000205040ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--dry-run", "--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/dry_run/stderr.term.svg000064400000000000000000000013411046102023000223410ustar 00000000000000 Checking cargo-list-test-fixture's dependencies warning: aborting upgrade due to dry run cargo-edit-0.13.10/tests/cargo-upgrade/dry_run/stdout.term.svg000064400000000000000000000015171046102023000223650ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1.1 0.1.1 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/exclude_dep/mod.rs000064400000000000000000000017211046102023000212750ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use cargo_test_support::current_dir; #[cargo_test] fn case() { cargo_test_support::registry::init(); crate::add_everything_registry_packages(false); crate::add_git_registry_packages(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args([ "--pinned", "--exclude", "docopt", "--verbose", "--verbose", "--incompatible", ]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/exclude_dep/stderr.term.svg000064400000000000000000000014641046102023000231460ustar 00000000000000 Checking None's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/exclude_dep/stdout.term.svg000064400000000000000000000051221046102023000231600ustar 00000000000000 name old req compatible latest new req note ==== ======= ========== ====== ======= ==== docopt 0.4 0.4.1 99999.0.0 0.4 excluded pad 0.1 0.1.1 99999.0.0 99999.0 serde_json 20.0 20.0.0 99999.0.0 99999.0 syn 0.1.1 0.1.1 99999.0.0 99999.0.0 tar 0.4 0.4.1 99999.0.0 99999.0 ftp 20.0.0 20.0.0 99999.0.0 99999.0.0 toml_edit (te) 0.1.1 0.1.1 99999.0.0 99999.0.0 semver 0.2 0.2.3 99999.0.0 99999.0 renamed (rn) 0.1 0.1.1 99999.0.0 99999.0 assert_cli 0.2.0 0.2.3 99999.0.0 99999.0.0 tempdir 0.1 0.1.1 99999.0.0 99999.0 serde 1.0 - - 1.0 openssl 0.4 0.4.1 99999.0.0 99999.0 rget 0.4.0 0.4.1 99999.0.0 99999.0.0 geo 0.2.0 0.2.3 99999.0.0 99999.0.0 ftp 0.2.0 0.2.3 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/exclude_renamed/mod.rs000064400000000000000000000016201046102023000221360ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use cargo_test_support::current_dir; #[cargo_test] fn case() { cargo_test_support::registry::init(); crate::add_everything_registry_packages(false); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args([ "--exclude", "regex", "--verbose", "--verbose", "--incompatible", ]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/exclude_renamed/stderr.term.svg000064400000000000000000000013741046102023000240110ustar 00000000000000 Checking cargo-list-test-fixture's dependencies note: Re-run with `--pinned` to upgrade pinned version requirements cargo-edit-0.13.10/tests/cargo-upgrade/exclude_renamed/stdout.term.svg000064400000000000000000000017441046102023000240310ustar 00000000000000 name old req compatible latest new req note ==== ======= ========== ====== ======= ==== toml_edit (te) 0.1.5 - 99999.0.0 0.1.5 pinned regex (rx) 0.2 - - 0.2 excluded cargo-edit-0.13.10/tests/cargo-upgrade/ignore_rust_version/mod.rs000064400000000000000000000024521046102023000231230ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use cargo_test_support::current_dir; #[cargo_test] fn case() { cargo_test_support::registry::Package::new("my-package", "0.1.1") .rust_version("1.60.0") .publish(); cargo_test_support::registry::Package::new("my-package", "0.1.2") .rust_version("1.64.0") .publish(); cargo_test_support::registry::Package::new("my-package", "0.1.3") .rust_version("1.68.0") .publish(); cargo_test_support::registry::Package::new("my-package", "0.2.0") .rust_version("1.68.0") .publish(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args([ "--verbose", "--verbose", "--pinned", "--incompatible", "--ignore-rust-version", ]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/ignore_rust_version/stderr.term.svg000064400000000000000000000015071046102023000247700ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/ignore_rust_version/stdout.term.svg000064400000000000000000000015001046102023000250000ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1.1 0.1.3 0.2.0 0.2.0 cargo-edit-0.13.10/tests/cargo-upgrade/implicit_prerelease/mod.rs000064400000000000000000000013521046102023000230350ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/implicit_prerelease/stderr.term.svg000064400000000000000000000015071046102023000247040ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/implicit_prerelease/stdout.term.svg000064400000000000000000000020441046102023000247200ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= unrelated-crate 1.0 - 99999.0.0 99999.0 my-package 0.1.1-alpha.1 0.1.1 99999.1.0-alpha.1 99999.1.0-alpha.1 cargo-edit-0.13.10/tests/cargo-upgrade/invalid_dep/mod.rs000064400000000000000000000013601046102023000212710ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--package", "failure"]) .current_dir(cwd) .assert() .failure() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/invalid_dep/stderr.term.svg000064400000000000000000000013401046102023000231340ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Error: dependency failure doesn't exist cargo-edit-0.13.10/tests/cargo-upgrade/invalid_dep/stdout.term.svg000064400000000000000000000007631046102023000231630ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-upgrade/invalid_flag/mod.rs000064400000000000000000000013401046102023000214300ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--flag"]) .current_dir(cwd) .assert() .code(2) .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/invalid_flag/stderr.term.svg000064400000000000000000000015671046102023000233100ustar 00000000000000 error: unexpected argument '--flag' found Usage: cargo upgrade [OPTIONS] For more information, try '--help'. cargo-edit-0.13.10/tests/cargo-upgrade/invalid_flag/stdout.term.svg000064400000000000000000000007631046102023000233240ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-upgrade/invalid_manifest/mod.rs000064400000000000000000000013061046102023000223270ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .current_dir(cwd) .assert() .code(1) .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/invalid_manifest/stderr.term.svg000064400000000000000000000017651046102023000242050ustar 00000000000000 Error: `cargo metadata` exited with an error: error: key with no value, expected `=` --> Cargo.toml:1:6 | 1 | This is clearly not a valid Cargo.toml. | ^ cargo-edit-0.13.10/tests/cargo-upgrade/invalid_manifest/stdout.term.svg000064400000000000000000000007631046102023000242210ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-upgrade/invalid_workspace_root_manifest/mod.rs000064400000000000000000000013061046102023000254500ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .current_dir(cwd) .assert() .code(1) .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/invalid_workspace_root_manifest/stderr.term.svg000064400000000000000000000017651046102023000273260ustar 00000000000000 Error: `cargo metadata` exited with an error: error: key with no value, expected `=` --> Cargo.toml:1:6 | 1 | This is clearly not a valid Cargo.toml. | ^ cargo-edit-0.13.10/tests/cargo-upgrade/invalid_workspace_root_manifest/stdout.term.svg000064400000000000000000000007631046102023000273420ustar 00000000000000 cargo-edit-0.13.10/tests/cargo-upgrade/locked/mod.rs000064400000000000000000000013661046102023000202620ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--locked", "--incompatible"]) .current_dir(cwd) .assert() .failure() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/locked/stderr.term.svg000064400000000000000000000013401046102023000221170ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Error: cannot upgrade due to `--locked` cargo-edit-0.13.10/tests/cargo-upgrade/locked/stdout.term.svg000064400000000000000000000015171046102023000221440ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1.1 0.1.1 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/locked_dry_run/mod.rs000064400000000000000000000014031046102023000220140ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--locked", "--incompatible", "--dry-run"]) .current_dir(cwd) .assert() .failure() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/locked_dry_run/stderr.term.svg000064400000000000000000000013401046102023000236610ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Error: cannot upgrade due to `--locked` cargo-edit-0.13.10/tests/cargo-upgrade/locked_dry_run/stdout.term.svg000064400000000000000000000015171046102023000237060ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1.1 0.1.1 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/lockfile/mod.rs000064400000000000000000000014041046102023000206020ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--verbose", "--verbose", "--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/lockfile/stderr.term.svg000064400000000000000000000022351046102023000224520ustar 00000000000000 Checking virtual workspace's dependencies Checking one's dependencies Checking three's dependencies Checking two's dependencies Checking four's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/lockfile/stdout.term.svg000064400000000000000000000035401046102023000224710ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 three 0.1.0 - - 0.1.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/main.rs000064400000000000000000000161571046102023000171720ustar 00000000000000#![allow(clippy::all)] #![warn(clippy::needless_borrow)] #![warn(clippy::redundant_clone)] mod alt_registry; mod cli_rust_version; mod dry_run; mod exclude_dep; mod exclude_renamed; mod ignore_rust_version; mod implicit_prerelease; mod invalid_dep; mod invalid_flag; mod invalid_manifest; mod invalid_workspace_root_manifest; mod locked; mod locked_dry_run; mod lockfile; mod optional_dep; mod package_rust_version; mod pinned; mod preserve_op; mod preserve_precision_major; mod preserve_precision_minor; mod preserve_precision_patch; mod preserves_inline_table; mod preserves_std_table; mod single_dep; mod skip_compatible; mod specified; mod to_version; mod upgrade_all; mod upgrade_everything; mod upgrade_renamed; mod upgrade_verbose; mod upgrade_workspace; mod virtual_manifest; mod workspace_inheritance; mod workspace_member_cwd; mod workspace_member_manifest_path; fn init_registry() { cargo_test_support::registry::init(); add_fake_registry_packages(false); } fn init_alt_registry() { cargo_test_support::registry::alt_init(); add_fake_registry_packages(true); } fn add_fake_registry_packages(alt: bool) { for name in [ "my-package", "my-package1", "my-package2", "unrelated-crate", ] { cargo_test_support::registry::Package::new(name, "0.1.1-alpha.1+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "0.1.1+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "0.2.0+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "0.2.3+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "0.4.1+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "20.0.0+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "99999.0.0-alpha.1+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "99999.0.0+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "99999.1.0-alpha.1+my-package") .alternative(alt) .publish(); } } fn add_breaking_registry_packages(alt: bool) { cargo_test_support::registry::Package::new("test_breaking", "0.2.0") .alternative(alt) .publish(); cargo_test_support::registry::Package::new("test_nonbreaking", "0.1.1") .alternative(alt) .publish(); cargo_test_support::registry::Package::new("test_nonbreaking", "0.1.2") .alternative(alt) .publish(); } fn add_everything_registry_packages(alt: bool) { for name in [ // "Everything" "docopt", "pad", "serde", "serde_json", "syn", "tar", "ftp", "toml_edit", "semver", "renamed", "assert_cli", "tempdir", "toml", "openssl", "rget", "geo", ] { cargo_test_support::registry::Package::new(name, "0.1.1-alpha.1+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "0.1.1+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "0.2.0+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "0.2.3+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "0.4.1+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "20.0.0+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "99999.0.0-alpha.1+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "99999.0.0+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "99999.1.0-alpha.1+my-package") .alternative(alt) .publish(); } } fn add_git_registry_packages() { cargo_test_support::git::new("serde", |project| { project .file( "Cargo.toml", &cargo_test_support::basic_manifest("serde", "1.0.99999"), ) .file("src/lib.rs", r#"pub fn hello() { println!("it works"); }"#) }); } fn add_op_registry_packages(alt: bool) { for name in [ "default", "exact", "lessthan", "lessorequal", "greaterthan", "greaterorequal", "wildcard", "caret", "tilde", "greaterthan", "greaterthan", ] { cargo_test_support::registry::Package::new(name, "0.1.1-alpha.1+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "0.1.1+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "0.2.0+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "0.2.3+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "0.4.1+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "20.0.0+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "99999.0.0-alpha.1+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "99999.0.0+my-package") .alternative(alt) .publish(); cargo_test_support::registry::Package::new(name, "99999.1.0-alpha.1+my-package") .alternative(alt) .publish(); } cargo_test_support::registry::Package::new("prerelease_only", "0.2.0-alpha.1") .alternative(alt) .publish(); cargo_test_support::registry::Package::new("test_breaking", "0.2.0") .alternative(alt) .publish(); cargo_test_support::registry::Package::new("test_nonbreaking", "0.1.1") .alternative(alt) .publish(); cargo_test_support::registry::Package::new("test_nonbreaking", "0.1.2") .alternative(alt) .publish(); } pub fn cargo_exe() -> &'static std::path::Path { snapbox::cmd::cargo_bin!("cargo-upgrade") } /// Test the cargo command pub trait CargoCommand { fn cargo_ui() -> Self; } impl CargoCommand for snapbox::cmd::Command { fn cargo_ui() -> Self { use cargo_test_support::TestEnvCommandExt; Self::new(cargo_exe()) .with_assert(cargo_test_support::compare::assert_ui()) .test_env() } } cargo-edit-0.13.10/tests/cargo-upgrade/optional_dep/mod.rs000064400000000000000000000013521046102023000214710ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/optional_dep/stderr.term.svg000064400000000000000000000015071046102023000233400ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/optional_dep/stdout.term.svg000064400000000000000000000015171046102023000233600ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1.1 0.1.1 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/package_rust_version/mod.rs000064400000000000000000000023121046102023000232260ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use cargo_test_support::current_dir; #[cargo_test] fn case() { cargo_test_support::registry::Package::new("my-package", "0.1.1") .rust_version("1.60.0") .publish(); cargo_test_support::registry::Package::new("my-package", "0.1.2") .rust_version("1.64.0") .publish(); cargo_test_support::registry::Package::new("my-package", "0.1.3") .rust_version("1.68.0") .publish(); cargo_test_support::registry::Package::new("my-package", "0.2.0") .rust_version("1.68.0") .publish(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--verbose", "--verbose", "--pinned", "--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/package_rust_version/stderr.term.svg000064400000000000000000000015071046102023000251000ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/package_rust_version/stdout.term.svg000064400000000000000000000015001046102023000251100ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1.1 0.1.2 0.1.2 0.1.2 cargo-edit-0.13.10/tests/cargo-upgrade/pinned/mod.rs000064400000000000000000000014531046102023000202730ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use cargo_test_support::current_dir; #[cargo_test] fn case() { cargo_test_support::registry::init(); crate::add_op_registry_packages(false); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--verbose", "--verbose", "--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/pinned/stderr.term.svg000064400000000000000000000017021046102023000221350ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions note: Re-run with `--pinned` to upgrade pinned version requirements cargo-edit-0.13.10/tests/cargo-upgrade/pinned/stdout.term.svg000064400000000000000000000034541046102023000221620ustar 00000000000000 name old req compatible latest new req note ==== ======= ========== ====== ======= ==== default 0.2 0.2.3 99999.0.0 99999.0 exact =0.2 0.2.3 99999.0.0 =0.2 pinned lessthan <0.2 0.1.1 99999.0.0 <0.2 pinned lessorequal <=0.2 0.2.3 99999.0.0 <=0.2 pinned caret ^0.2 0.2.3 99999.0.0 ^99999.0 tilde ~0.2.0 0.2.3 99999.0.0 ~99999.0.0 greaterthan >0.2 99999.0.0 99999.0.0 >0.2 greaterorequal >=0.2.0 99999.0.0 99999.0.0 >=0.2.0 wildcard 0.2.* 0.2.3 99999.0.0 0.2.* pinned cargo-edit-0.13.10/tests/cargo-upgrade/preserve_op/mod.rs000064400000000000000000000014671046102023000213540ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use cargo_test_support::current_dir; #[cargo_test] fn case() { cargo_test_support::registry::init(); crate::add_op_registry_packages(false); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--verbose", "--verbose", "--pinned", "--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/preserve_op/stderr.term.svg000064400000000000000000000015071046102023000232140ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/preserve_op/stdout.term.svg000064400000000000000000000033311046102023000232300ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= default 0.2 0.2.3 99999.0.0 99999.0 exact =0.2 0.2.3 99999.0.0 =99999.0 lessthan <0.2 0.1.1 99999.0.0 99999.0.0 lessorequal <=0.2 0.2.3 99999.0.0 99999.0.0 caret ^0.2 0.2.3 99999.0.0 ^99999.0 tilde ~0.2.0 0.2.3 99999.0.0 ~99999.0.0 greaterthan >0.2 99999.0.0 99999.0.0 >0.2 greaterorequal >=0.2.0 99999.0.0 99999.0.0 >=0.2.0 wildcard 0.2.* 0.2.3 99999.0.0 99999.0.* cargo-edit-0.13.10/tests/cargo-upgrade/preserve_precision_major/mod.rs000064400000000000000000000014201046102023000241060ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--verbose", "--verbose", "--pinned", "--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/preserve_precision_major/stderr.term.svg000064400000000000000000000015071046102023000257610ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/preserve_precision_major/stdout.term.svg000064400000000000000000000015111046102023000257730ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0 0.4.1 99999.0.0 99999 cargo-edit-0.13.10/tests/cargo-upgrade/preserve_precision_minor/mod.rs000064400000000000000000000014201046102023000241220ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--verbose", "--verbose", "--pinned", "--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/preserve_precision_minor/stderr.term.svg000064400000000000000000000015071046102023000257750ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/preserve_precision_minor/stdout.term.svg000064400000000000000000000015111046102023000260070ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1 0.1.1 99999.0.0 99999.0 cargo-edit-0.13.10/tests/cargo-upgrade/preserve_precision_patch/mod.rs000064400000000000000000000014201046102023000240750ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--verbose", "--verbose", "--pinned", "--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/preserve_precision_patch/stderr.term.svg000064400000000000000000000015071046102023000257500ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/preserve_precision_patch/stdout.term.svg000064400000000000000000000015171046102023000257700ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1.1 0.1.1 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/preserves_inline_table/mod.rs000064400000000000000000000013521046102023000235370ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/preserves_inline_table/stderr.term.svg000064400000000000000000000015071046102023000254060ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/preserves_inline_table/stdout.term.svg000064400000000000000000000015171046102023000254260ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1.1 0.1.1 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/preserves_std_table/mod.rs000064400000000000000000000013521046102023000230530ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/preserves_std_table/stderr.term.svg000064400000000000000000000015071046102023000247220ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/preserves_std_table/stdout.term.svg000064400000000000000000000015171046102023000247420ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1.1 0.1.1 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/single_dep/mod.rs000064400000000000000000000013521046102023000211250ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/single_dep/stderr.term.svg000064400000000000000000000015071046102023000227740ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/single_dep/stdout.term.svg000064400000000000000000000015171046102023000230140ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1.1 0.1.1 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/skip_compatible/mod.rs000064400000000000000000000014371046102023000221650ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use cargo_test_support::current_dir; #[cargo_test] fn case() { cargo_test_support::registry::init(); crate::add_breaking_registry_packages(false); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--verbose", "--verbose"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/skip_compatible/stderr.term.svg000064400000000000000000000015411046102023000240260ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Upgrading recursive dependencies note: Re-run with `--incompatible` to upgrade incompatible version requirements cargo-edit-0.13.10/tests/cargo-upgrade/skip_compatible/stdout.term.svg000064400000000000000000000017601046102023000240500ustar 00000000000000 name old req compatible latest new req note ==== ======= ========== ====== ======= ==== test_breaking 0.1 - 0.2.0 0.1 incompatible test_nonbreaking 0.1.0 0.1.2 0.1.2 0.1.2 cargo-edit-0.13.10/tests/cargo-upgrade/specified/mod.rs000064400000000000000000000014061046102023000207470ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--package", "my-package1", "--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/specified/stderr.term.svg000064400000000000000000000020041046102023000226070ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions note: Re-run with `--verbose` to show more dependencies excluded: my-package2 cargo-edit-0.13.10/tests/cargo-upgrade/specified/stdout.term.svg000064400000000000000000000015141046102023000226330ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package1 0.1 0.1.1 99999.0.0 99999.0 cargo-edit-0.13.10/tests/cargo-upgrade/to_version/mod.rs000064400000000000000000000017031046102023000212030ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use cargo_test_support::current_dir; #[cargo_test] fn case() { cargo_test_support::registry::init(); crate::add_everything_registry_packages(false); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args([ "--package", "docopt@99999.0.0", "--verbose", "--verbose", "--compatible=false", "--incompatible=false", ]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/to_version/stderr.term.svg000064400000000000000000000012031046102023000230430ustar 00000000000000 Checking cargo-list-test-fixture's dependencies cargo-edit-0.13.10/tests/cargo-upgrade/to_version/stdout.term.svg000064400000000000000000000015031046102023000230650ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= docopt 0.4.0 0.4.1 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/upgrade_all/mod.rs000064400000000000000000000014041046102023000212710ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--verbose", "--verbose", "--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/upgrade_all/stderr.term.svg000064400000000000000000000022351046102023000231410ustar 00000000000000 Checking virtual workspace's dependencies Checking four's dependencies Checking one's dependencies Checking three's dependencies Checking two's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/upgrade_all/stdout.term.svg000064400000000000000000000035401046102023000231600ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 three 0.1.0 - - 0.1.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/upgrade_everything/mod.rs000064400000000000000000000015151046102023000227100ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use cargo_test_support::current_dir; #[cargo_test] fn case() { cargo_test_support::registry::init(); crate::add_everything_registry_packages(false); crate::add_git_registry_packages(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--pinned", "--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/upgrade_everything/stderr.term.svg000064400000000000000000000017511046102023000245570ustar 00000000000000 Checking None's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions note: Re-run with `--verbose` to show more dependencies latest: serde cargo-edit-0.13.10/tests/cargo-upgrade/upgrade_everything/stdout.term.svg000064400000000000000000000045041046102023000245750ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= docopt 0.4 0.4.1 99999.0.0 99999.0 pad 0.1 0.1.1 99999.0.0 99999.0 serde_json 20.0 20.0.0 99999.0.0 99999.0 syn 0.1.1 0.1.1 99999.0.0 99999.0.0 tar 0.4 0.4.1 99999.0.0 99999.0 ftp 20.0.0 20.0.0 99999.0.0 99999.0.0 toml_edit (te) 0.1.1 0.1.1 99999.0.0 99999.0.0 semver 0.2 0.2.3 99999.0.0 99999.0 renamed (rn) 0.1 0.1.1 99999.0.0 99999.0 assert_cli 0.2.0 0.2.3 99999.0.0 99999.0.0 tempdir 0.1 0.1.1 99999.0.0 99999.0 openssl 0.4 0.4.1 99999.0.0 99999.0 rget 0.4.0 0.4.1 99999.0.0 99999.0.0 geo 0.2.0 0.2.3 99999.0.0 99999.0.0 ftp 0.2.0 0.2.3 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/upgrade_renamed/mod.rs000064400000000000000000000014201046102023000221320ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--pinned", "--incompatible", "--verbose", "--verbose"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/upgrade_renamed/stderr.term.svg000064400000000000000000000015071046102023000240050ustar 00000000000000 Checking cargo-list-test-fixture's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/upgrade_renamed/stdout.term.svg000064400000000000000000000017201046102023000240210ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package1 (m1) 0.1.1 0.1.1 99999.0.0 99999.0.0 my-package2 (m2) 0.2 0.2.3 99999.0.0 99999.0 cargo-edit-0.13.10/tests/cargo-upgrade/upgrade_verbose/mod.rs000064400000000000000000000015471046102023000221760ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use cargo_test_support::current_dir; #[cargo_test] fn case() { cargo_test_support::registry::init(); crate::add_everything_registry_packages(false); crate::add_git_registry_packages(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--pinned", "--incompatible", "--verbose", "--verbose"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/upgrade_verbose/stderr.term.svg000064400000000000000000000014641046102023000240410ustar 00000000000000 Checking None's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/upgrade_verbose/stdout.term.svg000064400000000000000000000046601046102023000240610ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= docopt 0.4 0.4.1 99999.0.0 99999.0 pad 0.1 0.1.1 99999.0.0 99999.0 serde_json 20.0 20.0.0 99999.0.0 99999.0 syn 0.1.1 0.1.1 99999.0.0 99999.0.0 tar 0.4 0.4.1 99999.0.0 99999.0 ftp 20.0.0 20.0.0 99999.0.0 99999.0.0 toml_edit (te) 0.1.1 0.1.1 99999.0.0 99999.0.0 semver 0.2 0.2.3 99999.0.0 99999.0 renamed (rn) 0.1 0.1.1 99999.0.0 99999.0 assert_cli 0.2.0 0.2.3 99999.0.0 99999.0.0 tempdir 0.1 0.1.1 99999.0.0 99999.0 serde 1.0 - - 1.0 openssl 0.4 0.4.1 99999.0.0 99999.0 rget 0.4.0 0.4.1 99999.0.0 99999.0.0 geo 0.2.0 0.2.3 99999.0.0 99999.0.0 ftp 0.2.0 0.2.3 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/upgrade_workspace/mod.rs000064400000000000000000000014041046102023000225170ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--incompatible", "--verbose", "--verbose"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/upgrade_workspace/stderr.term.svg000064400000000000000000000022351046102023000243670ustar 00000000000000 Checking virtual workspace's dependencies Checking four's dependencies Checking one's dependencies Checking three's dependencies Checking two's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/upgrade_workspace/stdout.term.svg000064400000000000000000000035401046102023000244060ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 three 0.1.0 - - 0.1.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/virtual_manifest/mod.rs000064400000000000000000000015541046102023000223740ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args([ "--manifest-path", "Cargo.toml", "--verbose", "--verbose", "--incompatible", ]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/virtual_manifest/stderr.term.svg000064400000000000000000000022351046102023000242360ustar 00000000000000 Checking virtual workspace's dependencies Checking four's dependencies Checking one's dependencies Checking three's dependencies Checking two's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions cargo-edit-0.13.10/tests/cargo-upgrade/virtual_manifest/stdout.term.svg000064400000000000000000000035401046102023000242550ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 three 0.1.0 - - 0.1.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/workspace_inheritance/mod.rs000064400000000000000000000013521046102023000233630ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/workspace_inheritance/stderr.term.svg000064400000000000000000000025201046102023000252260ustar 00000000000000 Checking virtual workspace's dependencies Checking four's dependencies Checking one's dependencies Checking three's dependencies Checking two's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions note: Re-run with `--verbose` to show more dependencies local: three cargo-edit-0.13.10/tests/cargo-upgrade/workspace_inheritance/stdout.term.svg000064400000000000000000000015171046102023000252520ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1.1 0.1.1 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/workspace_member_cwd/mod.rs000064400000000000000000000014201046102023000231720ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = project_root.join("one"); snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args(["--package", "my-package", "--incompatible"]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/workspace_member_cwd/stderr.term.svg000064400000000000000000000025231046102023000250440ustar 00000000000000 Checking virtual workspace's dependencies Checking four's dependencies Checking one's dependencies Checking three's dependencies Checking two's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions note: Re-run with `--verbose` to show more dependencies excluded: three cargo-edit-0.13.10/tests/cargo-upgrade/workspace_member_cwd/stdout.term.svg000064400000000000000000000033701046102023000250640ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1.1 0.1.1 99999.0.0 99999.0.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1.1 0.1.1 99999.0.0 99999.0.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1.1 0.1.1 99999.0.0 99999.0.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.1.1 0.1.1 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/cargo-upgrade/workspace_member_manifest_path/mod.rs000064400000000000000000000015701046102023000252450ustar 00000000000000use cargo_test_support::Project; use cargo_test_support::compare::assert_ui; use cargo_test_support::file; use cargo_test_support::prelude::*; use crate::CargoCommand; use crate::init_registry; use cargo_test_support::current_dir; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = project_root.join("one"); snapbox::cmd::Command::cargo_ui() .arg("upgrade") .args([ "--package", "my-package", "--manifest-path", "Cargo.toml", "--incompatible", ]) .current_dir(cwd) .assert() .success() .stdout_eq(file!["stdout.term.svg"]) .stderr_eq(file!["stderr.term.svg"]); assert_ui().subset_matches(current_dir!().join("out"), &project_root); } cargo-edit-0.13.10/tests/cargo-upgrade/workspace_member_manifest_path/stderr.term.svg000064400000000000000000000025231046102023000271110ustar 00000000000000 Checking virtual workspace's dependencies Checking four's dependencies Checking one's dependencies Checking three's dependencies Checking two's dependencies Upgrading recursive dependencies Locking 0 packages to latest compatible versions note: Re-run with `--verbose` to show more dependencies excluded: three cargo-edit-0.13.10/tests/cargo-upgrade/workspace_member_manifest_path/stdout.term.svg000064400000000000000000000033701046102023000271310ustar 00000000000000 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 name old req compatible latest new req ==== ======= ========== ====== ======= my-package 0.2.0 0.2.3 99999.0.0 99999.0.0 cargo-edit-0.13.10/tests/fixtures/manifest-invalid/Cargo.toml.sample000064400000000000000000000001521046102023000234570ustar 00000000000000[package] name = "manifest-invalid-test-fixture" version = "0.1.0" [invalid-section] key = invalid-value cargo-edit-0.13.10/tests/readme.rs000064400000000000000000000001321046102023000147450ustar 00000000000000#[test] fn cli_tests() { let t = trycmd::TestCases::new(); t.case("README.md"); }