Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

License

Notifications You must be signed in to change notification settings

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/

Python virtual environment

# create virtual environment
python -m venv .venv

# activate virtual environment
source .venv/bin/activate

Install dependencies

python -m pip install -r requirements.txt

Run program

python main.py

Quit program

ctrl + c

Deactivate virtual environment

deactivate

Development

Additional tooling

Additional tooling includes but is not limited to:

asdf

  • Install asdf

  • Usage

    # add python plugin
    asdf plugin add python
    
    # install stable python
    asdf install python <latest|3.12.10>
    
    # set stable to system python
    asdf set -u python 3.12.10
    
    # add uv asdf plugin
    asdf plugin add uv https://github.com/asdf-community/asdf-uv.git
    
    # install latest version via asdf
    asdf install uv <latest|0.7.4>
    
    # set latest version as default
    asdf set -u uv latest

uv

  • Install uv if not using asdf

  • Usage

    # create a venv w/system python (./.venv)
    uv venv
    
    # activate venv
    source .venv/bin/activate
    
    # install dependencies
    uv pip install -r pyproject.toml
    
    # 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 compile pyproject.toml -o requirements.txt
    
    # run program
    python main.py
    
    # exit virtual environment
    deactivate

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 poetry 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 pip install -r pyproject.toml --all-extras

# install pre-commit hooks
pre-commit install

# update
pre-commit autoupdate

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.

repomix

  • Capture upstream source code context for LLMs via repomix

    # install repomix
    brew install repomix
    
    # generate summary
    repomix --remote https://github.com/flet-dev/flet \
            --output docs/flet_summary.md \
            --style markdown \
            --compress \
            --remove-comments \
            --remove-empty-lines

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 50.7%
  • Just 25.6%
  • Makefile 12.8%
  • Dockerfile 10.9%