mirror of
https://github.com/Tech-Workers-Coalition-Italia/mobilizon-reshare.git
synced 2025-01-29 00:29:40 +01:00
36 lines
829 B
Bash
36 lines
829 B
Bash
if command -v guix; then
|
|
rm -f .guix-root
|
|
eval "$(guix time-machine -C channels-lock.scm -- shell -r .guix-root -D -f guix.scm -m manifest.scm --pure --search-paths -L . -L ./patches)"
|
|
|
|
# Add development scripts to PATH
|
|
export PATH="$(pwd)/scripts:${PATH}"
|
|
|
|
venv_dir=".venv"
|
|
|
|
if [ ! -e "$venv_dir/bin/python" ] ; then
|
|
rm -rvf "$venv_dir"
|
|
pre-commit uninstall
|
|
fi
|
|
if [ ! -d "$venv_dir" ] ; then
|
|
virtualenv -p `which python3.9` "$venv_dir"
|
|
poetry install
|
|
pre-commit install
|
|
fi
|
|
|
|
clear
|
|
git-cal --author="$(git config user.name)"
|
|
|
|
run-tests () {
|
|
poetry run pytest
|
|
}
|
|
export_function run-tests
|
|
cat << EOF
|
|
|
|
run-tests Runs pytest in the current directory
|
|
|
|
The 'scripts' directory has been added to your PATH: you can now invoke scripts without typing the relative path.
|
|
|
|
EOF
|
|
|
|
fi
|