Last active
January 17, 2025 22:06
-
-
Save nuria/69c17b7c8cc01aea0a758429d2ef9fdd to your computer and use it in GitHub Desktop.
hook to install tox and run unit tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -exuo pipefail | |
# workaround for a bug with setuptools | |
mkdir -p ./src | |
# create a new virtual environment if it doesn't exist | |
if [ ! -d .venv ]; then | |
python3 -m venv .venv | |
fi | |
# install tox if it doesn't exist in the virtual environment | |
if [ ! -f .venv/bin/tox ]; then | |
.venv/bin/pip install tox | |
fi | |
# run unit tests | |
.venv/bin/tox |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment