##// END OF EJS Templates
Deprecate `IPython.utils.version`...
Nikita Kniazev -
Show More
@@ -31,7 +31,6 b' else:'
31 31 import os
32 32 import sys
33 33
34 from IPython.utils.version import check_version
35 34 from IPython.external.qt_loaders import (
36 35 load_qt,
37 36 loaded_api,
@@ -101,8 +100,8 b' def get_options():'
101 100
102 101 mpl = sys.modules.get('matplotlib', None)
103 102
104 if mpl is not None and not check_version(mpl.__version__, '1.0.2'):
105 #1.0.1 only supports PyQt4 v1
103 if mpl is not None and tuple(mpl.__version__.split(".")) < ("1", "0", "2"):
104 # 1.0.1 only supports PyQt4 v1
106 105 return [QT_API_PYQT_DEFAULT]
107 106
108 107 qt_api = os.environ.get('QT_API', None)
@@ -13,8 +13,6 b' import types'
13 13 from functools import partial, lru_cache
14 14 import operator
15 15
16 from IPython.utils.version import check_version
17
18 16 # ### Available APIs.
19 17 # Qt6
20 18 QT_API_PYQT6 = "pyqt6"
@@ -149,7 +147,8 b' def has_binding(api):'
149 147 if api == QT_API_PYSIDE:
150 148 # We can also safely check PySide version
151 149 import PySide
152 return check_version(PySide.__version__, '1.0.3')
150
151 return PySide.__version_info__ >= (1, 0, 3)
153 152
154 153 return True
155 154
@@ -211,7 +210,7 b' def import_pyqt4(version=2):'
211 210
212 211 from PyQt4 import QtGui, QtCore, QtSvg
213 212
214 if not check_version(QtCore.PYQT_VERSION_STR, '4.7'):
213 if QtCore.PYQT_VERSION < 0x040700:
215 214 raise ImportError("IPython requires PyQt4 >= 4.7, found %s" %
216 215 QtCore.PYQT_VERSION_STR)
217 216
@@ -12,15 +12,10 b' It is a bit ridiculous that we need these.'
12 12 # the file COPYING, distributed as part of this software.
13 13 #-----------------------------------------------------------------------------
14 14
15 #-----------------------------------------------------------------------------
16 # Imports
17 #-----------------------------------------------------------------------------
15 from warnings import warn
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 20 def check_version(v, check):
26 21 """check version string v >= check
@@ -29,6 +24,15 b' def check_version(v, check):'
29 24 it is assumed that the dependency is satisfied.
30 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 36 try:
33 37 return LooseVersion(v) >= LooseVersion(check)
34 38 except TypeError:
@@ -43,5 +43,6 b' addopts = --durations=10'
43 43 --ignore=IPython/utils/log.py
44 44 --ignore=IPython/utils/signatures.py
45 45 --ignore=IPython/utils/traitlets.py
46 --ignore=IPython/utils/version.py
46 47 doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS
47 48 ipdoctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS
General Comments 0
You need to be logged in to leave comments. Login now