My Python repo template.
This and other readme files in this repo are RunMe Playbooks.
Use this playbook step/task to update the RunMe cli.
If you don't have runme installed, you'll need to copy/paste the command. :)
go install github.com/stateful/runme/v3@v3
Install Playbook dependencies:
go install github.com/charmbracelet/gum@latest
- Installing PDM
Use this runme
playbook task will either install or update pdm
.
set -ex
if [[ -z ${PYENV_ROOT} ]]; then
pip install --user --upgrade pdm
else
pip install --upgrade pdm
fi
printf "\n"
- Setup PDM
Use this runme
playbook task to setup the project's virtual env.
set -ex
if [[ ! -d .venv ]]; then
# pdm venv create
pdm use "$(which python)"
printf "\n"
fi
pdm venv list
printf "\n"
pdm lock
printf "\n"
pdm sync
printf "\n"
- Using PDM's virtual env
Use this runme
playbook task to sync the project's virtual env.
set -ex
if [[ ! -d .venv ]]; then
pdm venv create
printf "\n"
fi
pdm venv list
printf "\n"
pdm sync
printf "\n"
- Update project dependencies
Use this runme
playbook task to update the projects dependencies.
set -ex
pdm sync
printf "\n"
pdm outdated
printf "\n"
pdm update
printf "\n"
git add pdm.lock
git commit -m 'chore: update dependencies'
git lg origin/main..