-
Notifications
You must be signed in to change notification settings - Fork 0
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
Ignore documentation string mismatch in dimension validation #40
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #40 +/- ##
==========================================
+ Coverage 55.66% 58.68% +3.01%
==========================================
Files 38 38
Lines 1315 1428 +113
Branches 281 302 +21
==========================================
+ Hits 732 838 +106
- Misses 546 549 +3
- Partials 37 41 +4 ☔ View full report in Codecov by Sentry. |
Users are having trouble running universe v5 -> v6 migrations because of the error generated for mismatched dimension universes. There is a known mismatch of documentation strings in some older repositories that is spuriously throwing an error. Add a special case to ignore this known mismatch so that users don't have to add special options to complete the migration.
In the new version of uv, they dropped support for the VIRTUAL_ENV environment variable.
e8eba41
to
0da4428
Compare
def _is_expected_diff_line(line: str) -> bool: | ||
# ndiff prefix for matching lines and "hint" lines. | ||
if line.startswith(" ") or line.startswith("? "): | ||
return True | ||
|
||
# Lines containing only docstring changes. | ||
if re.match(r'^[-+]\s+"doc":', line): | ||
return True | ||
|
||
# Empty line. | ||
if line.strip() == "": | ||
return True | ||
|
||
return False |
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.
Feels a bit fragile. Would it be better to just ignore doc strings when doing diff (maybe optionally)? You could load JSON from string into dict, drop all doc
keys recursively and compare the result.
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.
Looks good, one potential improvement, but it's up to you.
Instead of trying to filter out doc strings after running the diff, adjust the input to the diff to get the same effect. This is a little less fragile.
70fc9cc
to
fe805b7
Compare
Users are having trouble running universe v5 -> v6 migrations because of the error generated for mismatched dimension universes. There is a known mismatch of documentation strings in some older repositories that is spuriously throwing an error.
Add a special case to ignore this known mismatch so that users don't have to add special options to complete the migration.
Checklist