Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pinning numpy, pytest, widget_code_input versions and drop notebook 7 tests #46

Merged
merged 5 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading