forked from jupyter/nbclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
86 lines (77 loc) · 2.73 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
[tox]
skipsdist = true
envlist = py{36,37,38, 39}, flake8, mypy, dist-{win, linux}, manifest, docs
# requires =
# tox-factor
[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39, flake8, mypy, dist-{win, linux}, manifest
# Linters
[testenv:flake8]
skip_install = true
deps = flake8
commands = flake8 nbclient --count --ignore=E203,E731,F811,W503 --max-complexity=23 --max-line-length=100 --show-source --statistics
# Type check
[testenv:mypy]
skip_install = true
deps = mypy
commands = mypy nbclient/client.py nbclient/exceptions.py nbclient/__init__.py nbclient/jsonutil.py nbclient/output_widget.py nbclient/util.py nbclient/_version.py
# Manifest
[testenv:manifest]
skip_install = true
deps = check-manifest
commands = check-manifest
# Docs
[testenv:docs]
description = invoke sphinx-build to build the HTML docs
deps =
.[dev]
-r docs/requirements-doc.txt
extras = docs
commands =
sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs}
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
# Distro
[testenv:dist-{win, linux}]
skip_install = true
platform =
win: win|msys
linux: linux|darwin
allowlist_externals =
win: powershell
linux: bash
commands =
python setup.py sdist --dist-dir={distdir} bdist_wheel --dist-dir={distdir}
win: powershell Get-ChildItem -Path {distdir} -Filter nbclient*.whl | foreach \{python -m pip install -U --force-reinstall $_.FullName\}
win: powershell Get-ChildItem -Path {distdir} -Filter nbclient*.tar.gz | foreach \{python -m pip install -U --force-reinstall --no-deps $_.FullName\}
# Have to use /bin/bash or the `*` will cause that argument to get quoted by the tox command line...
linux: bash -c 'python -m pip install -U --force-reinstall {distdir}/nbclient*.whl'
linux: bash -c 'python -m pip install -U --force-reinstall --no-deps {distdir}/nbclient*.tar.gz'
[testenv]
# disable Python's hash randomization for tests that stringify dicts, etc
setenv =
PYTHONHASHSEED = 0
passenv = *
basepython =
py36: python3.6
py37: python3.7
py38: python3.8
py39: python3.9
flake8: python3.9
mypy: python3.9
manifest: python3.9
binder: python3.9
dist: python3.9
docs: python3.9
deps = .[dev]
commands =
pytest -vv --maxfail=2 --cov=nbclient --cov-report=xml -W always {posargs}
# Binder
[testenv:binder]
description = ensure /binder/*ipynb are runnable
deps =
-r binder/requirements.txt
commands = python -c "from glob import glob; from nbclient import execute; import nbformat as nbf; [execute(nbf.read(input, nbf.NO_CONVERT), cwd='./binder') for input in glob('binder/**/*.ipynb')]"