-
Notifications
You must be signed in to change notification settings - Fork 262
MRG: removing some vendored dependencies #508
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
Conversation
Use function to read variables from `info.py` file into object, making namespace clearer.
9df2341
to
ae1bd4f
Compare
Depend on six, use six directly, test deprecated nibabel.externals.six import. Remove implementation of OrderedDict for Python 2.6, but leave shim in place, presumably it will die a natural death. Note that, we can't test six==1.3 as a dependency, because setuptools needs something later already.
ae1bd4f
to
78c9b61
Compare
This one now ready for review. |
Codecov Report
@@ Coverage Diff @@
## master #508 +/- ##
==========================================
+ Coverage 94.03% 94.03% +<.01%
==========================================
Files 166 166
Lines 21994 21995 +1
Branches 2343 2343
==========================================
+ Hits 20681 20682 +1
Misses 878 878
Partials 435 435
Continue to review full report at Codecov.
|
from collections import OrderedDict | ||
|
||
from ..deprecated import ModuleProxy as _ModuleProxy | ||
six = _ModuleProxy('nibabel.externals.six') |
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.
As nibabel directly uses six everywhere now, this is just here to support 3rd party code that may still be using nibabels.external.six?
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.
@grlee77 - right - this clause is just in case someone is importing six from nibabel.externals .
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, though worth checking on io.*IO
.
@@ -19,7 +19,7 @@ | |||
|
|||
import numpy as np | |||
|
|||
from ..externals.six import BytesIO | |||
from six import BytesIO |
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.
Does io.BytesIO
not cover this?
nibabel/gifti/parse_gifti_fast.py
Outdated
@@ -12,7 +12,7 @@ | |||
import sys | |||
import warnings | |||
import zlib | |||
from ..externals.six import StringIO | |||
from six import StringIO |
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: from io import StringIO
works fine for me in both. Is there a difference I've missed?
nibabel/optpkg.py
Outdated
@@ -1,7 +1,7 @@ | |||
""" Routines to support optional packages """ | |||
from distutils.version import LooseVersion | |||
|
|||
from .externals.six import string_types, callable | |||
from six import string_types, callable |
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.
callable
's been back since 3.2.
Thanks for the review - made changes - OK to merge? |
Looks like callable edits didn't make it into your last commit? |
Use native versions rather using using versions from 'six'.
adf90a0
to
38d8235
Compare
Oops - thanks - added callable. |
e395f54
to
38d8235
Compare
Good to merge. |
Thanks for the review. |
We don't need OrderedDict copy now we don't support Python 2.6.
Depend on six package - it's very stable at this point, and pip works much
better than in the past.