-
Notifications
You must be signed in to change notification settings - Fork 45
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
Reordering of import statements in the entire phys2bids project #195
Conversation
Codecov Report
@@ Coverage Diff @@
## master #195 +/- ##
==========================================
+ Coverage 94.42% 94.46% +0.03%
==========================================
Files 7 7
Lines 574 578 +4
==========================================
+ Hits 542 546 +4
Misses 32 32
|
I know that I took myself out from the review task, but I had a peek this morning at it.
It's quite tricky to categorise "standard libraries", as we use much more often packages like |
Good point! I always find it difficult to tell when it's a standard library or a third-party one. To me, they're all third-party 🤣 |
Happy to review ! @smoia: that's the right list you linked to, and indeed—if it's in the requirements.txt file then it's third-party (assuming you didn't add any standard library modules to that list 🙈)! @eurunuela: do you wanna do another re-ordering based on the list @smoia linked describing what modules are standard and then let me know when to take a look at this? |
Sure thing @rmarkello! I’ll let you know when it’s ready. |
@rmarkello forgot to tell you this last commit should've addressed the comments in our previous discussion |
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.
Hey @eurunuela ! This looks good; I made a few comments / suggestions that should be pretty straightforward to take care of, but let me know if you have any questions.
Happy to approve once these few minor things are addressed!
phys2bids/tests/conftest.py
Outdated
@@ -1,7 +1,6 @@ | |||
import os | |||
from urllib.request import urlretrieve | |||
|
|||
import pytest |
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.
pytest
is not part of the standard library and should be separate into a third-part imports section.
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.
This point still stands! pytest
is not part of the stdlib and should be moved to a third-party library import section.
phys2bids/tests/test_integration.py
Outdated
@@ -2,12 +2,13 @@ | |||
import json | |||
import math | |||
import os | |||
from pkg_resources import resource_filename | |||
import re | |||
import subprocess | |||
|
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.
pkg_resources
is part of the standard library and should be bundled with the standard imports. It mostly is here, but we just need to get rid of this extra blank line!
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.
This also still stands! pkg_resources
shouldn't be separated from standard library imports.
phys2bids/tests/test_phys2bids.py
Outdated
import json | ||
from phys2bids import phys2bids | ||
import os | ||
|
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.
Same as the last one; no blank line between the import
and from X import Y
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.
Same as above! pkg_resources
needs to be part of the standard library imports
phys2bids/tests/test_txt.py
Outdated
@@ -1,5 +1,4 @@ | |||
import math |
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.
import math | |
import math | |
Need the blank line; pytest
is third-party.
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.
Need this blank line. pytest
is third-party!
@rmarkello I'm sorry I made you "waste" your time like that. Apparently my last changes were not correctly pushed (I had just factory reset my computer so something probably did not go as expected with git). Most of your comments had already been assessed, so this time it should be even easier to review. Thank you so much! 💯 |
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.
Still had a few lingering things that needed to be cleaned up; I commented on some "resolved" conversations so hopefully it re-opens them to show you what I'm talking about! Almost there 👍
phys2bids/tests/conftest.py
Outdated
@@ -1,7 +1,6 @@ | |||
import os | |||
from urllib.request import urlretrieve | |||
|
|||
import pytest |
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.
This point still stands! pytest
is not part of the stdlib and should be moved to a third-party library import section.
phys2bids/tests/test_integration.py
Outdated
@@ -2,12 +2,13 @@ | |||
import json | |||
import math | |||
import os | |||
from pkg_resources import resource_filename | |||
import re | |||
import subprocess | |||
|
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.
This also still stands! pkg_resources
shouldn't be separated from standard library imports.
phys2bids/tests/test_phys2bids.py
Outdated
import json | ||
from phys2bids import phys2bids | ||
import os | ||
|
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.
Same as above! pkg_resources
needs to be part of the standard library imports
phys2bids/tests/test_txt.py
Outdated
@@ -1,5 +1,4 @@ | |||
import math |
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.
Need this blank line. pytest
is third-party!
Okay, @eurunuela ! That review was a bit weird because I was commenting on issues that had been marked as "resolved" so it's showing them as...still resolved. I unresolved all the still-present issues from my first review—take a look at those (there should be ~4) and let me know what you think! Thanks so much! |
Okay @rmarkello, I think we're both on the same page now. I'm sorry for the misunderstanding. Thanks! |
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.
LGTM!
Thanks @rmarkello ! I'll merge it myself. I don't think this issue needs another review (it's a minimal change). |
Closes #182.
Proposed Changes