Skip to content

Commit

Permalink
CI: Add tox build,clean environments
Browse files Browse the repository at this point in the history
* Add the tox build and clean environments
* Add additional gitignore to deal with build artifacts

Issue: RELENG-4563
Signed-off-by: Andrew Grimberg <[email protected]>
Change-Id: I26df479ac9f0a6177c345fd3a9bdd3dbb4bc9f49
  • Loading branch information
tykeal committed Apr 12, 2023
1 parent 4d5f1d7 commit c625f9f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ anonymous-cli-metrics.json
__pycache__/
*.egg-info/
*.pyc
docs/_build/
dist/

# Build and docs folder/files
build/*
dist/*
sdist/*
docs/api/*
docs/_rst/*
docs/_build/*
cover/*
MANIFEST

# PBR
Expand Down
20 changes: 20 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@ deps = -r{toxinidir}/requirements-test.txt
commands = pytest
usedevelop = true


[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]
description = Build the documentation with sphinx
basepython = python3
Expand Down

0 comments on commit c625f9f

Please sign in to comment.