Commit 99a593e0 authored by Martín Gaitán's avatar Martín Gaitán

Moved ipython entry point to cython package

`load_entry_point()` is on Cython/__init__.py,
so::   %load_ext Cython is all you need to load the magic.
parent 52610840
...@@ -297,7 +297,7 @@ class CythonMagics(Magics): ...@@ -297,7 +297,7 @@ class CythonMagics(Magics):
def _clear_distutils_mkpath_cache(self): def _clear_distutils_mkpath_cache(self):
"""clear distutils mkpath cache """clear distutils mkpath cache
prevents distutils from skipping re-creation of dirs that have been removed prevents distutils from skipping re-creation of dirs that have been removed
""" """
try: try:
...@@ -306,7 +306,7 @@ class CythonMagics(Magics): ...@@ -306,7 +306,7 @@ class CythonMagics(Magics):
pass pass
else: else:
_path_created.clear() _path_created.clear()
def _get_build_extension(self): def _get_build_extension(self):
self._clear_distutils_mkpath_cache() self._clear_distutils_mkpath_cache()
dist = Distribution() dist = Distribution()
...@@ -339,7 +339,3 @@ __doc__ = __doc__.format( ...@@ -339,7 +339,3 @@ __doc__ = __doc__.format(
CYTHON_INLINE_DOC = dedent(CythonMagics.cython_inline.__doc__), CYTHON_INLINE_DOC = dedent(CythonMagics.cython_inline.__doc__),
CYTHON_PYXIMPORT_DOC = dedent(CythonMagics.cython_pyximport.__doc__), CYTHON_PYXIMPORT_DOC = dedent(CythonMagics.cython_pyximport.__doc__),
) )
def load_ipython_extension(ip):
"""Load the extension in IPython."""
ip.register_magics(CythonMagics)
...@@ -2,3 +2,9 @@ from Cython.Shadow import __version__ ...@@ -2,3 +2,9 @@ from Cython.Shadow import __version__
# Void cython.* directives (for case insensitive operating systems). # Void cython.* directives (for case insensitive operating systems).
from Cython.Shadow import * from Cython.Shadow import *
def load_ipython_extension(ip):
"""Load the extension in IPython."""
from Cython.Build.IpythonMagic import CythonMagics
ip.register_magics(CythonMagics)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment