@@ -152,9 +152,13 @@ version.source = "vcs"
152152build.hooks.vcs.version-file = " papermill/version.py"
153153
154154[tool .hatch .build .targets .sdist ]
155+ ignore-vcs = true
155156include = [
156157 " /papermill" ,
157158]
159+ exclude = [
160+ " binder/*" ,
161+ ]
158162
159163
160164[tool .black ]
@@ -228,3 +232,72 @@ format.quote-style = "preserve"
228232[tool .ruff .lint .pydocstyle ]
229233# Use Google-style docstrings.
230234convention = " google"
235+
236+ [tool .tox ]
237+ legacy_tox_ini = """
238+ [tox]
239+ skipsdist = true
240+ envlist = py{310,311,312,313}, dist, manifest, docs, binder
241+
242+ [gh-actions]
243+ python =
244+ 3.10: py310
245+ 3.11: py311
246+ 3.12: py312
247+ 3.13: py313, docs, dist
248+
249+ # Manifest
250+ [testenv:manifest]
251+ skip_install = true
252+ deps = check-manifest
253+ commands = check-manifest
254+ ignore =
255+ .readthedocs.yaml
256+
257+ # Docs
258+ [testenv:docs]
259+ description = invoke sphinx-build to build the HTML docs
260+ deps =
261+ .[docs]
262+ extras = docs
263+ commands =
264+ sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs}
265+ python -c 'import pathlib; print("documentation available under file://\\ {0\\ }".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
266+
267+ # Binder
268+ [testenv:binder]
269+ description = ensure /binder/*ipynb are runnable
270+ deps =
271+ -r binder/requirements.txt
272+ commands = 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')]"
273+
274+ # Distro
275+ [testenv:dist]
276+ skip_install = true
277+ deps = build
278+ commands =
279+ python -m build --outdir {distdir}
280+ /bin/bash -c 'python -m pip install -U --force-reinstall {distdir}/papermill*.tar.gz'
281+ /bin/bash -c 'python -m pip install -U --force-reinstall {distdir}/papermill*.whl'
282+
283+ [testenv]
284+ # disable Python's hash randomization for tests that stringify dicts, etc
285+ setenv =
286+ PYTHONHASHSEED = 0
287+ AWS_ACCESS_KEY_ID=foobar_key
288+ AWS_SECRET_ACCESS_KEY=foobar_secret
289+ passenv = *
290+ basepython =
291+ py310: python3.10
292+ py311: python3.11
293+ py312: python3.12
294+ py313: python3.13
295+ manifest: python3.13
296+ dist: python3.13
297+ docs: python3.13
298+ binder: python3.13
299+ deps = .[dev]
300+ # Have to use /bin/bash or the `*` will cause that argument to get quoted by the tox command line...
301+ allowlist_externals = /bin/bash
302+ commands = pytest -v --maxfail=2 --cov=papermill -W always {posargs}
303+ """
0 commit comments