Skip to content

Repository for the second Portland Python Pyrates project

License

Notifications You must be signed in to change notification settings

PDXPythonPirates/ppp-project-2

Repository files navigation

ppp-project-2

Repository for the second Portland Python Pyrates project

How to boot the app

  • In your local environment

    1. run make install to install dependencies and jump into the virtual env
    2. run flask run to boot the app locally. Make sure you are in the top level directory that has the file "app_run.py"
  • With docker containers

    1. run make install to install dependencies and jump into the virtual env
    2. run make build to build the docker image
    3. run make run to run the docker containers locally and open on http://localhost:5000
      • run make stop to stop containers and prune after finished with changes

Working with Docker

  • Install Docker by following the instructions on their site
  • run make build to build the docker image
  • run make run to run the docker containers locally and open on http://localhost:5000
  • run make stop to stop containers and prune

Working with Poetry

  • Install a new dep/library run poetry add <your_dep> or poetry add <dep> --dev
  • Resolve poetry.lock files. Use 1. to resolve on github or 2. to resolve locally (recommended)
    1. On github click on resolve conflicts and follow this guide
    2. Locally, pull the recent changes. Remove the lock file with the conflict rm poetry.lock. run make install to regenerate the lock file. Push changes and give yourself a high five!

Enable Virtual Environment and Install Packages

Mac

  • Note: make sure poetry is installed and first time setup is complete
  • Take a look at the Makefile to see what shell commands are being executed
    make install

Adding Python Dependencies

  1. we use poetry to track python deps
  2. to install a new dep run poetry add <your_dep> or poetry add <dep> --dev
  3. you can also modify the pyproject.toml directly, then run poetry lock --no-update

First-Time Setup

Mac

  • Install brew
  • Install pyenv
    brew install pyenv
    echo 'eval "$(pyenv init --path)"' >> ~/.zprofile
    echo 'eval "$(pyenv init -)"' >> ~/.zshrc
  • Install zsh
    brew install zsh
  • Install Python 3.8.10
    pyenv install 3.8.10

Troubleshooting

Help with various installation/setup issues:

Mac

Edit to add

References

  1. Flask Mega Tutorial - by Miguel Grinberg - 2018

Other References

  1. Testing Markdown - dillinger.io