@zookinheimer's masterpiece. Gonna fill in the blanks and/or add tooling.
- Install
# clone repo
git clone https://github.com/pythoninthegrass/lunch.git
# change directory
cd lunch/
# create virtual environment
python -m venv .venv
# activate virtual environment
source .venv/bin/activate
python -m pip install -r requirements.txt
python main.py
ctrl + c
deactivate
Additional tooling includes but is not limited to:
-
Install mise
-
Usage
# install all dependencies in .tool-versions mise install # install specific deps mise use [email protected]
-
Install uv if not using
mise
-
Usage
# create a venv w/system python (./.venv) uv venv --python ">=3.12,<3.13" # activate venv source .venv/bin/activate # install with extras (for development) uv pip install -r pyproject.toml --all-extras # add new dependency uv add <package> # add optional dependency to dev group uv add --optional dev <package> # export requirements.txt from pyproject.toml uv pip freeze > requirements.txt # run program python main.py # exit virtual environment deactivate
- Install VSCode
- Setup VSCode settings
- Handles debug settings for generic python programs as well as others (e.g., django, flask, etc.)
- Dev Containers
- Command palette (⇧⌘P) > Dev Containers: Reopen in Container
- F5 for debug
- May need to select interpreter (e.g.,
/opt/venv/bin/python
) first
- May need to select interpreter (e.g.,
- Installed via
uv
orpip
- Add VSCode plugin for ruff
- Optional: disable pylance in favor of ruff in repo settings
"python.analysis.ignore": [ "*" ],
- Optional: disable pylance in favor of ruff in repo settings
- Usage
# run linter ruff check <.|main.py> # `--fix` arg to use a one-liner # run linter and fix issues ruff fix . # run tests ruff # run tests with coverage ruff --coverage # run tests with coverage and open in browser ruff --coverage --open
# install pre-commit dev dependency
uv pip install -r pyproject.toml --all-extras
# install pre-commit hooks
pre-commit install
# update
pre-commit autoupdate
# skip hooks
git commit -m "docs: udpate readme" --no-verify
Handles formatting of files. Install the editorconfig plugin for your editor of choice.
- Renovate is a GitHub tool that automatically creates pull requests to keep dependencies up to date.
See TODO.md.