41 lines
935 B
Bash
41 lines
935 B
Bash
#!/bin/bash
|
|
# shortcut for creating new virtual environments
|
|
venvnew() {
|
|
python3 -m venv .venv --prompt $(basename $PWD)
|
|
source .venv/bin/activate
|
|
|
|
python3 -m pip install pip --upgrade
|
|
|
|
if [ -d "src" ]; then
|
|
pip install -e "src[all]" || \
|
|
pip install -e "src[dev]" || \
|
|
pip install -e "src"
|
|
elif [[ -f "setup.py" ]]; then
|
|
pip install -e .
|
|
elif [[ -f "requirements.txt" ]]; then
|
|
pip install pre-commit
|
|
pre-commit install
|
|
fi
|
|
|
|
if [[ -f ".pre-commit-config.yaml" ]]; then
|
|
pip install pre-commit
|
|
pre-commit install
|
|
fi
|
|
|
|
pip show kedro > /dev/null 2>&1 && pip install kedro-lsp
|
|
|
|
pip install \
|
|
black \
|
|
flake8 \
|
|
ipython \
|
|
isort \
|
|
lolcat \
|
|
mypy \
|
|
pyflyby \
|
|
rich \
|
|
rope
|
|
}
|
|
|
|
source .venv/bin/activate > /dev/null 2>&1 || venvnew
|
|
|
|
echo $(basename $PWD) | lolcat
|