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
git clone https://github.com/xBromsson/marley.git

# change directory
cd lunch/

# install dependencies
python -m pip install -r requirements.txt

# run program
python main.py

# quit program
ctrl + c

Development

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 

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.11.4>
    
    # set stable to system python
    asdf global python latest
    
    # add poetry asdf plugin
    asdf plugin-add poetry https://github.com/asdf-community/asdf-poetry.git
    
    # install latest version via asdf
    asdf install poetry <latest|1.5.1>
    
    # set latest version as default
    asdf global poetry latest

poetry

  • Install poetry if not using asdf
  • Usage
    # use venv in repo
    poetry config virtualenvs.in-project true
    
    # install dependencies
    poetry install
    
    # add new dependency
    poetry add <package>
    
    # remove dependency
    poetry remove <package>
    
    # activate virtual environment
    poetry shell
    
    # run program
    python main.py
    
    # exit virtual environment
    exit

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
poetry install

# 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.

dependabot

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

TODO

  • QA
    • Desktop
      • macOS: native form input is broken bc pywebview
      • Linux
      • Windows
    • Mobile
      • iOS
      • Android
  • Document
  • Convert to PySimpleGUI NiceGUI
  • Extend
    • semantic-release
    • sqlite -> postgres
    • Fancy category
    • Images
    • Menus
    • API calls to Yelp, Google, etc.
    • Tinder swipe right/left mechanic hehehe

Further Reading

Python Poetry, finally easy build and deploy packages | by Jose Alberto Torres Agüera | Lambda Automotive | Medium

Python 101: Developing Package with Poetry | by Julio Anthony Leonard | Bootcampers | Medium

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 60.8%
  • Makefile 16.4%
  • Just 16.0%
  • Dockerfile 6.8%