-
Notifications
You must be signed in to change notification settings - Fork 19
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
MAINT: Ignore svgutils
regex warning
#170
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #170 +/- ##
==========================================
+ Coverage 66.04% 66.38% +0.33%
==========================================
Files 25 25
Lines 2677 2677
Branches 421 421
==========================================
+ Hits 1768 1777 +9
+ Misses 793 788 -5
+ Partials 116 112 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
pyproject.toml
Outdated
filterwarnings = ["ignore::DeprecationWarning"] | ||
filterwarnings = [ | ||
"ignore::DeprecationWarning", | ||
"ignore:.*invalid escape sequence.*:SyntaxWarning:svgutils.compose", |
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.
So far, I've only been able to suppress it with:
"ignore:.*invalid escape sequence.*:SyntaxWarning:svgutils.compose", | |
"ignore::SyntaxWarning", |
An alternative could be to add python -c 'import svgutils.compose'
as a pre-command, so that the file is already compiled. Then other SyntaxWarnings could be promoted to errors while ignoring this specific one.
commands_pre =
python -c "import svgutils.compose"
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.
👍 Took the second approach. Not sure why the spellcheck
and style
checks are unhappy even if I added svgutils
explicitly as a dependency.
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.
After having fixed the spellcheck
and style
environments in 0c0fa8c, the thing is that the import itself raises the warning, so we have only relocated the issue to another place (even if for the purposes of pytest
, it would be OK).
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.
Have tried all possibilities that I could com up with and no solution worked other than the one in 0b0b2c8
https://github.com/nipreps/nireports/actions/runs/13370993742/job/37339233487?pr=170#step:14:333
https://github.com/nipreps/nireports/actions/runs/13370993742/job/37339233086?pr=170#step:14:331
I am not fond of it as it is too broad, but 0c0fa8c was not satisfactory enough either (#170 (comment)) so I would vote for merging this as is and hoping that no regexes that we may potentially add in the code will raise this @effigies.
5309edc
to
0c0fa8c
Compare
6b89bc8
to
0259eeb
Compare
Ignore `svgutils` regex warning: the package is at its most recent release (0.3.4), and last commit was 3 years ago. Fixes: ``` .tox/py312-latest/lib/python3.12/site-packages/svgutils/compose.py:379 /lib/python3.12/site-packages/svgutils/compose.py:379: SyntaxWarning: invalid escape sequence '\.' m = re.match("([0-9]+\.?[0-9]*)([a-z]+)", measure) ``` raised for example in: https://github.com/nipreps/nireports/actions/runs/13355051658/job/37296638147?pr=169#step:14:337 Co-authored-by: Chris Markiewicz <[email protected]>
0259eeb
to
0b0b2c8
Compare
This feels extremely brittle. svgutils is small and unmaintained. What if we just vendor a fixed copy? |
Looks good to me Chris. TBH, I was not able to locate the faulty statement
in |
Ignore
svgutils
regex warning: the package is at its most recent release (0.3.4), and last commit was 3 years ago.Fixes:
raised for example in:
https://github.com/nipreps/nireports/actions/runs/13355051658/job/37296638147?pr=169#step:14:337