From cc16b781e6d22e0415cab4498e621417d8674d78 Mon Sep 17 00:00:00 2001 From: Andrew Grimberg Date: Wed, 5 Apr 2023 12:19:04 -0700 Subject: [PATCH] CI: Add clean,build tox environments Change-Id: Ide43cc73615ae67b1d423c83dc8d78e935d2470d Signed-off-by: Andrew Grimberg --- tox.ini | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tox.ini b/tox.ini index e9358b4..320cdc6 100644 --- a/tox.ini +++ b/tox.ini @@ -14,6 +14,26 @@ deps = commands = pytest --basetemp={envtmpdir} {posargs} + +[testenv:{build,clean}] +description = + build: Build the package in isolation according to PEP517, see https://github.com/pypa/build + clean: Remove old distribution files and temporary build artifacts (./build and ./dist) +# https://setuptools.pypa.io/en/stable/build_meta.html#how-to-use-it +skip_install = True +changedir = {toxinidir} +deps = + build: build[virtualenv] +passenv = + SETUPTOOLS_* +commands = + clean: python -c 'import shutil; [shutil.rmtree(p, True) for p in ("build", "dist", "docs/_build")]' + clean: python -c 'import pathlib, shutil; [shutil.rmtree(p, True) for p in pathlib.Path("src").glob("*.egg-info")]' + build: python -m build {posargs} +# By default, both `sdist` and `wheel` are built. If your sdist is too big or you don't want +# to make it available, consider running: `tox -e build -- --wheel` + + [testenv:docs] basepython = python3 deps = -- 2.16.6