Skip to content

Commit 989f7c1

Browse files
committed
Pinning numpy, pytest, widget_code_input versions and drop notebook 7 tests (PR #46)
Since the last PR has been 6 months ago the rolling versions caused the tests to fail, we upper bound the versions of several packages to fix these issues. For some yet unknown reasons notebook 7 shows behaviors that are unfeasible to fix, therefore the tests are dropped till these issues have been fixed.
2 parents f98d5a1 + 72d4d47 commit 989f7c1

File tree

5 files changed

+13
-81
lines changed

5 files changed

+13
-81
lines changed

Diff for: .github/workflows/tests-notebook-7.yml

-38
This file was deleted.

Diff for: pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ classifiers = [
2929
]
3030
dependencies = [
3131
"ipywidgets>=8.0.0",
32-
"numpy",
33-
"widget_code_input",
32+
"numpy<2.0.0",
33+
"widget_code_input<4.0.0",
3434
"matplotlib",
3535
"termcolor"
3636
]

Diff for: src/scwidgets/check/_widget_check_registry.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ def check_widget(self, widget: CheckableWidget) -> Union[ChecksResult, Exception
250250
def check_all_widgets(
251251
self,
252252
) -> OrderedDict[CheckableWidget, Union[ChecksResult, Exception]]:
253-
messages: OrderedDict[
254-
CheckableWidget, Union[ChecksResult, Exception]
255-
] = OrderedDict()
253+
messages: OrderedDict[CheckableWidget, Union[ChecksResult, Exception]] = (
254+
OrderedDict()
255+
)
256256
for widget in self._checks.keys():
257257
try:
258258
messages[widget] = self.check_widget(widget)

Diff for: src/scwidgets/exercise/_widget_code_exercise.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,11 @@ def __init__(
445445
def answer(self) -> dict:
446446
return {
447447
"code": None if self._code is None else self._code.function_body,
448-
"parameter_panel": None
449-
if self._parameter_panel is None
450-
else self._parameter_panel.parameters,
448+
"parameter_panel": (
449+
None
450+
if self._parameter_panel is None
451+
else self._parameter_panel.parameters
452+
),
451453
}
452454

453455
@answer.setter

Diff for: tox.ini

+3-35
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,6 @@ envlist =
1111

1212
[testenv]
1313

14-
[testenv:tests-notebook-7]
15-
description =
16-
Tests with jupyter notebook version > 7
17-
setenv =
18-
# this is needed to run selenium on a machine without display to do CI
19-
SELENIUM_FIREFOX_DRIVER_ARGS = {env:SELENIUM_FIREFOX_DRIVER_ARGS:--headless}
20-
JUPYTER_TYPE = notebook
21-
# use the jupyter config in the tox environment
22-
# otherwise the users config is used
23-
JUPYTER_CONFIG_DIR={envdir}/etc/jupyter
24-
JUPYTER_DATA_DIR={envdir}/share/jupyter
25-
deps =
26-
pytest
27-
pytest-html<4.0.0,
28-
# selenium juypter notebook tests
29-
notebook==7.0.2
30-
# fixing selenium version to have backwards-compatibility with pytest-selenium
31-
# see https://github.com/robotframework/SeleniumLibrary/issues/1835#issuecomment-1581426365
32-
selenium==4.9.0
33-
pytest-selenium
34-
jupytext==1.15.0
35-
imageio
36-
# we fix matplotlib for consistent image tests
37-
matplotlib==3.7.2
38-
numpy
39-
scikit-image
40-
ipympl
41-
commands =
42-
# converts the python files to ipython notebooks
43-
jupytext tests/notebooks/*.py --to ipynb
44-
pytest {posargs:-v} --driver Firefox
45-
4614
[testenv:tests-lab-3]
4715
description =
4816
Tests with jupyter lab version < 4
@@ -55,7 +23,7 @@ setenv =
5523
JUPYTER_CONFIG_DIR={envdir}/etc/jupyter
5624
JUPYTER_DATA_DIR={envdir}/share/jupyter
5725
deps =
58-
pytest
26+
pytest<8.0.0
5927
pytest-html<4.0.0,
6028
# selenium juypter notebook tests
6129
jupyterlab==3.6.5
@@ -67,7 +35,7 @@ deps =
6735
imageio
6836
# we fix matplotlib for consistent image tests
6937
matplotlib==3.7.2
70-
numpy
38+
numpy<2.0.0
7139
scikit-image
7240
ipympl
7341
commands =
@@ -80,7 +48,7 @@ commands =
8048
# includes the jupytext notebook files, because coverage is incompatible with
8149
# selenium
8250
deps =
83-
pytest
51+
pytest<8.0.0
8452
pytest-cov
8553
coverage[toml]
8654
selenium==4.9.0

0 commit comments

Comments
 (0)