Skip to content

Commit

Permalink
ci: run notebooks with pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed May 7, 2021
1 parent f0cbcaa commit 982aa21
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 44 deletions.
27 changes: 14 additions & 13 deletions .constraints/py3.6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ attrs==20.3.0
babel==2.9.1
backcall==0.2.0
beautifulsoup4==4.9.3
black==21.4b2
black==21.5b0
bleach==3.3.0
cachetools==4.2.2
certifi==2020.12.5
Expand All @@ -46,10 +46,10 @@ flake8-blind-except==0.2.0
flake8-bugbear==21.4.3
flake8-builtins==1.5.3
flake8-comprehensions==3.4.0
flake8-plugin-utils==1.3.1
flake8-plugin-utils==1.3.2
flake8-polyfill==1.0.2
flake8-pytest-style==1.4.1
flake8-rst-docstrings==0.2.2
flake8-rst-docstrings==0.2.3
flake8-use-fstring==1.1
flake8==3.9.1
flatbuffers==1.12
Expand All @@ -73,12 +73,12 @@ immutables==0.15
importlib-metadata==4.0.1
importlib-resources==3.0.0
iniconfig==1.1.1
ipykernel==5.5.3
ipykernel==5.5.4
ipython-genutils==0.2.0
ipython==7.16.1
ipywidgets==7.6.3
isort==5.8.0
jax==0.2.12
jax==0.2.13
jaxlib==0.1.65
jedi==0.18.0
jinja2==2.11.3
Expand All @@ -88,7 +88,7 @@ jupyter-cache==0.4.2
jupyter-client==6.1.12
jupyter-console==6.4.0
jupyter-core==4.7.1
jupyter-packaging==0.9.2
jupyter-packaging==0.10.1
jupyter-server-mathjax==0.2.2
jupyter-server==1.6.4
jupyter-sphinx==0.3.2
Expand Down Expand Up @@ -143,7 +143,7 @@ pluggy==0.13.1
pre-commit==2.12.1
prometheus-client==0.10.1
prompt-toolkit==3.0.18
protobuf==3.15.8
protobuf==3.16.0
ptyprocess==0.7.0
py==1.10.0
pyasn1-modules==0.2.8
Expand All @@ -153,16 +153,17 @@ pycparser==2.20
pydata-sphinx-theme==0.6.3
pydocstyle==6.0.0
pyflakes==2.3.1
pygments==2.8.1
pygments==2.9.0
pylint==2.8.2
pyparsing==2.4.7
pyrsistent==0.17.3
pytest-cov==2.11.1
pytest-forked==1.3.0
pytest-mock==3.6.0
pytest-mock==3.6.1
pytest-notebook==0.6.1
pytest-profiling==1.7.0
pytest-xdist==2.2.1
pytest==6.2.3
pytest==6.2.4
python-constraint==1.4.0
python-dateutil==2.8.1
pytz==2021.1
Expand Down Expand Up @@ -199,7 +200,7 @@ sphinxcontrib-serializinghtml==1.1.4
sphobjinv==2.1
sqlalchemy==1.3.24
sympy==1.8
tensorboard-data-server==0.6.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.0
tensorboard==2.5.0
tensorflow-estimator==2.4.0
Expand All @@ -211,13 +212,13 @@ testpath==0.4.4
toml==0.10.2
tomlkit==0.7.0
tornado==6.1
tox==3.23.0
tox==3.23.1
tqdm==4.60.0
traitlets==4.3.3
typed-ast==1.4.3
typing-extensions==3.7.4.3 ; python_version < "3.8.0"
urllib3==1.26.4
virtualenv==20.4.4
virtualenv==20.4.6
wcwidth==0.2.5
webencodings==0.5.1
werkzeug==1.0.1
Expand Down
30 changes: 16 additions & 14 deletions .constraints/py3.7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ attrs==20.3.0
babel==2.9.1
backcall==0.2.0
beautifulsoup4==4.9.3
black==21.4b2
black==21.5b0
bleach==3.3.0
cachetools==4.2.2
certifi==2020.12.5
Expand All @@ -44,10 +44,10 @@ flake8-blind-except==0.2.0
flake8-bugbear==21.4.3
flake8-builtins==1.5.3
flake8-comprehensions==3.4.0
flake8-plugin-utils==1.3.1
flake8-plugin-utils==1.3.2
flake8-polyfill==1.0.2
flake8-pytest-style==1.4.1
flake8-rst-docstrings==0.2.2
flake8-rst-docstrings==0.2.3
flake8-use-fstring==1.1
flake8==3.9.1
flatbuffers==1.12
Expand All @@ -68,13 +68,14 @@ idna==2.10
imagesize==1.2.0
iminuit==2.6.0
importlib-metadata==4.0.1
importlib-resources==5.1.2
iniconfig==1.1.1
ipykernel==5.5.3
ipykernel==5.5.4
ipython-genutils==0.2.0
ipython==7.23.0
ipython==7.23.1
ipywidgets==7.6.3
isort==5.8.0
jax==0.2.12
jax==0.2.13
jaxlib==0.1.65
jedi==0.18.0
jinja2==2.11.3
Expand All @@ -84,7 +85,7 @@ jupyter-cache==0.4.2
jupyter-client==6.1.12
jupyter-console==6.4.0
jupyter-core==4.7.1
jupyter-packaging==0.9.2
jupyter-packaging==0.10.1
jupyter-server-mathjax==0.2.2
jupyter-server==1.6.4
jupyter-sphinx==0.3.2
Expand Down Expand Up @@ -140,7 +141,7 @@ pluggy==0.13.1
pre-commit==2.12.1
prometheus-client==0.10.1
prompt-toolkit==3.0.18
protobuf==3.15.8
protobuf==3.16.0
ptyprocess==0.7.0
py==1.10.0
pyasn1-modules==0.2.8
Expand All @@ -150,16 +151,17 @@ pycparser==2.20
pydata-sphinx-theme==0.6.3
pydocstyle==6.0.0
pyflakes==2.3.1
pygments==2.8.1
pygments==2.9.0
pylint==2.8.2
pyparsing==2.4.7
pyrsistent==0.17.3
pytest-cov==2.11.1
pytest-forked==1.3.0
pytest-mock==3.6.0
pytest-mock==3.6.1
pytest-notebook==0.6.1
pytest-profiling==1.7.0
pytest-xdist==2.2.1
pytest==6.2.3
pytest==6.2.4
python-constraint==1.4.0
python-dateutil==2.8.1
pytz==2021.1
Expand Down Expand Up @@ -196,7 +198,7 @@ sphinxcontrib-serializinghtml==1.1.4
sphobjinv==2.1
sqlalchemy==1.3.24
sympy==1.8
tensorboard-data-server==0.6.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.0
tensorboard==2.5.0
tensorflow-estimator==2.4.0
Expand All @@ -208,13 +210,13 @@ testpath==0.4.4
toml==0.10.2
tomlkit==0.7.0
tornado==6.1
tox==3.23.0
tox==3.23.1
tqdm==4.60.0
traitlets==5.0.5
typed-ast==1.4.3
typing-extensions==3.7.4.3 ; python_version < "3.8.0"
urllib3==1.26.4
virtualenv==20.4.4
virtualenv==20.4.6
wcwidth==0.2.5
webencodings==0.5.1
werkzeug==1.0.1
Expand Down
30 changes: 16 additions & 14 deletions .constraints/py3.8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ attrs==20.3.0
babel==2.9.1
backcall==0.2.0
beautifulsoup4==4.9.3
black==21.4b2
black==21.5b0
bleach==3.3.0
cachetools==4.2.2
certifi==2020.12.5
Expand All @@ -44,10 +44,10 @@ flake8-blind-except==0.2.0
flake8-bugbear==21.4.3
flake8-builtins==1.5.3
flake8-comprehensions==3.4.0
flake8-plugin-utils==1.3.1
flake8-plugin-utils==1.3.2
flake8-polyfill==1.0.2
flake8-pytest-style==1.4.1
flake8-rst-docstrings==0.2.2
flake8-rst-docstrings==0.2.3
flake8-use-fstring==1.1
flake8==3.9.1
flatbuffers==1.12
Expand All @@ -68,13 +68,14 @@ idna==2.10
imagesize==1.2.0
iminuit==2.6.0
importlib-metadata==4.0.1
importlib-resources==5.1.2
iniconfig==1.1.1
ipykernel==5.5.3
ipykernel==5.5.4
ipython-genutils==0.2.0
ipython==7.23.0
ipython==7.23.1
ipywidgets==7.6.3
isort==5.8.0
jax==0.2.12
jax==0.2.13
jaxlib==0.1.65
jedi==0.18.0
jinja2==2.11.3
Expand All @@ -84,7 +85,7 @@ jupyter-cache==0.4.2
jupyter-client==6.1.12
jupyter-console==6.4.0
jupyter-core==4.7.1
jupyter-packaging==0.9.2
jupyter-packaging==0.10.1
jupyter-server-mathjax==0.2.2
jupyter-server==1.6.4
jupyter-sphinx==0.3.2
Expand Down Expand Up @@ -140,7 +141,7 @@ pluggy==0.13.1
pre-commit==2.12.1
prometheus-client==0.10.1
prompt-toolkit==3.0.18
protobuf==3.15.8
protobuf==3.16.0
ptyprocess==0.7.0
py==1.10.0
pyasn1-modules==0.2.8
Expand All @@ -150,16 +151,17 @@ pycparser==2.20
pydata-sphinx-theme==0.6.3
pydocstyle==6.0.0
pyflakes==2.3.1
pygments==2.8.1
pygments==2.9.0
pylint==2.8.2
pyparsing==2.4.7
pyrsistent==0.17.3
pytest-cov==2.11.1
pytest-forked==1.3.0
pytest-mock==3.6.0
pytest-mock==3.6.1
pytest-notebook==0.6.1
pytest-profiling==1.7.0
pytest-xdist==2.2.1
pytest==6.2.3
pytest==6.2.4
python-constraint==1.4.0
python-dateutil==2.8.1
pytz==2021.1
Expand Down Expand Up @@ -196,7 +198,7 @@ sphinxcontrib-serializinghtml==1.1.4
sphobjinv==2.1
sqlalchemy==1.3.24
sympy==1.8
tensorboard-data-server==0.6.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.0
tensorboard==2.5.0
tensorflow-estimator==2.4.0
Expand All @@ -208,13 +210,13 @@ testpath==0.4.4
toml==0.10.2
tomlkit==0.7.0
tornado==6.1
tox==3.23.0
tox==3.23.1
tqdm==4.60.0
traitlets==5.0.5
typed-ast==1.4.3
typing-extensions==3.7.4.3
urllib3==1.26.4
virtualenv==20.4.4
virtualenv==20.4.6
wcwidth==0.2.5
webencodings==0.5.1
werkzeug==1.0.1
Expand Down
2 changes: 0 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,4 @@ rst-directives =
deprecated,
envvar,
exception,
glue:figure,
glue:math,
seealso,
2 changes: 1 addition & 1 deletion pyrightconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"exclude": [".git", ".tox", "docs/_build"],
"include": ["docs/conf.py", "src", "tests"],
"include": ["docs", "src", "tests"],
"reportGeneralTypeIssues": false,
"reportUnboundVariable": false,
"reportUnusedClass": true,
Expand Down
8 changes: 8 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ addopts =
--doctest-continue-on-failure
--doctest-modules
--durations=3
--ignore=docs/abbreviate_signature.py
--ignore=docs/conf.py
filterwarnings =
ignore:.*Using or importing the ABCs.*:DeprecationWarning
ignore:.*the imp module is deprecated in favour of importlib.*:DeprecationWarning
nb_diff_ignore =
/cells/*/execution_count
/cells/*/outputs
/metadata/widgets
norecursedirs =
_build
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
testpaths =
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ doc =
%(all)s
jupyter
matplotlib
mdit-py-plugins < 0.2.7 # temporary fix
myst-nb >= 0.11 # myst_enable_extensions
pandas
Sphinx >= 3
Expand All @@ -86,6 +87,7 @@ test =
pytest
pytest-cov
pytest-mock >= 3.3.0
pytest-notebook
pytest-profiling
pytest-xdist
format =
Expand Down
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,13 @@ allowlist_externals =
commands =
mypy src tests # run separately because of potential caching problems
pre-commit run {posargs} -a

[testenv:testnb]
description =
Run all notebooks with pytest
allowlist_externals =
pytest
passenv =
EXECUTE_NB
commands =
pytest {posargs:docs} --nb-test-files

0 comments on commit 982aa21

Please sign in to comment.