From 2042215b1d75bf0a47ffa623cb7fc9429814ba1f 2014-10-11 08:53:02 From: Matthias Bussonnier Date: 2014-10-11 08:53:02 Subject: [PATCH] Fix version string comparison, capitalisation and typos. --- diff --git a/IPython/extensions/cythonmagic.py b/IPython/extensions/cythonmagic.py index f7500d4..f1ea6a4 100644 --- a/IPython/extensions/cythonmagic.py +++ b/IPython/extensions/cythonmagic.py @@ -3,7 +3,7 @@ The cython magic has been integrated into Cython itself, which is now released in version 0.21. -cf github `cython` organisation, `cython` repo, under the +cf github `Cython` organisation, `Cython` repo, under the file `Cython/Build/IpythonMagic.py` """ #----------------------------------------------------------------------------- @@ -16,6 +16,8 @@ file `Cython/Build/IpythonMagic.py` from __future__ import print_function +import IPython.utils.version as version + try: import Cython except: @@ -34,7 +36,7 @@ def load_ipython_extension(ip): print("""The Cython magic has been move to the Cython package, hence """) print("""`%load_ext cythonmagic` is deprecated; Please use `%load_ext Cython` instead.""") - if Cython is None or tuple(map(int,Cython.__version__.split('.'))) < (0,21) : + if Cython is None or not version.check_version(Cython.__version__, "0.21"): print("You need Cython version >=0.21 to use the Cython magic") return print("""\nThough, because I am nice, I'll still try to load it for you this time.""") diff --git a/docs/source/config/extensions/cythonmagic.rst b/docs/source/config/extensions/cythonmagic.rst index 6a522ea..fffecef 100644 --- a/docs/source/config/extensions/cythonmagic.rst +++ b/docs/source/config/extensions/cythonmagic.rst @@ -4,4 +4,4 @@ cythonmagic =========== -The `cython` magic has been moved in the `cython` package. +The `cython` magic has been moved in the `Cython` package. diff --git a/docs/source/whatsnew/pr/remove_cythonmagic.rst b/docs/source/whatsnew/pr/remove_cythonmagic.rst index c02904b..5f750fd 100644 --- a/docs/source/whatsnew/pr/remove_cythonmagic.rst +++ b/docs/source/whatsnew/pr/remove_cythonmagic.rst @@ -1 +1 @@ -* The ``%cython`` magic, is now part of the Cython module. Use `%load_ext Cython` with a version of Cython >= 0.21 to have acces to the magic now. +* The ``%cython`` magic, is now part of the Cython module. Use `%load_ext Cython` with a version of Cython >= 0.21 to have access to the magic now.