papermill
/
tox.ini
68 строк · 2.1 Кб
1[tox]
2skipsdist = true
3envlist = py{38,39,310,311,312}, dist, manifest, docs, binder
4
5[gh-actions]
6python =
73.8: py38
83.9: py39
93.10: py310
103.11: py311, docs
113.12: py312, dist
12
13# Manifest
14[testenv:manifest]
15skip_install = true
16deps = check-manifest
17commands = check-manifest
18ignore =
19.readthedocs.yaml
20
21# Docs
22[testenv:docs]
23description = invoke sphinx-build to build the HTML docs
24deps =
25.[docs]
26extras = docs
27commands =
28sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs}
29python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
30
31# Binder
32[testenv:binder]
33description = ensure /binder/*ipynb are runnable
34deps =
35-r binder/requirements.txt
36commands = python -c "import glob; import papermill as pm; [pm.execute_notebook(input, '{toxworkdir}/out.ipynb', parameters=\{'binder_dir':'binder'\}) for input in glob.glob('binder/**/*.ipynb')]"
37
38# Distro
39[testenv:dist]
40skip_install = true
41commands =
42python setup.py sdist --dist-dir={distdir} bdist_wheel --dist-dir={distdir}
43/bin/bash -c 'python -m pip install -U --force-reinstall {distdir}/papermill*.tar.gz'
44/bin/bash -c 'python -m pip install -U --force-reinstall {distdir}/papermill*.whl'
45
46[testenv]
47# disable Python's hash randomization for tests that stringify dicts, etc
48setenv =
49PYTHONHASHSEED = 0
50AWS_ACCESS_KEY_ID=foobar_key
51AWS_SECRET_ACCESS_KEY=foobar_secret
52passenv = *
53basepython =
54py38: python3.8
55py39: python3.9
56py310: python3.10
57py311: python3.11
58py312: python3.12
59manifest: python3.11
60dist: python3.12
61docs: python3.11
62binder: python3.11
63deps = .[dev]
64# Have to use /bin/bash or the `*` will cause that argument to get quoted by the tox command line...
65allowlist_externals = /bin/bash
66# Python 3.12 breaks default pip/setuptools versions ... force an upgrade of these before anything else
67install_command = /bin/bash ./tox_py_installer.sh {opts} {packages}
68commands = pytest -v --maxfail=2 --cov=papermill -W always {posargs}
69