Skip to content

Commit f99a8ae

Browse files
authored
DX: define docnblive job in tox.ini (#510)
* DX: activate VSCode multi-file diff editor https://code.visualstudio.com/updates/v1_85\#_multifile-diff-editor * DX: run mypy over more libraries
1 parent 5a9c686 commit f99a8ae

File tree

4 files changed

+40
-21
lines changed

4 files changed

+40
-21
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
}
5454
],
5555
"livePreview.defaultPreviewPath": "docs/_build/html",
56+
"multiDiffEditor.experimental.enabled": true,
5657
"mypy-type-checker.args": ["--config-file=${workspaceFolder}/pyproject.toml"],
5758
"mypy-type-checker.importStrategy": "fromEnvironment",
5859
"notebook.gotoSymbols.showAllSymbols": true,

pyproject.toml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ mypy = [
115115
"tensorwaves[test-types]",
116116
"types-PyYAML",
117117
"types-requests",
118+
"types-tensorflow",
119+
"types-tqdm",
118120
]
119121
numba = [
120122
"numba",
@@ -230,10 +232,6 @@ module = ["benchmarks.*", "tests.*"]
230232
ignore_errors = true
231233
module = ["typings.*"]
232234

233-
[[tool.mypy.overrides]]
234-
ignore_missing_imports = true
235-
module = ["IPython.*"]
236-
237235
[[tool.mypy.overrides]]
238236
ignore_missing_imports = true
239237
module = ["iminuit.*"]
@@ -244,27 +242,15 @@ module = ["numba.*"]
244242

245243
[[tool.mypy.overrides]]
246244
ignore_missing_imports = true
247-
module = ["numpy.*"]
248-
249-
[[tool.mypy.overrides]]
250-
ignore_missing_imports = true
251-
module = ["phasespace.*"]
252-
253-
[[tool.mypy.overrides]]
254-
ignore_missing_imports = true
255-
module = ["scipy.*"]
256-
257-
[[tool.mypy.overrides]]
258-
ignore_missing_imports = true
259-
module = ["sphinx.*"]
245+
module = ["phasespace"]
260246

261247
[[tool.mypy.overrides]]
262248
ignore_missing_imports = true
263-
module = ["tensorflow.*"]
249+
module = ["scipy.optimize"]
264250

265251
[[tool.mypy.overrides]]
266252
ignore_missing_imports = true
267-
module = ["tqdm.*"]
253+
module = ["tensorflow.python.ops.numpy_ops"]
268254

269255
[tool.pyright]
270256
exclude = [

tox.ini

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,38 @@ setenv =
106106
EXECUTE_NB = yes
107107
FORCE_COLOR = yes
108108

109+
[testenv:docnblive]
110+
allowlist_externals =
111+
sphinx-autobuild
112+
commands =
113+
sphinx-autobuild \
114+
--open-browser \
115+
--re-ignore .*/.ipynb_checkpoints/.* \
116+
--re-ignore .*/__pycache__/.* \
117+
--re-ignore docs/.*\.csv \
118+
--re-ignore docs/.*\.gif \
119+
--re-ignore docs/.*\.gv \
120+
--re-ignore docs/.*\.inv \
121+
--re-ignore docs/.*\.json \
122+
--re-ignore docs/.*\.pickle \
123+
--re-ignore docs/.*\.png \
124+
--re-ignore docs/.*\.svg \
125+
--re-ignore docs/.*\.yaml \
126+
--re-ignore docs/.*\.yml \
127+
--re-ignore docs/_build/.* \
128+
--re-ignore docs/api/.* \
129+
--re-ignore docs/usage/logs/.* \
130+
--re-ignore docs/usage/sub_expr_f? \
131+
--watch docs \
132+
--watch src \
133+
docs/ docs/_build/html
134+
description =
135+
Set up a server to directly preview changes to the HTML pages
136+
passenv = *
137+
setenv =
138+
EXECUTE_NB = yes
139+
FORCE_COLOR = yes
140+
109141
[testenv:jax]
110142
allowlist_externals =
111143
pytest

typings/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ external libraries. You can do this using
66
[`stubgen`](https://mypy.readthedocs.io/en/stable/stubgen.html). For instance:
77

88
```shell
9-
stubgen -p tensorflow -o typings
9+
stubgen -p sympy -o typings
1010
```
1111

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

1515
```shell
16-
pyright --createstub tensorflow
16+
pyright --createstub sympy
1717
```

0 commit comments

Comments
 (0)