GithubHelp home page GithubHelp logo

py-debian-poetry's Introduction

Python Debian Poetry Template

  • Python 3.10.5
  • Poetry dependency management
  • Base Docker image: python:3.10.5-bullseye (debian)
  • Authored by Kyle Clark - kyleaclark.com

Local Environment

Note: Instructions are specific to macOS. Steps may vary.

Prerequisites

  1. Install pyenv for python version management - https://github.com/pyenv/pyenv
  2. Update pyenv if previously installed e.g. via brew brew upgrade pyenv
  3. Install poetry for python dependency management - https://python-poetry.org/docs/#installation
  4. Update poetry if necessary (optional): poetry self update
  5. Add pyenv path to profile e.g. add export PYENV_ROOT="$HOME/.pyenv + export PATH="$PYENV_ROOT/bin:$PATH"
  6. Add poetry path to profile e.g. add export PATH="$HOME/.poetry/bin/:PATH
  7. Install python version: pyenv install 3.10.5

Python Environment

  1. Set python version within the repo directory: pyenv local 3.10.5
  2. Set the poetry env version of python: poetry env use ~/.pyenv/versions/3.10.5/bin/python
  3. Install python application dependencies: poetry install

Optional: PyCharm Setup

  1. Open PyCharm Preferences
  2. Open Project Interpeter
  3. Add existing Virtualenv Environment e.g. /Users/<username>/Library/Caches/pypoetry/virtualenvs/<poetry-name>/bin/python
  4. Run app/main.py

Docker Build

Docker Build & Run App

docker build --target application -f Dockerfile -t py-debian-poetry .
docker run --user=appuser --env APP_ENV=DEV py-debian-poetry

Docker Build & Run Tests

docker build --target testing -f Dockerfile -t py-debian-poetry .
docker run --user=appuser --env APP_ENV=DEV py-debian-poetry

Poetry Commands

py-debian-poetry's People

Contributors

kyleaclark avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.