Skip to content

pythoninthegrass/lunch

 
 

Repository files navigation

Lunch

@zookinheimer's masterpiece. Gonna fill in the blanks and/or add tooling.

@pythoninthegrass

Setup

Quickstart

Clone repo

# clone repo
git clone https://github.com/pythoninthegrass/lunch.git

# change directory
cd lunch/

Install dependencies

# sync dependencies from pyproject.toml and uv.lock
uv sync --all-extras

Run program

uv run app/main.py

Taskfile runner

Using Task runner with predefined configurations:

# Desktop app (development mode)
task flet:run

# Web browser mode
task flet:web

# iOS simulator
task flet:ios

Quit program

ctrl + c

Development

Additional tooling

Additional tooling includes but is not limited to:

mise

  • Install mise

  • Usage

    # install all dependencies in .tool-versions
    mise install
    
    # install specific deps
    mise use [email protected]

uv

  • Install uv if not using mise

  • Usage

    # sync dependencies (creates .venv automatically)
    uv sync
    
    # install with dev extras
    uv sync --all-extras
    
    # add new dependency
    uv add <package>
    
    # add optional dependency to dev group
    uv add --optional dev <package>
    
    # run program
    uv run app/main.py
    
    # export requirements.txt from pyproject.toml
    uv pip freeze > requirements.txt

VSCode

  • 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

ruff

  • Installed via uv or pip
  • Add VSCode plugin for ruff
    • Optional: disable pylance in favor of ruff in repo settings
      "python.analysis.ignore": [
        "*"
      ],
  • 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

pre-commit

# install pre-commit dev dependency
uv sync --all-extras

# install pre-commit hooks
pre-commit install

# update
pre-commit autoupdate

# skip hooks
git commit -m "docs: udpate readme" --no-verify

editorconfig

Handles formatting of files. Install the editorconfig plugin for your editor of choice.

Renovate

  • Renovate is a GitHub tool that automatically creates pull requests to keep dependencies up to date.

TODO

See TODO.md.

Further Reading

About

Decide what's for lunch and/or dinner. Programmatically. Probably.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.1%
  • Makefile 2.1%
  • Dockerfile 1.8%