From f29783b9d3678929cb970dc7f76a205e880f843c Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:44:11 +0200 Subject: [PATCH] FIX: add `tox` job definitions --- pyproject.toml | 106 +++++++++++++++++++++++++++++++++++++++++++++++++ uv.lock | 52 ++++++++++++++++++++++++ 2 files changed, 158 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index a1f8b1d..c6b9e1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,7 @@ dev = [ "gluex-nstar[jupyter]", "gluex-nstar[sty]", "pre-commit-uv", + "tox", ] doc = [ "sphinx-autobuild", @@ -155,3 +156,108 @@ sort_first = [ ] spaces_indent_inline_array = 4 trailing_comma_inline_array = true + +[tool.tox] +legacy_tox_ini = """ +[tox] +envlist = + cov, + docnb-force, + linkcheck, + sty, +skip_install = True +skip_missing_interpreters = True +skipsdist = True + +[testenv] +passenv = * +setenv = + PYTHONHASHSEED = 0 + +[testenv:doc] +allowlist_externals = + sphinx-build +commands = + sphinx-build \ + --builder=html \ + --fail-on-warning \ + --keep-going \ + --show-traceback \ + docs/ docs/_build/html +description = Build documentation and API through Sphinx +setenv = + {[testenv]setenv} + PYTHONWARNINGS = + +[testenv:docnb] +base = doc +description = {[testenv:doc]description} with cached notebook execution +setenv = + {[testenv:doc]setenv} + EXECUTE_NB = yes + +[testenv:docnb-force] +base = doc +description = {[testenv:doc]description} with notebook execution (no cache) +setenv = + {[testenv:doc]setenv} + FORCE_EXECUTE_NB = yes + +[testenv:doclive] +allowlist_externals = + sphinx-autobuild +commands = + sphinx-autobuild \ + --builder=html \ + --ignore=docs/_build/ \ + --ignore=docs/_images/ \ + --ignore=docs/api/ \ + --open-browser \ + --port=0 \ + --re-ignore='.*/__pycache__/.*' \ + --re-ignore='.*/.ipynb_checkpoints/.*' \ + --re-ignore='.*/.virtual_documents/.*' \ + --re-ignore='.*\\.csv' \ + --re-ignore='.*\\.gif' \ + --re-ignore='.*\\.gitignore' \ + --re-ignore='.*\\.gv' \ + --re-ignore='.*\\.inv' \ + --re-ignore='.*\\.json' \ + --re-ignore='.*\\.pickle' \ + --re-ignore='.*\\.png' \ + --re-ignore='.*\\.svg' \ + --re-ignore='.*\\.tmp' \ + --re-ignore='.*\\.ya?ml' \ + --watch=docs \ + --watch=src \ + docs/ docs/_build/html +description = Set up a server to directly preview changes to the HTML pages +setenv = + {[testenv:doc]setenv} + +[testenv:docnblive] +base = doclive +description = {[testenv:doclive]description} with cached notebook execution +setenv = + {[testenv:doclive]setenv} + EXECUTE_NB = yes + +[testenv:linkcheck] +allowlist_externals = + sphinx-build +commands = + sphinx-build \ + --builder=linkcheck \ + --show-traceback \ + docs/ docs/_build/linkcheck +description = Check external links in the documentation (requires internet connection) +setenv = + {[testenv:doclive]setenv} + +[testenv:sty] +allowlist_externals = + pre-commit +commands = + pre-commit run {posargs} --all-files +description = Perform all linting, formatting, and spelling checks +""" diff --git a/uv.lock b/uv.lock index a1b9f19..ab560f6 100644 --- a/uv.lock +++ b/uv.lock @@ -207,6 +207,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ea/63/da7237f805089ecc28a3f36bca6a21c31fcbc2eb380f3b8f1be3312abd14/bleach-6.1.0-py3-none-any.whl", hash = "sha256:3225f354cfc436b9789c66c4ee030194bee0568fbf9cbdad3bc8b5c26c5f12b6", size = 162750 }, ] +[[package]] +name = "cachetools" +version = "5.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c3/38/a0f315319737ecf45b4319a8cd1f3a908e29d9277b46942263292115eee7/cachetools-5.5.0.tar.gz", hash = "sha256:2cc24fb4cbe39633fb7badd9db9ca6295d766d9c2995f245725a46715d050f2a", size = 27661 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a4/07/14f8ad37f2d12a5ce41206c21820d8cb6561b728e51fad4530dff0552a67/cachetools-5.5.0-py3-none-any.whl", hash = "sha256:02134e8439cdc2ffb62023ce1debca2944c3f289d66bb17ead3ab3dede74b292", size = 9524 }, +] + [[package]] name = "cattrs" version = "24.1.2" @@ -270,6 +279,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c5/55/51844dd50c4fc7a33b653bfaba4c2456f06955289ca770a5dbd5fd267374/cfgv-3.4.0-py2.py3-none-any.whl", hash = "sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9", size = 7249 }, ] +[[package]] +name = "chardet" +version = "5.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f3/0d/f7b6ab21ec75897ed80c17d79b15951a719226b9fababf1e40ea74d69079/chardet-5.2.0.tar.gz", hash = "sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7", size = 2069618 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/38/6f/f5fbc992a329ee4e0f288c1fe0e2ad9485ed064cac731ed2fe47dcc38cbf/chardet-5.2.0-py3-none-any.whl", hash = "sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970", size = 199385 }, +] + [[package]] name = "charset-normalizer" version = "3.4.0" @@ -623,6 +641,7 @@ dev = [ { name = "sphinx-book-theme" }, { name = "sphinx-comments" }, { name = "sphinx-copybutton" }, + { name = "tox" }, ] doc = [ { name = "sphinx-autobuild" }, @@ -685,6 +704,7 @@ requires-dist = [ { name = "sympy" }, { name = "tensorflow" }, { name = "tensorwaves" }, + { name = "tox", marker = "extra == 'dev'" }, ] [[package]] @@ -2149,6 +2169,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/be/ec/2eb3cd785efd67806c46c13a17339708ddc346cbb684eade7a6e6f79536a/pyparsing-3.2.0-py3-none-any.whl", hash = "sha256:93d9577b88da0bbea8cc8334ee8b918ed014968fd2ec383e868fb8afb1ccef84", size = 106921 }, ] +[[package]] +name = "pyproject-api" +version = "1.8.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "packaging" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/bb/19/441e0624a8afedd15bbcce96df1b80479dd0ff0d965f5ce8fde4f2f6ffad/pyproject_api-1.8.0.tar.gz", hash = "sha256:77b8049f2feb5d33eefcc21b57f1e279636277a8ac8ad6b5871037b243778496", size = 22340 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ba/f4/3c4ddfcc0c19c217c6de513842d286de8021af2f2ab79bbb86c00342d778/pyproject_api-1.8.0-py3-none-any.whl", hash = "sha256:3d7d347a047afe796fd5d1885b1e391ba29be7169bd2f102fcd378f04273d228", size = 13100 }, +] + [[package]] name = "python-constraint2" version = "2.0.0b5" @@ -2955,6 +2987,26 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d9/2f/3f2f05e84a7aff787a96d5fb06821323feb370fe0baed4db6ea7b1088f32/tornado-6.4.1-cp38-abi3-win_amd64.whl", hash = "sha256:b24b8982ed444378d7f21d563f4180a2de31ced9d8d84443907a0a64da2072e7", size = 438532 }, ] +[[package]] +name = "tox" +version = "4.22.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cachetools" }, + { name = "chardet" }, + { name = "colorama" }, + { name = "filelock" }, + { name = "packaging" }, + { name = "platformdirs" }, + { name = "pluggy" }, + { name = "pyproject-api" }, + { name = "virtualenv" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7d/35/c9a296b276c594b59dbdf71a7b9ad8a4d10f08c86b4696e399cc619ac1a7/tox-4.22.0.tar.gz", hash = "sha256:acc6c627cb3316585238d55d2b633e132fea1bdb01b9d93b56bce7caea6ae73d", size = 189907 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/78/60/1da066bd2e3871a9ca078faf7f9e70a8a6d500840566acbcc94e1a3eaa05/tox-4.22.0-py3-none-any.whl", hash = "sha256:03734d9a9ac138cd1a898a372fb1b8079e2728618ae06dc37cbf3686cfb56eea", size = 166678 }, +] + [[package]] name = "tqdm" version = "4.66.5"