-
Notifications
You must be signed in to change notification settings - Fork 257
Update for compatibility with IPython 5.0 #65
Conversation
Also tested with IPython 4.1.1. Replaces the depreciated ip.define_magic() method with ip.register_magics() and some modifications to handle the different API required.
The new magic decorators need ipython imported at a module level
|
Works for me on 5.0.0 -- thanks @caethan! |
|
Seem's that travis is not happy. |
dev_requirements.txt
Outdated
| @@ -1 +1,2 @@ | |||
| Cython | |||
| ipython | |||
| Cython --install-option='--no-cython-compile' | |||
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.
Travis don't like you pass the option like this. I don't know how to give it correctly.
I suggest that you let this file as it was before and add pip install ipython in .travis.yml.
|
@caethan Thanks for the solution. I've tell you how to change travis to pass the tests. |
|
@caethan Thanks for the solution. This works perfectly for me! |
|
Fixed the travis build. Thanks for the fixes, @tguillemot ! |
|
Thanks @caethan. It would be great to see this merged and released on PyPI soon. |
|
How does this compare to #68? |
|
@cancan101: Looks like #68 is a better approach - no need to include IPython as a specific dependency there. I'd use that one (assuming it works, haven't tested it myself). |
|
This does not work for me on IPython 5.1 & Jupyter NB 4.2.2: |
|
@esafak Sure looks like you're using the master branch without this bug fix. |
|
#68 is not a better fix - this is the fix. The way that magic functions are defined has changed and they are no longer passed a reference to |
|
Throwing in my support for this fix. I ran into this failure when updating the IPython section of my book (where I use |
|
@patricksnape: Thanks for checking #68! |
|
Is there anything preventing this from being merged? |
|
does not work for me on iPython 5.1 either:
|
|
@espg Have you tried installing the branch from this PR? That error message suggests you have the current version of line_profiler installed, which won't work on 5.0 or greater. |
|
What needs to be done to get this merged? Anything we can help with? |
|
@danielballan I ran: ~ ➤ pip3 install git+https://github.com/rkern/line_profiler.git Collecting git+https://github.com/rkern/line_profiler.git to install the branch... running ipython gives the errors in my other post. Note that this is on iPython 5.1.0 and python 3.5.2 |
|
@espg pip3 install --upgrade git+https://github.com/caethan/line_profiler |
|
@gforsyth no dice: ~ ➤ pip3 install --upgrade git+https://github.com/caethan/line_profiler IPython 5.1.0 -- An enhanced Interactive Python. |
|
Hey @espg -- it looks like |
|
@espg That error message ("no attribute 'define_magic') suggests that your I second @jakirkham's offer to help -- I'd be willing to do the release if that helps get this out the door and restore compatibility with IPython stable. |
|
Talked with @espg and found the problem: He had a custom extension that tried to load in the magic command using define_magic. Fixed it to use the new method. Apparently scikit-learn suggested this method in some of their documentation, so I should submit a pull request to fix it once this pull request gets merged. |
|
Possibly someone should ask @rkern for access to make new releases - or even maintain a fork, if Robert has gone awol. |
|
Talked to @rkern offline and he's going to transfer maintenance responsibility over to me, so we should be able to get this released properly before too long. |
|
Thanks @caethan :-) |
|
Merged in here - will announce on this thread once I get maintainer access to PyPi and 2.0 is released there. |
|
2.0 is released on PyPi with this fix. Enjoy and be merry! |
|
👍 this has bit me today and ended up here only to find the interwebs haven't caught up with this fix. |
|
thank you! |
Replaces the depreciated ip.define_magic() method with ip.register_magics() and some modifications to handle the different API required.
Also tested with IPython 4.1.1. I don't know how far back the ip.register_magics() method goes, so I'm not sure how far back it's compatible.
Edit: Apparently the new API was included as far back as 0.13, and the old API was finally removed in 5.0. So removing support for the old API entirely is pretty unlikely to cause problems.