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

DX: define docnblive job in tox.ini #510

Merged
merged 3 commits into from
Dec 9, 2023
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
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
```
Loading