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

Use importlib instead of __import__ #471

Merged
merged 7 commits into from Dec 10, 2014

Conversation

Projects
None yet
4 participants
@stefanv
Contributor

stefanv commented Nov 21, 2014

Without this change, bad things happen on my system when running optional_package('sklearn.linear_model') (sklearn fails to import from ..externals, and then it looks like sklearn is not installed on my system).

/cc @matthew-brett @arokem

@stefanv stefanv referenced this pull request Nov 21, 2014

Merged

Sparse Fascicle Model #460

@@ -1,5 +1,7 @@
""" Routines to support optional packages """
import importlib

This comment has been minimized.

@matthew-brett

matthew-brett Nov 21, 2014

Member

Not present for Python 2.6?

This comment has been minimized.

@stefanv

stefanv Nov 21, 2014

Contributor

https://pypi.python.org/pypi/importlib/1.0.1

Should we include that as a fallback?

This comment has been minimized.

@matthew-brett

matthew-brett Nov 21, 2014

Member

Could do. Or drop Python 2.6 support.

This comment has been minimized.

@arokem

arokem Nov 25, 2014

Member

I suggest to include the backport for the time being. It's quite small: two
functions with a total of less than 40 lines of code.

On Thu, Nov 20, 2014 at 6:15 PM, Matthew Brett notifications@github.com
wrote:

In dipy/utils/optpkg.py:

@@ -1,5 +1,7 @@
""" Routines to support optional packages """

+import importlib

Could do. Or drop Python 2.6 support.


Reply to this email directly or view it on GitHub
https://github.com/nipy/dipy/pull/471/files#r20693629.

@stefanv stefanv force-pushed the stefanv:importlib branch from fe9eb72 to 6497623 Dec 3, 2014

arokem and others added some commits Dec 3, 2014

@Garyfallidis

This comment has been minimized.

Member

Garyfallidis commented Dec 8, 2014

What about this one? Needs more care!

@arokem

This comment has been minimized.

Member

arokem commented Dec 10, 2014

OK - should be fixed here: stefanv#2

@arokem

This comment has been minimized.

Member

arokem commented Dec 10, 2014

How about now, @Garyfallidis?

Garyfallidis added a commit that referenced this pull request Dec 10, 2014

Merge pull request #471 from stefanv/importlib
Use importlib instead of __import__

@Garyfallidis Garyfallidis merged commit 99e8f52 into nipy:master Dec 10, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment