Skip to content

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

Merged
merged 3 commits into from
Feb 13, 2017

Conversation

matthew-brett
Copy link
Member

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.

Use function to read variables from `info.py` file into object, making
namespace clearer.
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.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0002%) to 96.008% when pulling 78c9b61 on matthew-brett:clean-dependencies into b8017c9 on nipy:master.

@matthew-brett matthew-brett changed the title WIP: removing some vendored dependencies MRG: removing some vendored dependencies Jan 26, 2017
@matthew-brett
Copy link
Member Author

This one now ready for review.

@codecov-io
Copy link

codecov-io commented Jan 26, 2017

Codecov Report

Merging #508 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            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
Impacted Files Coverage Δ
nibabel/py3k.py 33.33% <ø> (ø)
nibabel/data.py 86.99% <100%> (ø)
nibabel/tests/test_arrayproxy.py 100% <100%> (ø)
nibabel/tests/test_proxy_api.py 98.62% <100%> (ø)
nibabel/tests/test_analyze.py 99.13% <100%> (ø)
nibabel/tests/test_batteryrunners.py 81.39% <100%> (ø)
nibabel/tests/test_dft.py 93.93% <100%> (ø)
nibabel/tests/test_trackvis.py 96.32% <100%> (ø)
nibabel/tests/test_files_interface.py 97.05% <100%> (ø)
nibabel/freesurfer/io.py 93.86% <100%> (ø)
... and 30 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e08d25...38d8235. Read the comment docs.

from collections import OrderedDict

from ..deprecated import ModuleProxy as _ModuleProxy
six = _ModuleProxy('nibabel.externals.six')
Copy link
Contributor

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?

Copy link
Member Author

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 .

Copy link
Member

@effigies effigies left a 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
Copy link
Member

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?

@@ -12,7 +12,7 @@
import sys
import warnings
import zlib
from ..externals.six import StringIO
from six import StringIO
Copy link
Member

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?

@@ -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
Copy link
Member

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.

@matthew-brett
Copy link
Member Author

Thanks for the review - made changes - OK to merge?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0005%) to 96.008% when pulling adf90a0 on matthew-brett:clean-dependencies into b8017c9 on nipy:master.

@effigies
Copy link
Member

Looks like callable edits didn't make it into your last commit?

Use native versions rather using using versions from 'six'.
@matthew-brett
Copy link
Member Author

Oops - thanks - added callable.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0002%) to 96.008% when pulling 38d8235 on matthew-brett:clean-dependencies into 7e08d25 on nipy:master.

@effigies
Copy link
Member

Good to merge.

@matthew-brett matthew-brett merged commit 5d94c73 into nipy:master Feb 13, 2017
@matthew-brett matthew-brett deleted the clean-dependencies branch February 13, 2017 14:01
@matthew-brett
Copy link
Member Author

Thanks for the review.

@nibotmi nibotmi mentioned this pull request Feb 13, 2017
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants