-
-
Notifications
You must be signed in to change notification settings - Fork 280
feat: add support for Cargo.lock
version update
#1402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
If `Cargo.lock` file is present in the same path as the `Cargo.toml`, the version of the package will also be updated in the `Cargo.lock` file. The implementation is similar to the one used for `UvProvider`, which extends the `CargoProvider` to handle lock files. The change does not break any existing functionality, if the `Cargo.lock` file is not present, since it checks for the existence of the file before attempting a lock file update.
To add more test variables, increase the verbosity of current ones and make them more clear.
Add a test to check the behavior of the cargo provider when a `Cargo.lock` file is present. This test ensures that the `CargoProvider` behaves correctly when the lock file is present, and updates both the `Cargo.lock` and `Cargo.toml` files accordingly.
Add `Cargo.lock` update information to the documentation.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1402 +/- ##
==========================================
+ Coverage 97.33% 97.57% +0.23%
==========================================
Files 42 57 +15
Lines 2104 2680 +576
==========================================
+ Hits 2048 2615 +567
- Misses 56 65 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Description
As depicted in #1201:
This PR introduces the capability of updating the package version in the
Cargo.lock
file, where the package name is the one defined inCargo.toml
, for thecargo
version provider.Checklist
poetry all
locally to ensure this change passes linter check and testExpected behavior
For
cargo
version provider, if aCargo.lock
file also exists within the same directory asCargo.toml
, theCargo.lock
'spackage.version
field whosepackage.name
field is the same asCargo.toml
'spackage.name
field should be updated along withCargo.toml
.Additional context
Resolves: #1201