##// END OF EJS Templates
Merge pull request #13293 from Kojoley/deprecate-utils.version...
Matthias Bussonnier -
r27091:8cb2309f merge
parent child Browse files
Show More
@@ -31,7 +31,6 b' else:'
31 import os
31 import os
32 import sys
32 import sys
33
33
34 from IPython.utils.version import check_version
35 from IPython.external.qt_loaders import (
34 from IPython.external.qt_loaders import (
36 load_qt,
35 load_qt,
37 loaded_api,
36 loaded_api,
@@ -101,8 +100,8 b' def get_options():'
101
100
102 mpl = sys.modules.get('matplotlib', None)
101 mpl = sys.modules.get('matplotlib', None)
103
102
104 if mpl is not None and not check_version(mpl.__version__, '1.0.2'):
103 if mpl is not None and tuple(mpl.__version__.split(".")) < ("1", "0", "2"):
105 #1.0.1 only supports PyQt4 v1
104 # 1.0.1 only supports PyQt4 v1
106 return [QT_API_PYQT_DEFAULT]
105 return [QT_API_PYQT_DEFAULT]
107
106
108 qt_api = os.environ.get('QT_API', None)
107 qt_api = os.environ.get('QT_API', None)
@@ -14,8 +14,6 b' import types'
14 from functools import partial, lru_cache
14 from functools import partial, lru_cache
15 import operator
15 import operator
16
16
17 from IPython.utils.version import check_version
18
19 # ### Available APIs.
17 # ### Available APIs.
20 # Qt6
18 # Qt6
21 QT_API_PYQT6 = "pyqt6"
19 QT_API_PYQT6 = "pyqt6"
@@ -148,7 +146,8 b' def has_binding(api):'
148 if api == QT_API_PYSIDE:
146 if api == QT_API_PYSIDE:
149 # We can also safely check PySide version
147 # We can also safely check PySide version
150 import PySide
148 import PySide
151 return check_version(PySide.__version__, '1.0.3')
149
150 return PySide.__version_info__ >= (1, 0, 3)
152
151
153 return True
152 return True
154
153
@@ -210,7 +209,7 b' def import_pyqt4(version=2):'
210
209
211 from PyQt4 import QtGui, QtCore, QtSvg
210 from PyQt4 import QtGui, QtCore, QtSvg
212
211
213 if not check_version(QtCore.PYQT_VERSION_STR, '4.7'):
212 if QtCore.PYQT_VERSION < 0x040700:
214 raise ImportError("IPython requires PyQt4 >= 4.7, found %s" %
213 raise ImportError("IPython requires PyQt4 >= 4.7, found %s" %
215 QtCore.PYQT_VERSION_STR)
214 QtCore.PYQT_VERSION_STR)
216
215
@@ -12,15 +12,10 b' It is a bit ridiculous that we need these.'
12 # the file COPYING, distributed as part of this software.
12 # the file COPYING, distributed as part of this software.
13 #-----------------------------------------------------------------------------
13 #-----------------------------------------------------------------------------
14
14
15 #-----------------------------------------------------------------------------
15 from warnings import warn
16 # Imports
17 #-----------------------------------------------------------------------------
18
16
19 from distutils.version import LooseVersion
17 warn("The `IPython.utils.version` module has been deprecated since IPython 8.0.")
20
18
21 #-----------------------------------------------------------------------------
22 # Code
23 #-----------------------------------------------------------------------------
24
19
25 def check_version(v, check):
20 def check_version(v, check):
26 """check version string v >= check
21 """check version string v >= check
@@ -29,6 +24,15 b' def check_version(v, check):'
29 it is assumed that the dependency is satisfied.
24 it is assumed that the dependency is satisfied.
30 Users on dev branches are responsible for keeping their own packages up to date.
25 Users on dev branches are responsible for keeping their own packages up to date.
31 """
26 """
27 warn(
28 "`check_version` function is deprecated as of IPython 8.0"
29 "and will be removed in future versions.",
30 DeprecationWarning,
31 stacklevel=2,
32 )
33
34 from distutils.version import LooseVersion
35
32 try:
36 try:
33 return LooseVersion(v) >= LooseVersion(check)
37 return LooseVersion(v) >= LooseVersion(check)
34 except TypeError:
38 except TypeError:
@@ -43,5 +43,6 b' addopts = --durations=10'
43 --ignore=IPython/utils/log.py
43 --ignore=IPython/utils/log.py
44 --ignore=IPython/utils/signatures.py
44 --ignore=IPython/utils/signatures.py
45 --ignore=IPython/utils/traitlets.py
45 --ignore=IPython/utils/traitlets.py
46 --ignore=IPython/utils/version.py
46 doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS
47 doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS
47 ipdoctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS
48 ipdoctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS
General Comments 0
You need to be logged in to leave comments. Login now