Skip to content

Instantly share code, notes, and snippets.

@nuria
Last active January 17, 2025 22:06
Show Gist options
  • Save nuria/69c17b7c8cc01aea0a758429d2ef9fdd to your computer and use it in GitHub Desktop.
Save nuria/69c17b7c8cc01aea0a758429d2ef9fdd to your computer and use it in GitHub Desktop.
hook to install tox and run unit tests
#!/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