Skip to content

Commit

Permalink
DX: define docnblive job in tox.ini (#510)
Browse files Browse the repository at this point in the history
* DX: activate VSCode multi-file diff editor
  https://code.visualstudio.com/updates/v1_85\#_multifile-diff-editor
* DX: run mypy over more libraries
  • Loading branch information
redeboer authored Dec 9, 2023
1 parent 5a9c686 commit f99a8ae
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 21 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
}
],
"livePreview.defaultPreviewPath": "docs/_build/html",
"multiDiffEditor.experimental.enabled": true,
"mypy-type-checker.args": ["--config-file=${workspaceFolder}/pyproject.toml"],
"mypy-type-checker.importStrategy": "fromEnvironment",
"notebook.gotoSymbols.showAllSymbols": true,
Expand Down
24 changes: 5 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ mypy = [
"tensorwaves[test-types]",
"types-PyYAML",
"types-requests",
"types-tensorflow",
"types-tqdm",
]
numba = [
"numba",
Expand Down Expand Up @@ -230,10 +232,6 @@ module = ["benchmarks.*", "tests.*"]
ignore_errors = true
module = ["typings.*"]

[[tool.mypy.overrides]]
ignore_missing_imports = true
module = ["IPython.*"]

[[tool.mypy.overrides]]
ignore_missing_imports = true
module = ["iminuit.*"]
Expand All @@ -244,27 +242,15 @@ module = ["numba.*"]

[[tool.mypy.overrides]]
ignore_missing_imports = true
module = ["numpy.*"]

[[tool.mypy.overrides]]
ignore_missing_imports = true
module = ["phasespace.*"]

[[tool.mypy.overrides]]
ignore_missing_imports = true
module = ["scipy.*"]

[[tool.mypy.overrides]]
ignore_missing_imports = true
module = ["sphinx.*"]
module = ["phasespace"]

[[tool.mypy.overrides]]
ignore_missing_imports = true
module = ["tensorflow.*"]
module = ["scipy.optimize"]

[[tool.mypy.overrides]]
ignore_missing_imports = true
module = ["tqdm.*"]
module = ["tensorflow.python.ops.numpy_ops"]

[tool.pyright]
exclude = [
Expand Down
32 changes: 32 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,38 @@ setenv =
EXECUTE_NB = yes
FORCE_COLOR = yes

[testenv:docnblive]
allowlist_externals =
sphinx-autobuild
commands =
sphinx-autobuild \
--open-browser \
--re-ignore .*/.ipynb_checkpoints/.* \
--re-ignore .*/__pycache__/.* \
--re-ignore docs/.*\.csv \
--re-ignore docs/.*\.gif \
--re-ignore docs/.*\.gv \
--re-ignore docs/.*\.inv \
--re-ignore docs/.*\.json \
--re-ignore docs/.*\.pickle \
--re-ignore docs/.*\.png \
--re-ignore docs/.*\.svg \
--re-ignore docs/.*\.yaml \
--re-ignore docs/.*\.yml \
--re-ignore docs/_build/.* \
--re-ignore docs/api/.* \
--re-ignore docs/usage/logs/.* \
--re-ignore docs/usage/sub_expr_f? \
--watch docs \
--watch src \
docs/ docs/_build/html
description =
Set up a server to directly preview changes to the HTML pages
passenv = *
setenv =
EXECUTE_NB = yes
FORCE_COLOR = yes

[testenv:jax]
allowlist_externals =
pytest
Expand Down
4 changes: 2 additions & 2 deletions typings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ external libraries. You can do this using
[`stubgen`](https://mypy.readthedocs.io/en/stable/stubgen.html). For instance:

```shell
stubgen -p tensorflow -o typings
stubgen -p sympy -o typings
```

Alternatively, use [Pyright](https://github.com/microsoft/pyright) to generate stub
files that contain docstrings as well:

```shell
pyright --createstub tensorflow
pyright --createstub sympy
```

0 comments on commit f99a8ae

Please sign in to comment.