Skip to content

Commit

Permalink
Pinning numpy, pytest, widget_code_input versions and drop notebook 7…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
agoscinski committed Jul 2, 2024
2 parents f98d5a1 + 72d4d47 commit 989f7c1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 81 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/tests-notebook-7.yml

This file was deleted.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ classifiers = [
]
dependencies = [
"ipywidgets>=8.0.0",
"numpy",
"widget_code_input",
"numpy<2.0.0",
"widget_code_input<4.0.0",
"matplotlib",
"termcolor"
]
Expand Down
6 changes: 3 additions & 3 deletions src/scwidgets/check/_widget_check_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ def check_widget(self, widget: CheckableWidget) -> Union[ChecksResult, Exception
def check_all_widgets(
self,
) -> OrderedDict[CheckableWidget, Union[ChecksResult, Exception]]:
messages: OrderedDict[
CheckableWidget, Union[ChecksResult, Exception]
] = OrderedDict()
messages: OrderedDict[CheckableWidget, Union[ChecksResult, Exception]] = (
OrderedDict()
)
for widget in self._checks.keys():
try:
messages[widget] = self.check_widget(widget)
Expand Down
8 changes: 5 additions & 3 deletions src/scwidgets/exercise/_widget_code_exercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,11 @@ def __init__(
def answer(self) -> dict:
return {
"code": None if self._code is None else self._code.function_body,
"parameter_panel": None
if self._parameter_panel is None
else self._parameter_panel.parameters,
"parameter_panel": (
None
if self._parameter_panel is None
else self._parameter_panel.parameters
),
}

@answer.setter
Expand Down
38 changes: 3 additions & 35 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,6 @@ envlist =

[testenv]

[testenv:tests-notebook-7]
description =
Tests with jupyter notebook version > 7
setenv =
# this is needed to run selenium on a machine without display to do CI
SELENIUM_FIREFOX_DRIVER_ARGS = {env:SELENIUM_FIREFOX_DRIVER_ARGS:--headless}
JUPYTER_TYPE = notebook
# use the jupyter config in the tox environment
# otherwise the users config is used
JUPYTER_CONFIG_DIR={envdir}/etc/jupyter
JUPYTER_DATA_DIR={envdir}/share/jupyter
deps =
pytest
pytest-html<4.0.0,
# selenium juypter notebook tests
notebook==7.0.2
# fixing selenium version to have backwards-compatibility with pytest-selenium
# see https://github.com/robotframework/SeleniumLibrary/issues/1835#issuecomment-1581426365
selenium==4.9.0
pytest-selenium
jupytext==1.15.0
imageio
# we fix matplotlib for consistent image tests
matplotlib==3.7.2
numpy
scikit-image
ipympl
commands =
# converts the python files to ipython notebooks
jupytext tests/notebooks/*.py --to ipynb
pytest {posargs:-v} --driver Firefox

[testenv:tests-lab-3]
description =
Tests with jupyter lab version < 4
Expand All @@ -55,7 +23,7 @@ setenv =
JUPYTER_CONFIG_DIR={envdir}/etc/jupyter
JUPYTER_DATA_DIR={envdir}/share/jupyter
deps =
pytest
pytest<8.0.0
pytest-html<4.0.0,
# selenium juypter notebook tests
jupyterlab==3.6.5
Expand All @@ -67,7 +35,7 @@ deps =
imageio
# we fix matplotlib for consistent image tests
matplotlib==3.7.2
numpy
numpy<2.0.0
scikit-image
ipympl
commands =
Expand All @@ -80,7 +48,7 @@ commands =
# includes the jupytext notebook files, because coverage is incompatible with
# selenium
deps =
pytest
pytest<8.0.0
pytest-cov
coverage[toml]
selenium==4.9.0
Expand Down

0 comments on commit 989f7c1

Please sign in to comment.