Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 872d18e

Browse files
authored
Change ipywidgets version check to use __version__. Fixes #1571. (#1573)
* Change ipywidgets version check to use __version__ instead of version_info. Fixes Issue #1571. * Update CI images. * Improve version handling (thanks @apayne97).
1 parent 00df5db commit 872d18e

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

devtools/azure-pipelines-linux.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
jobs:
22
- job: 'Linux'
33
pool:
4-
vmImage: 'Ubuntu-18.04'
4+
vmImage: 'ubuntu-22.04'
55
timeoutInMinutes: 360
66

77
strategy:
88
matrix:
9-
Python37:
10-
CONDA_PY: '3.7'
11-
CONDA_NPY: '1.18'
129
Python38:
1310
CONDA_PY: '3.8'
1411
CONDA_NPY: '1.18'
1512
Python39:
1613
CONDA_PY: '3.9'
1714
CONDA_NPY: '1.19'
15+
Python310:
16+
CONDA_PY: '3.10'
17+
CONDA_NPY: '1.21'
1818

1919
maxParallel: 10
2020

devtools/azure-pipelines-osx.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ jobs:
22
- job:
33
displayName: "OS X"
44
pool:
5-
vmImage: 'macOS-10.15'
5+
vmImage: 'macOS-11'
66
strategy:
77
matrix:
8-
Python37:
9-
CONDA_PY: '3.7'
10-
CONDA_NPY: '1.18'
118
Python38:
129
CONDA_PY: '3.8'
1310
CONDA_NPY: '1.18'
1411
Python39:
1512
CONDA_PY: '3.9'
1613
CONDA_NPY: '1.19'
14+
Python310:
15+
CONDA_PY: '3.10'
16+
CONDA_NPY: '1.21'
1717

1818
steps:
1919
- template: checkout.yml

devtools/azure-pipelines-win.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ jobs:
55
vmImage: "windows-2019"
66
strategy:
77
matrix:
8-
Python37:
9-
CONDA_PY: '3.7'
10-
CONDA_NPY: '1.18'
118
Python38:
129
CONDA_PY: '3.8'
1310
CONDA_NPY: '1.18'
1411
Python39:
1512
CONDA_PY: '3.9'
1613
CONDA_NPY: '1.19'
14+
Python310:
15+
CONDA_PY: '3.10'
16+
CONDA_NPY: '1.21'
1717

1818
steps:
1919
- template: checkout.yml

pyemma/_base/progress/reporter/__init__.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from numbers import Integral
2+
from typing import Optional
23

34

45
def _simple_memorize(f):
@@ -12,12 +13,23 @@ def wrapper():
1213
return wrapper
1314

1415

16+
def _ipywidgets_major_version() -> Optional[int]:
17+
r""" Determine ipywidgets major version if possible, otherwise return None. """
18+
import ipywidgets
19+
if hasattr(ipywidgets, '__version__'):
20+
return int(ipywidgets.__version__.split('.')[0])
21+
elif hasattr(ipywidgets, 'version_info'):
22+
return ipywidgets.version_info[0]
23+
else:
24+
return None
25+
26+
1527
@_simple_memorize
1628
def _attached_to_ipy_notebook_with_widgets():
1729
try:
1830
# check for widgets
19-
import ipywidgets
20-
if ipywidgets.version_info[0] < 4:
31+
version = _ipywidgets_major_version()
32+
if version is None or version < 4:
2133
raise ImportError()
2234
# check for ipython kernel
2335
from IPython import get_ipython

0 commit comments

Comments
 (0)