Skip to content

Instantly share code, notes, and snippets.

@kborovik
Created October 26, 2024 17:40
Show Gist options
  • Save kborovik/aa766e98a2a3996ecec64cb65037b2cb to your computer and use it in GitHub Desktop.
Save kborovik/aa766e98a2a3996ecec64cb65037b2cb to your computer and use it in GitHub Desktop.
.EXPORT_ALL_VARIABLES:
.ONESHELL:
.SILENT:
MAKEFLAGS += --no-builtin-rules --no-builtin-variables
PATH := $(abspath .venv)/bin:$(PATH)
python_packages := streamlit pandas
help:
$(info ==> Help <==)
$(info make pip-install - Install Python packages)
$(info make pip-upgrade - Upgrade Python packages)
$(info make pip-list - List Python packages)
$(info make pip-clean - Remove cached Python package files)
$(info )
$(info ==> Python Packages <==)
$(info $(python_packages))
pip-install: requirements.txt
$(info ==> Install requirements <==)
pip install -r requirements.txt
pip install ruff
pip-list: requirements.txt
pip list
pip-clean:
$(info ==> Remove cached Python package files <==)
rm -rf .venv requirements.txt
pip-upgrade: pip-clean pip-install
.gitignore:
cat << EOF > $@
.venv
EOF
.venv: .gitignore
$(info ==> Create Python virtual environment <==)
python3 -m venv .venv
requirements.txt: .venv
$(info ==> Upgrade Python packages <==)
pip install --upgrade pip $(python_packages)
pip freeze >| $(@)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment