Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #212 +/- ##
==========================================
- Coverage 85.30% 85.29% -0.02%
==========================================
Files 12 12
Lines 939 945 +6
==========================================
+ Hits 801 806 +5
- Misses 138 139 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
We only write to the pyproject.toml file once, and only if there were no errors.
ajeklund
reviewed
Feb 26, 2024
Contributor
ajeklund
left a comment
There was a problem hiding this comment.
I like this update! Seems like there is a problem with the Windows builds, though.
Partly out of scope-question regarding validation: Does the code check if there are multiple occurrences of a dependency where there should not be? Or will such user error be caught somewhere else?
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #203
Add a new utility function to update the parsed
pyproject.tomlfile in-memory document, which will eventually be dumped (usingtomlkit) and written to (overwriting) thepyproject.tomlfile.This let's
tomlkithandle the serialization (converting the parsed file back to TOML-syntax) and should be more stable than the current implementation using regular expressions.As a side note, this now only writes to/updates the
pyproject.tomlfile once - at the end of going through all dependencies if no errors occurred.This is an (improved) change from the existing behaviour, which writes to/updates the
pyproject.tomlfile for each dependency (if necessary) and does not revert changes if an error occurs. The improvement I see here, is that thepyproject.tomlfile now is only changed if there were no errors, plus the disk is touched only once for writing.