pyewjn/do.sh
Deepak Mallubhotla ff60ec4015
All checks were successful
gitea-physics/pyewjn/pipeline/head This commit looks good
tests: adds tests without approximation for ewjn ezz
2022-05-24 19:44:33 -05:00

44 lines
887 B
Bash

#!/usr/bin/env bash
# Do - The Simplest Build Tool on Earth.
# Documentation and examples see https://github.com/8gears/do
set -Eeuo pipefail # -e "Automatic exit from bash shell script on error" -u "Treat unset variables and parameters as errors"
build() {
echo "I am ${FUNCNAME[0]}ing"
poetry build
}
fmt() {
poetry run black .
find . -type f -name "*.py" -exec sed -i -e 's/ /\t/g' {} \;
}
test() {
echo "I am ${FUNCNAME[0]}ing"
poetry run flake8 pyewjn tests
poetry run mypy pyewjn
poetry run pytest --benchmark-disable
}
benchmark() {
echo "I am ${FUNCNAME[0]}ing"
poetry run pytest --benchmark-only
}
htmlcov() {
poetry run pytest --cov-report=html
}
release() {
./scripts/release.sh
}
all() {
build && fmt && test
}
"$@" # <- execute the task
[ "$#" -gt 0 ] || printf "Usage:\n\t./do.sh %s\n" "($(compgen -A function | grep '^[^_]' | paste -sd '|' -))"