From e0841f34af8bc3f89d3ea73489ead4da4d51f242 Mon Sep 17 00:00:00 2001 From: Tom Herold Date: Tue, 5 May 2020 12:09:29 +0200 Subject: [PATCH 01/10] restructed project structure for pypi bundling --- MANIFEST.in | 7 +++ server.py => picobrew_server/__init__.py | 6 +- .../beerxml}/__init__.py | 0 .../beerxml}/picobrew_parser.py | 4 +- .../beerxml}/picobrew_program_step.py | 0 .../beerxml}/picobrew_recipe.py | 2 +- .../blueprints}/__init__.py | 0 .../blueprints}/errors.py | 0 .../blueprints}/frontend.py | 4 +- .../blueprints}/picobrew_api.py | 4 +- .../static}/css/main.css | 0 .../static}/css/materialize.min.css | 0 .../font/material-design-icons/LICENSE.txt | 0 .../Material-Design-Icons.eot | Bin .../Material-Design-Icons.svg | 0 .../Material-Design-Icons.ttf | Bin .../Material-Design-Icons.woff | Bin .../Material-Design-Icons.woff2 | Bin .../static}/font/roboto/Roboto-Bold.ttf | Bin .../static}/font/roboto/Roboto-Bold.woff | Bin .../static}/font/roboto/Roboto-Bold.woff2 | Bin .../static}/font/roboto/Roboto-Light.ttf | Bin .../static}/font/roboto/Roboto-Light.woff | Bin .../static}/font/roboto/Roboto-Light.woff2 | Bin .../static}/font/roboto/Roboto-Medium.ttf | Bin .../static}/font/roboto/Roboto-Medium.woff | Bin .../static}/font/roboto/Roboto-Medium.woff2 | Bin .../static}/font/roboto/Roboto-Regular.ttf | Bin .../static}/font/roboto/Roboto-Regular.woff | Bin .../static}/font/roboto/Roboto-Regular.woff2 | Bin .../static}/font/roboto/Roboto-Thin.ttf | Bin .../static}/font/roboto/Roboto-Thin.woff | Bin .../static}/font/roboto/Roboto-Thin.woff2 | Bin .../static}/img/LICENSE.txt | 0 .../static}/img/android-icon-144x144.png | Bin .../static}/img/android-icon-192x192.png | Bin .../static}/img/android-icon-36x36.png | Bin .../static}/img/android-icon-48x48.png | Bin .../static}/img/android-icon-72x72.png | Bin .../static}/img/android-icon-96x96.png | Bin .../static}/img/apple-icon-114x114.png | Bin .../static}/img/apple-icon-72x72.png | Bin .../static}/img/apple-icon.png | Bin .../static}/img/favicon-16x16.png | Bin .../static}/img/favicon-32x32.png | Bin .../static}/img/favicon-96x96.png | Bin .../static}/img/favicon.ico | Bin .../static}/img/favicon.png | Bin .../static}/img/glass.svg | 0 .../static}/img/grain.svg | 0 .../static}/img/hop.svg | 0 .../static}/js/materialize.min.js | 0 .../templates}/404.html | 0 .../templates}/500.html | 0 .../templates}/base.html | 0 .../templates}/index.html | 0 .../templates}/navbar.html | 0 .../templates}/recipes.html | 0 .../templates}/upload.html | 0 .../templates}/validate.html | 0 {utils => picobrew_server/utils}/__init__.py | 0 {utils => picobrew_server/utils}/constants.py | 0 recipes/.gitkeep | 0 setup.cfg | 2 + setup.py | 52 ++++++++++++++++++ 65 files changed, 69 insertions(+), 12 deletions(-) create mode 100644 MANIFEST.in rename server.py => picobrew_server/__init__.py (71%) rename {beerxml => picobrew_server/beerxml}/__init__.py (100%) rename {beerxml => picobrew_server/beerxml}/picobrew_parser.py (91%) rename {beerxml => picobrew_server/beerxml}/picobrew_program_step.py (100%) rename {beerxml => picobrew_server/beerxml}/picobrew_recipe.py (93%) rename {blueprints => picobrew_server/blueprints}/__init__.py (100%) rename {blueprints => picobrew_server/blueprints}/errors.py (100%) rename {blueprints => picobrew_server/blueprints}/frontend.py (95%) rename {blueprints => picobrew_server/blueprints}/picobrew_api.py (97%) rename {static => picobrew_server/static}/css/main.css (100%) rename {static => picobrew_server/static}/css/materialize.min.css (100%) rename {static => picobrew_server/static}/font/material-design-icons/LICENSE.txt (100%) rename {static => picobrew_server/static}/font/material-design-icons/Material-Design-Icons.eot (100%) rename {static => picobrew_server/static}/font/material-design-icons/Material-Design-Icons.svg (100%) rename {static => picobrew_server/static}/font/material-design-icons/Material-Design-Icons.ttf (100%) rename {static => picobrew_server/static}/font/material-design-icons/Material-Design-Icons.woff (100%) rename {static => picobrew_server/static}/font/material-design-icons/Material-Design-Icons.woff2 (100%) rename {static => picobrew_server/static}/font/roboto/Roboto-Bold.ttf (100%) rename {static => picobrew_server/static}/font/roboto/Roboto-Bold.woff (100%) rename {static => picobrew_server/static}/font/roboto/Roboto-Bold.woff2 (100%) rename {static => picobrew_server/static}/font/roboto/Roboto-Light.ttf (100%) rename {static => picobrew_server/static}/font/roboto/Roboto-Light.woff (100%) rename {static => picobrew_server/static}/font/roboto/Roboto-Light.woff2 (100%) rename {static => picobrew_server/static}/font/roboto/Roboto-Medium.ttf (100%) rename {static => picobrew_server/static}/font/roboto/Roboto-Medium.woff (100%) rename {static => picobrew_server/static}/font/roboto/Roboto-Medium.woff2 (100%) rename {static => picobrew_server/static}/font/roboto/Roboto-Regular.ttf (100%) rename {static => picobrew_server/static}/font/roboto/Roboto-Regular.woff (100%) rename {static => picobrew_server/static}/font/roboto/Roboto-Regular.woff2 (100%) rename {static => picobrew_server/static}/font/roboto/Roboto-Thin.ttf (100%) rename {static => picobrew_server/static}/font/roboto/Roboto-Thin.woff (100%) rename {static => picobrew_server/static}/font/roboto/Roboto-Thin.woff2 (100%) rename {static => picobrew_server/static}/img/LICENSE.txt (100%) rename {static => picobrew_server/static}/img/android-icon-144x144.png (100%) rename {static => picobrew_server/static}/img/android-icon-192x192.png (100%) rename {static => picobrew_server/static}/img/android-icon-36x36.png (100%) rename {static => picobrew_server/static}/img/android-icon-48x48.png (100%) rename {static => picobrew_server/static}/img/android-icon-72x72.png (100%) rename {static => picobrew_server/static}/img/android-icon-96x96.png (100%) rename {static => picobrew_server/static}/img/apple-icon-114x114.png (100%) rename {static => picobrew_server/static}/img/apple-icon-72x72.png (100%) rename {static => picobrew_server/static}/img/apple-icon.png (100%) rename {static => picobrew_server/static}/img/favicon-16x16.png (100%) rename {static => picobrew_server/static}/img/favicon-32x32.png (100%) rename {static => picobrew_server/static}/img/favicon-96x96.png (100%) rename {static => picobrew_server/static}/img/favicon.ico (100%) rename {static => picobrew_server/static}/img/favicon.png (100%) rename {static => picobrew_server/static}/img/glass.svg (100%) rename {static => picobrew_server/static}/img/grain.svg (100%) rename {static => picobrew_server/static}/img/hop.svg (100%) rename {static => picobrew_server/static}/js/materialize.min.js (100%) rename {templates => picobrew_server/templates}/404.html (100%) rename {templates => picobrew_server/templates}/500.html (100%) rename {templates => picobrew_server/templates}/base.html (100%) rename {templates => picobrew_server/templates}/index.html (100%) rename {templates => picobrew_server/templates}/navbar.html (100%) rename {templates => picobrew_server/templates}/recipes.html (100%) rename {templates => picobrew_server/templates}/upload.html (100%) rename {templates => picobrew_server/templates}/validate.html (100%) rename {utils => picobrew_server/utils}/__init__.py (100%) rename {utils => picobrew_server/utils}/constants.py (100%) delete mode 100644 recipes/.gitkeep create mode 100644 setup.cfg create mode 100644 setup.py diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..2a957a6 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,7 @@ +graft picobrew_server/static +graft picobrew_server/templates +graft picobrew_server/blueprints +graft picobrew_server/beerxml +graft picobrew_server/recipes +graft picobrew_server/sessions +global-exclude *.pyc \ No newline at end of file diff --git a/server.py b/picobrew_server/__init__.py similarity index 71% rename from server.py rename to picobrew_server/__init__.py index 10c6ead..13b2334 100755 --- a/server.py +++ b/picobrew_server/__init__.py @@ -1,7 +1,7 @@ # System imports from flask_cors import CORS from flask import Flask -from blueprints import frontend, picobrew_api, errors +from picobrew_server.blueprints import frontend, picobrew_api, errors app = Flask(__name__) CORS(app) @@ -15,7 +15,3 @@ app.register_blueprint(errors.errors) app.register_blueprint(picobrew_api.picobrew_api) -if __name__ == "__main__": - - # Start the Flask app - app.run(host="0.0.0.0", port=5000) diff --git a/beerxml/__init__.py b/picobrew_server/beerxml/__init__.py similarity index 100% rename from beerxml/__init__.py rename to picobrew_server/beerxml/__init__.py diff --git a/beerxml/picobrew_parser.py b/picobrew_server/beerxml/picobrew_parser.py similarity index 91% rename from beerxml/picobrew_parser.py rename to picobrew_server/beerxml/picobrew_parser.py index 8622e5a..00310d6 100644 --- a/beerxml/picobrew_parser.py +++ b/picobrew_server/beerxml/picobrew_parser.py @@ -3,8 +3,8 @@ from pathlib import Path from pybeerxml import Parser -from beerxml.picobrew_recipe import PicoBrewRecipe -from beerxml.picobrew_program_step import PicoBrewProgramStep +from picobrew_server.beerxml.picobrew_recipe import PicoBrewRecipe +from picobrew_server.beerxml.picobrew_program_step import PicoBrewProgramStep class PicoBrewRecipeParser(Parser): diff --git a/beerxml/picobrew_program_step.py b/picobrew_server/beerxml/picobrew_program_step.py similarity index 100% rename from beerxml/picobrew_program_step.py rename to picobrew_server/beerxml/picobrew_program_step.py diff --git a/beerxml/picobrew_recipe.py b/picobrew_server/beerxml/picobrew_recipe.py similarity index 93% rename from beerxml/picobrew_recipe.py rename to picobrew_server/beerxml/picobrew_recipe.py index e1c1992..66a7ffe 100644 --- a/beerxml/picobrew_recipe.py +++ b/picobrew_server/beerxml/picobrew_recipe.py @@ -2,7 +2,7 @@ from typing import Text, List from pybeerxml import Recipe -from beerxml.picobrew_program_step import PicoBrewProgramStep +from picobrew_server.beerxml.picobrew_program_step import PicoBrewProgramStep def get_hash(text: Text) -> Text: diff --git a/blueprints/__init__.py b/picobrew_server/blueprints/__init__.py similarity index 100% rename from blueprints/__init__.py rename to picobrew_server/blueprints/__init__.py diff --git a/blueprints/errors.py b/picobrew_server/blueprints/errors.py similarity index 100% rename from blueprints/errors.py rename to picobrew_server/blueprints/errors.py diff --git a/blueprints/frontend.py b/picobrew_server/blueprints/frontend.py similarity index 95% rename from blueprints/frontend.py rename to picobrew_server/blueprints/frontend.py index 10c8e33..1adbf4d 100644 --- a/blueprints/frontend.py +++ b/picobrew_server/blueprints/frontend.py @@ -5,9 +5,9 @@ from flask import Blueprint, request, flash, redirect, url_for, render_template, session from werkzeug.utils import secure_filename -from beerxml.picobrew_parser import PicoBrewRecipeParser, PicoBrewRecipe +from picobrew_server.beerxml.picobrew_parser import PicoBrewRecipeParser, PicoBrewRecipe -from utils.constants import ALLOWED_FILE_EXTENSIONS +from picobrew_server.utils.constants import ALLOWED_FILE_EXTENSIONS logger = logging.getLogger() frontend = Blueprint("frontend", __name__) diff --git a/blueprints/picobrew_api.py b/picobrew_server/blueprints/picobrew_api.py similarity index 97% rename from blueprints/picobrew_api.py rename to picobrew_server/blueprints/picobrew_api.py index 3e32561..adc444d 100644 --- a/blueprints/picobrew_api.py +++ b/picobrew_server/blueprints/picobrew_api.py @@ -10,9 +10,9 @@ from flask import Blueprint, request, abort from webargs import fields from webargs.flaskparser import use_kwargs, parser -from blueprints.frontend import get_recipes, get_recipe +from picobrew_server.blueprints.frontend import get_recipes, get_recipe -from utils.constants import SESSION_PATH, SYSTEM_USER +from picobrew_server.utils.constants import SESSION_PATH, SYSTEM_USER picobrew_api = Blueprint("picobrew_api", __name__) logger = logging.getLogger() diff --git a/static/css/main.css b/picobrew_server/static/css/main.css similarity index 100% rename from static/css/main.css rename to picobrew_server/static/css/main.css diff --git a/static/css/materialize.min.css b/picobrew_server/static/css/materialize.min.css similarity index 100% rename from static/css/materialize.min.css rename to picobrew_server/static/css/materialize.min.css diff --git a/static/font/material-design-icons/LICENSE.txt b/picobrew_server/static/font/material-design-icons/LICENSE.txt similarity index 100% rename from static/font/material-design-icons/LICENSE.txt rename to picobrew_server/static/font/material-design-icons/LICENSE.txt diff --git a/static/font/material-design-icons/Material-Design-Icons.eot b/picobrew_server/static/font/material-design-icons/Material-Design-Icons.eot similarity index 100% rename from static/font/material-design-icons/Material-Design-Icons.eot rename to picobrew_server/static/font/material-design-icons/Material-Design-Icons.eot diff --git a/static/font/material-design-icons/Material-Design-Icons.svg b/picobrew_server/static/font/material-design-icons/Material-Design-Icons.svg similarity index 100% rename from static/font/material-design-icons/Material-Design-Icons.svg rename to picobrew_server/static/font/material-design-icons/Material-Design-Icons.svg diff --git a/static/font/material-design-icons/Material-Design-Icons.ttf b/picobrew_server/static/font/material-design-icons/Material-Design-Icons.ttf similarity index 100% rename from static/font/material-design-icons/Material-Design-Icons.ttf rename to picobrew_server/static/font/material-design-icons/Material-Design-Icons.ttf diff --git a/static/font/material-design-icons/Material-Design-Icons.woff b/picobrew_server/static/font/material-design-icons/Material-Design-Icons.woff similarity index 100% rename from static/font/material-design-icons/Material-Design-Icons.woff rename to picobrew_server/static/font/material-design-icons/Material-Design-Icons.woff diff --git a/static/font/material-design-icons/Material-Design-Icons.woff2 b/picobrew_server/static/font/material-design-icons/Material-Design-Icons.woff2 similarity index 100% rename from static/font/material-design-icons/Material-Design-Icons.woff2 rename to picobrew_server/static/font/material-design-icons/Material-Design-Icons.woff2 diff --git a/static/font/roboto/Roboto-Bold.ttf b/picobrew_server/static/font/roboto/Roboto-Bold.ttf similarity index 100% rename from static/font/roboto/Roboto-Bold.ttf rename to picobrew_server/static/font/roboto/Roboto-Bold.ttf diff --git a/static/font/roboto/Roboto-Bold.woff b/picobrew_server/static/font/roboto/Roboto-Bold.woff similarity index 100% rename from static/font/roboto/Roboto-Bold.woff rename to picobrew_server/static/font/roboto/Roboto-Bold.woff diff --git a/static/font/roboto/Roboto-Bold.woff2 b/picobrew_server/static/font/roboto/Roboto-Bold.woff2 similarity index 100% rename from static/font/roboto/Roboto-Bold.woff2 rename to picobrew_server/static/font/roboto/Roboto-Bold.woff2 diff --git a/static/font/roboto/Roboto-Light.ttf b/picobrew_server/static/font/roboto/Roboto-Light.ttf similarity index 100% rename from static/font/roboto/Roboto-Light.ttf rename to picobrew_server/static/font/roboto/Roboto-Light.ttf diff --git a/static/font/roboto/Roboto-Light.woff b/picobrew_server/static/font/roboto/Roboto-Light.woff similarity index 100% rename from static/font/roboto/Roboto-Light.woff rename to picobrew_server/static/font/roboto/Roboto-Light.woff diff --git a/static/font/roboto/Roboto-Light.woff2 b/picobrew_server/static/font/roboto/Roboto-Light.woff2 similarity index 100% rename from static/font/roboto/Roboto-Light.woff2 rename to picobrew_server/static/font/roboto/Roboto-Light.woff2 diff --git a/static/font/roboto/Roboto-Medium.ttf b/picobrew_server/static/font/roboto/Roboto-Medium.ttf similarity index 100% rename from static/font/roboto/Roboto-Medium.ttf rename to picobrew_server/static/font/roboto/Roboto-Medium.ttf diff --git a/static/font/roboto/Roboto-Medium.woff b/picobrew_server/static/font/roboto/Roboto-Medium.woff similarity index 100% rename from static/font/roboto/Roboto-Medium.woff rename to picobrew_server/static/font/roboto/Roboto-Medium.woff diff --git a/static/font/roboto/Roboto-Medium.woff2 b/picobrew_server/static/font/roboto/Roboto-Medium.woff2 similarity index 100% rename from static/font/roboto/Roboto-Medium.woff2 rename to picobrew_server/static/font/roboto/Roboto-Medium.woff2 diff --git a/static/font/roboto/Roboto-Regular.ttf b/picobrew_server/static/font/roboto/Roboto-Regular.ttf similarity index 100% rename from static/font/roboto/Roboto-Regular.ttf rename to picobrew_server/static/font/roboto/Roboto-Regular.ttf diff --git a/static/font/roboto/Roboto-Regular.woff b/picobrew_server/static/font/roboto/Roboto-Regular.woff similarity index 100% rename from static/font/roboto/Roboto-Regular.woff rename to picobrew_server/static/font/roboto/Roboto-Regular.woff diff --git a/static/font/roboto/Roboto-Regular.woff2 b/picobrew_server/static/font/roboto/Roboto-Regular.woff2 similarity index 100% rename from static/font/roboto/Roboto-Regular.woff2 rename to picobrew_server/static/font/roboto/Roboto-Regular.woff2 diff --git a/static/font/roboto/Roboto-Thin.ttf b/picobrew_server/static/font/roboto/Roboto-Thin.ttf similarity index 100% rename from static/font/roboto/Roboto-Thin.ttf rename to picobrew_server/static/font/roboto/Roboto-Thin.ttf diff --git a/static/font/roboto/Roboto-Thin.woff b/picobrew_server/static/font/roboto/Roboto-Thin.woff similarity index 100% rename from static/font/roboto/Roboto-Thin.woff rename to picobrew_server/static/font/roboto/Roboto-Thin.woff diff --git a/static/font/roboto/Roboto-Thin.woff2 b/picobrew_server/static/font/roboto/Roboto-Thin.woff2 similarity index 100% rename from static/font/roboto/Roboto-Thin.woff2 rename to picobrew_server/static/font/roboto/Roboto-Thin.woff2 diff --git a/static/img/LICENSE.txt b/picobrew_server/static/img/LICENSE.txt similarity index 100% rename from static/img/LICENSE.txt rename to picobrew_server/static/img/LICENSE.txt diff --git a/static/img/android-icon-144x144.png b/picobrew_server/static/img/android-icon-144x144.png similarity index 100% rename from static/img/android-icon-144x144.png rename to picobrew_server/static/img/android-icon-144x144.png diff --git a/static/img/android-icon-192x192.png b/picobrew_server/static/img/android-icon-192x192.png similarity index 100% rename from static/img/android-icon-192x192.png rename to picobrew_server/static/img/android-icon-192x192.png diff --git a/static/img/android-icon-36x36.png b/picobrew_server/static/img/android-icon-36x36.png similarity index 100% rename from static/img/android-icon-36x36.png rename to picobrew_server/static/img/android-icon-36x36.png diff --git a/static/img/android-icon-48x48.png b/picobrew_server/static/img/android-icon-48x48.png similarity index 100% rename from static/img/android-icon-48x48.png rename to picobrew_server/static/img/android-icon-48x48.png diff --git a/static/img/android-icon-72x72.png b/picobrew_server/static/img/android-icon-72x72.png similarity index 100% rename from static/img/android-icon-72x72.png rename to picobrew_server/static/img/android-icon-72x72.png diff --git a/static/img/android-icon-96x96.png b/picobrew_server/static/img/android-icon-96x96.png similarity index 100% rename from static/img/android-icon-96x96.png rename to picobrew_server/static/img/android-icon-96x96.png diff --git a/static/img/apple-icon-114x114.png b/picobrew_server/static/img/apple-icon-114x114.png similarity index 100% rename from static/img/apple-icon-114x114.png rename to picobrew_server/static/img/apple-icon-114x114.png diff --git a/static/img/apple-icon-72x72.png b/picobrew_server/static/img/apple-icon-72x72.png similarity index 100% rename from static/img/apple-icon-72x72.png rename to picobrew_server/static/img/apple-icon-72x72.png diff --git a/static/img/apple-icon.png b/picobrew_server/static/img/apple-icon.png similarity index 100% rename from static/img/apple-icon.png rename to picobrew_server/static/img/apple-icon.png diff --git a/static/img/favicon-16x16.png b/picobrew_server/static/img/favicon-16x16.png similarity index 100% rename from static/img/favicon-16x16.png rename to picobrew_server/static/img/favicon-16x16.png diff --git a/static/img/favicon-32x32.png b/picobrew_server/static/img/favicon-32x32.png similarity index 100% rename from static/img/favicon-32x32.png rename to picobrew_server/static/img/favicon-32x32.png diff --git a/static/img/favicon-96x96.png b/picobrew_server/static/img/favicon-96x96.png similarity index 100% rename from static/img/favicon-96x96.png rename to picobrew_server/static/img/favicon-96x96.png diff --git a/static/img/favicon.ico b/picobrew_server/static/img/favicon.ico similarity index 100% rename from static/img/favicon.ico rename to picobrew_server/static/img/favicon.ico diff --git a/static/img/favicon.png b/picobrew_server/static/img/favicon.png similarity index 100% rename from static/img/favicon.png rename to picobrew_server/static/img/favicon.png diff --git a/static/img/glass.svg b/picobrew_server/static/img/glass.svg similarity index 100% rename from static/img/glass.svg rename to picobrew_server/static/img/glass.svg diff --git a/static/img/grain.svg b/picobrew_server/static/img/grain.svg similarity index 100% rename from static/img/grain.svg rename to picobrew_server/static/img/grain.svg diff --git a/static/img/hop.svg b/picobrew_server/static/img/hop.svg similarity index 100% rename from static/img/hop.svg rename to picobrew_server/static/img/hop.svg diff --git a/static/js/materialize.min.js b/picobrew_server/static/js/materialize.min.js similarity index 100% rename from static/js/materialize.min.js rename to picobrew_server/static/js/materialize.min.js diff --git a/templates/404.html b/picobrew_server/templates/404.html similarity index 100% rename from templates/404.html rename to picobrew_server/templates/404.html diff --git a/templates/500.html b/picobrew_server/templates/500.html similarity index 100% rename from templates/500.html rename to picobrew_server/templates/500.html diff --git a/templates/base.html b/picobrew_server/templates/base.html similarity index 100% rename from templates/base.html rename to picobrew_server/templates/base.html diff --git a/templates/index.html b/picobrew_server/templates/index.html similarity index 100% rename from templates/index.html rename to picobrew_server/templates/index.html diff --git a/templates/navbar.html b/picobrew_server/templates/navbar.html similarity index 100% rename from templates/navbar.html rename to picobrew_server/templates/navbar.html diff --git a/templates/recipes.html b/picobrew_server/templates/recipes.html similarity index 100% rename from templates/recipes.html rename to picobrew_server/templates/recipes.html diff --git a/templates/upload.html b/picobrew_server/templates/upload.html similarity index 100% rename from templates/upload.html rename to picobrew_server/templates/upload.html diff --git a/templates/validate.html b/picobrew_server/templates/validate.html similarity index 100% rename from templates/validate.html rename to picobrew_server/templates/validate.html diff --git a/utils/__init__.py b/picobrew_server/utils/__init__.py similarity index 100% rename from utils/__init__.py rename to picobrew_server/utils/__init__.py diff --git a/utils/constants.py b/picobrew_server/utils/constants.py similarity index 100% rename from utils/constants.py rename to picobrew_server/utils/constants.py diff --git a/recipes/.gitkeep b/recipes/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..224a779 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[metadata] +description-file = README.md \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..f98c26d --- /dev/null +++ b/setup.py @@ -0,0 +1,52 @@ +import sys +import os +from setuptools import setup, find_packages +from setuptools.command.install import install + + +VERSION = "1.0.0" + + +def readme(): + """print long description""" + with open("README.md") as f: + return f.read() + + +class VerifyVersionCommand(install): + """Custom command to verify that the git tag matches our version""" + + description = "verify that the git tag matches our version" + + def run(self): + tag = os.getenv("CIRCLE_TAG") or os.getenv("GITHUB_REF") + + if tag != VERSION: + info = "Git tag: {0} does not match the version of this app: {1}".format( + tag, VERSION + ) + sys.exit(info) + + +setup( + name="picobrew_server", + packages=find_packages(), + include_package_data=True, + zip_safe=False, + install_requires=["flask",], + version=VERSION, + description="A reverse-engineered server for the Picobrew homebrewing machines", + long_description=readme(), + long_description_content_type="text/markdown", + author="Tom Herold", + author_email="heroldtom@gmail.com", + url="https://github.com/hotzenklotz/picobrew-server", + download_url="https://github.com/hotzenklotz/picobrew-server/tarball/{}".format( + VERSION + ), + cmdclass={"verify": VerifyVersionCommand}, + platforms="any", + keywords=["picobrew", "zymatic", "beerxml", "beer", "brewing"], + classifiers=["Programming Language :: Python",], + license="MIT", +) From 17e8206b311f32fec222214c2d95961404a89253 Mon Sep 17 00:00:00 2001 From: Tom Herold Date: Tue, 5 May 2020 13:37:59 +0200 Subject: [PATCH 02/10] added poetry package management --- .github/workflows/test_lint.yaml | 3 +- MANIFEST.in | 7 - Procfile | 1 - poetry.lock | 472 +++++++++++++++++++++++++++++++ pyproject.toml | 26 ++ requirements-dev.txt | 4 - requirements.txt | 6 - setup.cfg | 2 - setup.py | 52 ---- 9 files changed, 500 insertions(+), 73 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 Procfile create mode 100644 poetry.lock create mode 100644 pyproject.toml delete mode 100644 requirements-dev.txt delete mode 100644 requirements.txt delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.github/workflows/test_lint.yaml b/.github/workflows/test_lint.yaml index f93e4ab..288d4d5 100644 --- a/.github/workflows/test_lint.yaml +++ b/.github/workflows/test_lint.yaml @@ -24,7 +24,8 @@ jobs: - name: Install dependencies run: | source ~/.venv/bin/activate - pip install -r requirements-dev.txt + pip install poetry + poetry install - name: Check code formatting run: | diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 2a957a6..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -graft picobrew_server/static -graft picobrew_server/templates -graft picobrew_server/blueprints -graft picobrew_server/beerxml -graft picobrew_server/recipes -graft picobrew_server/sessions -global-exclude *.pyc \ No newline at end of file diff --git a/Procfile b/Procfile deleted file mode 100644 index f89c536..0000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: gunicorn server:app \ No newline at end of file diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..542cbed --- /dev/null +++ b/poetry.lock @@ -0,0 +1,472 @@ +[[package]] +category = "dev" +description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +name = "appdirs" +optional = false +python-versions = "*" +version = "1.4.3" + +[[package]] +category = "dev" +description = "An abstract syntax tree for Python with inference support." +name = "astroid" +optional = false +python-versions = ">=3.5.*" +version = "2.3.3" + +[package.dependencies] +lazy-object-proxy = ">=1.4.0,<1.5.0" +six = ">=1.12,<2.0" +wrapt = ">=1.11.0,<1.12.0" + +[package.dependencies.typed-ast] +python = "<3.8" +version = ">=1.4.0,<1.5" + +[[package]] +category = "dev" +description = "Classes Without Boilerplate" +name = "attrs" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "19.3.0" + +[package.extras] +azure-pipelines = ["coverage", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "pytest-azurepipelines"] +dev = ["coverage", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "sphinx", "pre-commit"] +docs = ["sphinx", "zope.interface"] +tests = ["coverage", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"] + +[[package]] +category = "dev" +description = "The uncompromising code formatter." +name = "black" +optional = false +python-versions = ">=3.6" +version = "19.10b0" + +[package.dependencies] +appdirs = "*" +attrs = ">=18.1.0" +click = ">=6.5" +pathspec = ">=0.6,<1" +regex = "*" +toml = ">=0.9.4" +typed-ast = ">=1.4.0" + +[package.extras] +d = ["aiohttp (>=3.3.2)", "aiohttp-cors"] + +[[package]] +category = "main" +description = "Composable command line interface toolkit" +name = "click" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +version = "7.1.2" + +[[package]] +category = "dev" +description = "Cross-platform colored terminal text." +marker = "sys_platform == \"win32\"" +name = "colorama" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +version = "0.4.3" + +[[package]] +category = "main" +description = "A simple framework for building complex web applications." +name = "flask" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +version = "1.1.2" + +[package.dependencies] +Jinja2 = ">=2.10.1" +Werkzeug = ">=0.15" +click = ">=5.1" +itsdangerous = ">=0.24" + +[package.extras] +dev = ["pytest", "coverage", "tox", "sphinx", "pallets-sphinx-themes", "sphinxcontrib-log-cabinet", "sphinx-issues"] +docs = ["sphinx", "pallets-sphinx-themes", "sphinxcontrib-log-cabinet", "sphinx-issues"] +dotenv = ["python-dotenv"] + +[[package]] +category = "main" +description = "A Flask extension adding a decorator for CORS support" +name = "flask-cors" +optional = false +python-versions = "*" +version = "3.0.8" + +[package.dependencies] +Flask = ">=0.9" +Six = "*" + +[[package]] +category = "dev" +description = "A Python utility / library to sort Python imports." +name = "isort" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "4.3.21" + +[package.extras] +pipfile = ["pipreqs", "requirementslib"] +pyproject = ["toml"] +requirements = ["pipreqs", "pip-api"] +xdg_home = ["appdirs (>=1.4.0)"] + +[[package]] +category = "main" +description = "Various helpers to pass data to untrusted environments and back." +name = "itsdangerous" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "1.1.0" + +[[package]] +category = "main" +description = "A very fast and expressive template engine." +name = "jinja2" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +version = "2.11.2" + +[package.dependencies] +MarkupSafe = ">=0.23" + +[package.extras] +i18n = ["Babel (>=0.8)"] + +[[package]] +category = "dev" +description = "A fast and thorough lazy object proxy." +name = "lazy-object-proxy" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "1.4.3" + +[[package]] +category = "main" +description = "Safely add untrusted strings to HTML/XML markup." +name = "markupsafe" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" +version = "1.1.1" + +[[package]] +category = "main" +description = "A lightweight library for converting complex datatypes to and from native Python datatypes." +name = "marshmallow" +optional = false +python-versions = ">=3.5" +version = "3.5.2" + +[package.extras] +dev = ["pytest", "pytz", "simplejson", "mypy (0.770)", "flake8 (3.7.9)", "flake8-bugbear (20.1.4)", "pre-commit (>=1.20,<3.0)", "tox"] +docs = ["sphinx (3.0.3)", "sphinx-issues (1.2.0)", "alabaster (0.7.12)", "sphinx-version-warning (1.1.2)"] +lint = ["mypy (0.770)", "flake8 (3.7.9)", "flake8-bugbear (20.1.4)", "pre-commit (>=1.20,<3.0)"] +tests = ["pytest", "pytz", "simplejson"] + +[[package]] +category = "dev" +description = "McCabe checker, plugin for flake8" +name = "mccabe" +optional = false +python-versions = "*" +version = "0.6.1" + +[[package]] +category = "dev" +description = "Utility library for gitignore style pattern matching of file paths." +name = "pathspec" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +version = "0.8.0" + +[[package]] +category = "main" +description = "A BeerXML Parser" +name = "pybeerxml" +optional = false +python-versions = "*" +version = "1.0.8" + +[package.extras] +testing = ["pytest"] + +[[package]] +category = "dev" +description = "python code static checker" +name = "pylint" +optional = false +python-versions = ">=3.5.*" +version = "2.4.4" + +[package.dependencies] +astroid = ">=2.3.0,<2.4" +colorama = "*" +isort = ">=4.2.5,<5" +mccabe = ">=0.6,<0.7" + +[[package]] +category = "dev" +description = "Alternative regular expression module, to replace re." +name = "regex" +optional = false +python-versions = "*" +version = "2020.4.4" + +[[package]] +category = "main" +description = "Python 2 and 3 compatibility utilities" +name = "six" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +version = "1.14.0" + +[[package]] +category = "dev" +description = "Python Library for Tom's Obvious, Minimal Language" +name = "toml" +optional = false +python-versions = "*" +version = "0.10.0" + +[[package]] +category = "dev" +description = "a fork of Python 2 and 3 ast modules with type comment support" +name = "typed-ast" +optional = false +python-versions = "*" +version = "1.4.1" + +[[package]] +category = "main" +description = "Declarative parsing and validation of HTTP request objects, with built-in support for popular web frameworks, including Flask, Django, Bottle, Tornado, Pyramid, webapp2, Falcon, and aiohttp." +name = "webargs" +optional = false +python-versions = ">=3.5" +version = "6.0.0" + +[package.dependencies] +marshmallow = ">=2.15.2" + +[package.extras] +dev = ["pytest", "webtest (2.0.34)", "webtest-aiohttp (2.0.0)", "pytest-aiohttp (>=0.3.0)", "Flask (>=0.12.2)", "Django (>=1.11.16)", "bottle (>=0.12.13)", "tornado (>=4.5.2)", "pyramid (>=1.9.1)", "webapp2 (>=3.0.0b1)", "falcon (>=2.0.0)", "aiohttp (>=3.0.0)", "mypy (0.761)", "flake8 (3.7.9)", "flake8-bugbear (20.1.4)", "pre-commit (>=1.20,<3.0)", "tox", "mock"] +docs = ["Sphinx (2.4.3)", "sphinx-issues (1.2.0)", "sphinx-typlog-theme (0.8.0)", "Flask (>=0.12.2)", "Django (>=1.11.16)", "bottle (>=0.12.13)", "tornado (>=4.5.2)", "pyramid (>=1.9.1)", "webapp2 (>=3.0.0b1)", "falcon (>=2.0.0)", "aiohttp (>=3.0.0)"] +frameworks = ["Flask (>=0.12.2)", "Django (>=1.11.16)", "bottle (>=0.12.13)", "tornado (>=4.5.2)", "pyramid (>=1.9.1)", "webapp2 (>=3.0.0b1)", "falcon (>=2.0.0)", "aiohttp (>=3.0.0)"] +lint = ["mypy (0.761)", "flake8 (3.7.9)", "flake8-bugbear (20.1.4)", "pre-commit (>=1.20,<3.0)"] +tests = ["pytest", "webtest (2.0.34)", "webtest-aiohttp (2.0.0)", "pytest-aiohttp (>=0.3.0)", "Flask (>=0.12.2)", "Django (>=1.11.16)", "bottle (>=0.12.13)", "tornado (>=4.5.2)", "pyramid (>=1.9.1)", "webapp2 (>=3.0.0b1)", "falcon (>=2.0.0)", "aiohttp (>=3.0.0)", "mock"] + +[[package]] +category = "main" +description = "The comprehensive WSGI web application library." +name = "werkzeug" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +version = "1.0.1" + +[package.extras] +dev = ["pytest", "pytest-timeout", "coverage", "tox", "sphinx", "pallets-sphinx-themes", "sphinx-issues"] +watchdog = ["watchdog"] + +[[package]] +category = "dev" +description = "Module for decorators, wrappers and monkey patching." +name = "wrapt" +optional = false +python-versions = "*" +version = "1.11.2" + +[metadata] +content-hash = "405e30386e78f2eeaca67e0725d39b3246b1d66fd2aa8c489776d511131403aa" +python-versions = "^3.7" + +[metadata.files] +appdirs = [ + {file = "appdirs-1.4.3-py2.py3-none-any.whl", hash = "sha256:d8b24664561d0d34ddfaec54636d502d7cea6e29c3eaf68f3df6180863e2166e"}, + {file = "appdirs-1.4.3.tar.gz", hash = "sha256:9e5896d1372858f8dd3344faf4e5014d21849c756c8d5701f78f8a103b372d92"}, +] +astroid = [ + {file = "astroid-2.3.3-py3-none-any.whl", hash = "sha256:840947ebfa8b58f318d42301cf8c0a20fd794a33b61cc4638e28e9e61ba32f42"}, + {file = "astroid-2.3.3.tar.gz", hash = "sha256:71ea07f44df9568a75d0f354c49143a4575d90645e9fead6dfb52c26a85ed13a"}, +] +attrs = [ + {file = "attrs-19.3.0-py2.py3-none-any.whl", hash = "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c"}, + {file = "attrs-19.3.0.tar.gz", hash = "sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72"}, +] +black = [ + {file = "black-19.10b0-py36-none-any.whl", hash = "sha256:1b30e59be925fafc1ee4565e5e08abef6b03fe455102883820fe5ee2e4734e0b"}, + {file = "black-19.10b0.tar.gz", hash = "sha256:c2edb73a08e9e0e6f65a0e6af18b059b8b1cdd5bef997d7a0b181df93dc81539"}, +] +click = [ + {file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"}, + {file = "click-7.1.2.tar.gz", hash = "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"}, +] +colorama = [ + {file = "colorama-0.4.3-py2.py3-none-any.whl", hash = "sha256:7d73d2a99753107a36ac6b455ee49046802e59d9d076ef8e47b61499fa29afff"}, + {file = "colorama-0.4.3.tar.gz", hash = "sha256:e96da0d330793e2cb9485e9ddfd918d456036c7149416295932478192f4436a1"}, +] +flask = [ + {file = "Flask-1.1.2-py2.py3-none-any.whl", hash = "sha256:8a4fdd8936eba2512e9c85df320a37e694c93945b33ef33c89946a340a238557"}, + {file = "Flask-1.1.2.tar.gz", hash = "sha256:4efa1ae2d7c9865af48986de8aeb8504bf32c7f3d6fdc9353d34b21f4b127060"}, +] +flask-cors = [ + {file = "Flask-Cors-3.0.8.tar.gz", hash = "sha256:72170423eb4612f0847318afff8c247b38bd516b7737adfc10d1c2cdbb382d16"}, + {file = "Flask_Cors-3.0.8-py2.py3-none-any.whl", hash = "sha256:f4d97201660e6bbcff2d89d082b5b6d31abee04b1b3003ee073a6fd25ad1d69a"}, +] +isort = [ + {file = "isort-4.3.21-py2.py3-none-any.whl", hash = "sha256:6e811fcb295968434526407adb8796944f1988c5b65e8139058f2014cbe100fd"}, + {file = "isort-4.3.21.tar.gz", hash = "sha256:54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1"}, +] +itsdangerous = [ + {file = "itsdangerous-1.1.0-py2.py3-none-any.whl", hash = "sha256:b12271b2047cb23eeb98c8b5622e2e5c5e9abd9784a153e9d8ef9cb4dd09d749"}, + {file = "itsdangerous-1.1.0.tar.gz", hash = "sha256:321b033d07f2a4136d3ec762eac9f16a10ccd60f53c0c91af90217ace7ba1f19"}, +] +jinja2 = [ + {file = "Jinja2-2.11.2-py2.py3-none-any.whl", hash = "sha256:f0a4641d3cf955324a89c04f3d94663aa4d638abe8f733ecd3582848e1c37035"}, + {file = "Jinja2-2.11.2.tar.gz", hash = "sha256:89aab215427ef59c34ad58735269eb58b1a5808103067f7bb9d5836c651b3bb0"}, +] +lazy-object-proxy = [ + {file = "lazy-object-proxy-1.4.3.tar.gz", hash = "sha256:f3900e8a5de27447acbf900b4750b0ddfd7ec1ea7fbaf11dfa911141bc522af0"}, + {file = "lazy_object_proxy-1.4.3-cp27-cp27m-macosx_10_13_x86_64.whl", hash = "sha256:a2238e9d1bb71a56cd710611a1614d1194dc10a175c1e08d75e1a7bcc250d442"}, + {file = "lazy_object_proxy-1.4.3-cp27-cp27m-win32.whl", hash = "sha256:efa1909120ce98bbb3777e8b6f92237f5d5c8ea6758efea36a473e1d38f7d3e4"}, + {file = "lazy_object_proxy-1.4.3-cp27-cp27m-win_amd64.whl", hash = "sha256:4677f594e474c91da97f489fea5b7daa17b5517190899cf213697e48d3902f5a"}, + {file = "lazy_object_proxy-1.4.3-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:0c4b206227a8097f05c4dbdd323c50edf81f15db3b8dc064d08c62d37e1a504d"}, + {file = "lazy_object_proxy-1.4.3-cp34-cp34m-manylinux1_x86_64.whl", hash = "sha256:d945239a5639b3ff35b70a88c5f2f491913eb94871780ebfabb2568bd58afc5a"}, + {file = "lazy_object_proxy-1.4.3-cp34-cp34m-win32.whl", hash = "sha256:9651375199045a358eb6741df3e02a651e0330be090b3bc79f6d0de31a80ec3e"}, + {file = "lazy_object_proxy-1.4.3-cp34-cp34m-win_amd64.whl", hash = "sha256:eba7011090323c1dadf18b3b689845fd96a61ba0a1dfbd7f24b921398affc357"}, + {file = "lazy_object_proxy-1.4.3-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:48dab84ebd4831077b150572aec802f303117c8cc5c871e182447281ebf3ac50"}, + {file = "lazy_object_proxy-1.4.3-cp35-cp35m-win32.whl", hash = "sha256:ca0a928a3ddbc5725be2dd1cf895ec0a254798915fb3a36af0964a0a4149e3db"}, + {file = "lazy_object_proxy-1.4.3-cp35-cp35m-win_amd64.whl", hash = "sha256:194d092e6f246b906e8f70884e620e459fc54db3259e60cf69a4d66c3fda3449"}, + {file = "lazy_object_proxy-1.4.3-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:97bb5884f6f1cdce0099f86b907aa41c970c3c672ac8b9c8352789e103cf3156"}, + {file = "lazy_object_proxy-1.4.3-cp36-cp36m-win32.whl", hash = "sha256:cb2c7c57005a6804ab66f106ceb8482da55f5314b7fcb06551db1edae4ad1531"}, + {file = "lazy_object_proxy-1.4.3-cp36-cp36m-win_amd64.whl", hash = "sha256:8d859b89baf8ef7f8bc6b00aa20316483d67f0b1cbf422f5b4dc56701c8f2ffb"}, + {file = "lazy_object_proxy-1.4.3-cp37-cp37m-macosx_10_13_x86_64.whl", hash = "sha256:1be7e4c9f96948003609aa6c974ae59830a6baecc5376c25c92d7d697e684c08"}, + {file = "lazy_object_proxy-1.4.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:d74bb8693bf9cf75ac3b47a54d716bbb1a92648d5f781fc799347cfc95952383"}, + {file = "lazy_object_proxy-1.4.3-cp37-cp37m-win32.whl", hash = "sha256:9b15f3f4c0f35727d3a0fba4b770b3c4ebbb1fa907dbcc046a1d2799f3edd142"}, + {file = "lazy_object_proxy-1.4.3-cp37-cp37m-win_amd64.whl", hash = "sha256:9254f4358b9b541e3441b007a0ea0764b9d056afdeafc1a5569eee1cc6c1b9ea"}, + {file = "lazy_object_proxy-1.4.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:a6ae12d08c0bf9909ce12385803a543bfe99b95fe01e752536a60af2b7797c62"}, + {file = "lazy_object_proxy-1.4.3-cp38-cp38-win32.whl", hash = "sha256:5541cada25cd173702dbd99f8e22434105456314462326f06dba3e180f203dfd"}, + {file = "lazy_object_proxy-1.4.3-cp38-cp38-win_amd64.whl", hash = "sha256:59f79fef100b09564bc2df42ea2d8d21a64fdcda64979c0fa3db7bdaabaf6239"}, +] +markupsafe = [ + {file = "MarkupSafe-1.1.1-cp27-cp27m-macosx_10_6_intel.whl", hash = "sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161"}, + {file = "MarkupSafe-1.1.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7"}, + {file = "MarkupSafe-1.1.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183"}, + {file = "MarkupSafe-1.1.1-cp27-cp27m-win32.whl", hash = "sha256:b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b"}, + {file = "MarkupSafe-1.1.1-cp27-cp27m-win_amd64.whl", hash = "sha256:98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e"}, + {file = "MarkupSafe-1.1.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f"}, + {file = "MarkupSafe-1.1.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1"}, + {file = "MarkupSafe-1.1.1-cp34-cp34m-macosx_10_6_intel.whl", hash = "sha256:1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5"}, + {file = "MarkupSafe-1.1.1-cp34-cp34m-manylinux1_i686.whl", hash = "sha256:62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1"}, + {file = "MarkupSafe-1.1.1-cp34-cp34m-manylinux1_x86_64.whl", hash = "sha256:88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735"}, + {file = "MarkupSafe-1.1.1-cp34-cp34m-win32.whl", hash = "sha256:ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21"}, + {file = "MarkupSafe-1.1.1-cp34-cp34m-win_amd64.whl", hash = "sha256:09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235"}, + {file = "MarkupSafe-1.1.1-cp35-cp35m-macosx_10_6_intel.whl", hash = "sha256:79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b"}, + {file = "MarkupSafe-1.1.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f"}, + {file = "MarkupSafe-1.1.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905"}, + {file = "MarkupSafe-1.1.1-cp35-cp35m-win32.whl", hash = "sha256:6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1"}, + {file = "MarkupSafe-1.1.1-cp35-cp35m-win_amd64.whl", hash = "sha256:9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d"}, + {file = "MarkupSafe-1.1.1-cp36-cp36m-macosx_10_6_intel.whl", hash = "sha256:24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff"}, + {file = "MarkupSafe-1.1.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473"}, + {file = "MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e"}, + {file = "MarkupSafe-1.1.1-cp36-cp36m-win32.whl", hash = "sha256:535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66"}, + {file = "MarkupSafe-1.1.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5"}, + {file = "MarkupSafe-1.1.1-cp37-cp37m-macosx_10_6_intel.whl", hash = "sha256:8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d"}, + {file = "MarkupSafe-1.1.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e"}, + {file = "MarkupSafe-1.1.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6"}, + {file = "MarkupSafe-1.1.1-cp37-cp37m-win32.whl", hash = "sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2"}, + {file = "MarkupSafe-1.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c"}, + {file = "MarkupSafe-1.1.1.tar.gz", hash = "sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b"}, +] +marshmallow = [ + {file = "marshmallow-3.5.2-py2.py3-none-any.whl", hash = "sha256:f12203bf8d94c410ab4b8d66edfde4f8a364892bde1f6747179765559f93d62a"}, + {file = "marshmallow-3.5.2.tar.gz", hash = "sha256:56663fa1d5385c14c6a1236badd166d6dee987a5f64d2b6cc099dadf96eb4f09"}, +] +mccabe = [ + {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, + {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, +] +pathspec = [ + {file = "pathspec-0.8.0-py2.py3-none-any.whl", hash = "sha256:7d91249d21749788d07a2d0f94147accd8f845507400749ea19c1ec9054a12b0"}, + {file = "pathspec-0.8.0.tar.gz", hash = "sha256:da45173eb3a6f2a5a487efba21f050af2b41948be6ab52b6a1e3ff22bb8b7061"}, +] +pybeerxml = [ + {file = "pybeerxml-1.0.8-py3-none-any.whl", hash = "sha256:3763bc24b2a83321dc500013dc80a5c534f8b75d349ef5bd465b6a415644cb8b"}, + {file = "pybeerxml-1.0.8.tar.gz", hash = "sha256:fb7c9042c7f0d0d9125a6fb3b4b2755f834e182aca239e3496c2975afe142731"}, +] +pylint = [ + {file = "pylint-2.4.4-py3-none-any.whl", hash = "sha256:886e6afc935ea2590b462664b161ca9a5e40168ea99e5300935f6591ad467df4"}, + {file = "pylint-2.4.4.tar.gz", hash = "sha256:3db5468ad013380e987410a8d6956226963aed94ecb5f9d3a28acca6d9ac36cd"}, +] +regex = [ + {file = "regex-2020.4.4-cp27-cp27m-win32.whl", hash = "sha256:90742c6ff121a9c5b261b9b215cb476eea97df98ea82037ec8ac95d1be7a034f"}, + {file = "regex-2020.4.4-cp27-cp27m-win_amd64.whl", hash = "sha256:24f4f4062eb16c5bbfff6a22312e8eab92c2c99c51a02e39b4eae54ce8255cd1"}, + {file = "regex-2020.4.4-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:08119f707f0ebf2da60d2f24c2f39ca616277bb67ef6c92b72cbf90cbe3a556b"}, + {file = "regex-2020.4.4-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:c9423a150d3a4fc0f3f2aae897a59919acd293f4cb397429b120a5fcd96ea3db"}, + {file = "regex-2020.4.4-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:c087bff162158536387c53647411db09b6ee3f9603c334c90943e97b1052a156"}, + {file = "regex-2020.4.4-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:1cbe0fa0b7f673400eb29e9ef41d4f53638f65f9a2143854de6b1ce2899185c3"}, + {file = "regex-2020.4.4-cp36-cp36m-win32.whl", hash = "sha256:0ce9537396d8f556bcfc317c65b6a0705320701e5ce511f05fc04421ba05b8a8"}, + {file = "regex-2020.4.4-cp36-cp36m-win_amd64.whl", hash = "sha256:7e1037073b1b7053ee74c3c6c0ada80f3501ec29d5f46e42669378eae6d4405a"}, + {file = "regex-2020.4.4-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:4385f12aa289d79419fede43f979e372f527892ac44a541b5446617e4406c468"}, + {file = "regex-2020.4.4-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:a58dd45cb865be0ce1d5ecc4cfc85cd8c6867bea66733623e54bd95131f473b6"}, + {file = "regex-2020.4.4-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:ccccdd84912875e34c5ad2d06e1989d890d43af6c2242c6fcfa51556997af6cd"}, + {file = "regex-2020.4.4-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:ea4adf02d23b437684cd388d557bf76e3afa72f7fed5bbc013482cc00c816948"}, + {file = "regex-2020.4.4-cp37-cp37m-win32.whl", hash = "sha256:2294f8b70e058a2553cd009df003a20802ef75b3c629506be20687df0908177e"}, + {file = "regex-2020.4.4-cp37-cp37m-win_amd64.whl", hash = "sha256:e91ba11da11cf770f389e47c3f5c30473e6d85e06d7fd9dcba0017d2867aab4a"}, + {file = "regex-2020.4.4-cp38-cp38-manylinux1_i686.whl", hash = "sha256:5635cd1ed0a12b4c42cce18a8d2fb53ff13ff537f09de5fd791e97de27b6400e"}, + {file = "regex-2020.4.4-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:23069d9c07e115537f37270d1d5faea3e0bdded8279081c4d4d607a2ad393683"}, + {file = "regex-2020.4.4-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:c162a21e0da33eb3d31a3ac17a51db5e634fc347f650d271f0305d96601dc15b"}, + {file = "regex-2020.4.4-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:fb95debbd1a824b2c4376932f2216cc186912e389bdb0e27147778cf6acb3f89"}, + {file = "regex-2020.4.4-cp38-cp38-win32.whl", hash = "sha256:2a3bf8b48f8e37c3a40bb3f854bf0121c194e69a650b209628d951190b862de3"}, + {file = "regex-2020.4.4-cp38-cp38-win_amd64.whl", hash = "sha256:5bfed051dbff32fd8945eccca70f5e22b55e4148d2a8a45141a3b053d6455ae3"}, + {file = "regex-2020.4.4.tar.gz", hash = "sha256:295badf61a51add2d428a46b8580309c520d8b26e769868b922750cf3ce67142"}, +] +six = [ + {file = "six-1.14.0-py2.py3-none-any.whl", hash = "sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c"}, + {file = "six-1.14.0.tar.gz", hash = "sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a"}, +] +toml = [ + {file = "toml-0.10.0-py2.7.egg", hash = "sha256:f1db651f9657708513243e61e6cc67d101a39bad662eaa9b5546f789338e07a3"}, + {file = "toml-0.10.0-py2.py3-none-any.whl", hash = "sha256:235682dd292d5899d361a811df37e04a8828a5b1da3115886b73cf81ebc9100e"}, + {file = "toml-0.10.0.tar.gz", hash = "sha256:229f81c57791a41d65e399fc06bf0848bab550a9dfd5ed66df18ce5f05e73d5c"}, +] +typed-ast = [ + {file = "typed_ast-1.4.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:73d785a950fc82dd2a25897d525d003f6378d1cb23ab305578394694202a58c3"}, + {file = "typed_ast-1.4.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:aaee9905aee35ba5905cfb3c62f3e83b3bec7b39413f0a7f19be4e547ea01ebb"}, + {file = "typed_ast-1.4.1-cp35-cp35m-win32.whl", hash = "sha256:0c2c07682d61a629b68433afb159376e24e5b2fd4641d35424e462169c0a7919"}, + {file = "typed_ast-1.4.1-cp35-cp35m-win_amd64.whl", hash = "sha256:4083861b0aa07990b619bd7ddc365eb7fa4b817e99cf5f8d9cf21a42780f6e01"}, + {file = "typed_ast-1.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:269151951236b0f9a6f04015a9004084a5ab0d5f19b57de779f908621e7d8b75"}, + {file = "typed_ast-1.4.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:24995c843eb0ad11a4527b026b4dde3da70e1f2d8806c99b7b4a7cf491612652"}, + {file = "typed_ast-1.4.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:fe460b922ec15dd205595c9b5b99e2f056fd98ae8f9f56b888e7a17dc2b757e7"}, + {file = "typed_ast-1.4.1-cp36-cp36m-win32.whl", hash = "sha256:4e3e5da80ccbebfff202a67bf900d081906c358ccc3d5e3c8aea42fdfdfd51c1"}, + {file = "typed_ast-1.4.1-cp36-cp36m-win_amd64.whl", hash = "sha256:249862707802d40f7f29f6e1aad8d84b5aa9e44552d2cc17384b209f091276aa"}, + {file = "typed_ast-1.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8ce678dbaf790dbdb3eba24056d5364fb45944f33553dd5869b7580cdbb83614"}, + {file = "typed_ast-1.4.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:c9e348e02e4d2b4a8b2eedb48210430658df6951fa484e59de33ff773fbd4b41"}, + {file = "typed_ast-1.4.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:bcd3b13b56ea479b3650b82cabd6b5343a625b0ced5429e4ccad28a8973f301b"}, + {file = "typed_ast-1.4.1-cp37-cp37m-win32.whl", hash = "sha256:d5d33e9e7af3b34a40dc05f498939f0ebf187f07c385fd58d591c533ad8562fe"}, + {file = "typed_ast-1.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:0666aa36131496aed8f7be0410ff974562ab7eeac11ef351def9ea6fa28f6355"}, + {file = "typed_ast-1.4.1-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:d205b1b46085271b4e15f670058ce182bd1199e56b317bf2ec004b6a44f911f6"}, + {file = "typed_ast-1.4.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:6daac9731f172c2a22ade6ed0c00197ee7cc1221aa84cfdf9c31defeb059a907"}, + {file = "typed_ast-1.4.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:498b0f36cc7054c1fead3d7fc59d2150f4d5c6c56ba7fb150c013fbc683a8d2d"}, + {file = "typed_ast-1.4.1-cp38-cp38-win32.whl", hash = "sha256:715ff2f2df46121071622063fc7543d9b1fd19ebfc4f5c8895af64a77a8c852c"}, + {file = "typed_ast-1.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:fc0fea399acb12edbf8a628ba8d2312f583bdbdb3335635db062fa98cf71fca4"}, + {file = "typed_ast-1.4.1-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34"}, + {file = "typed_ast-1.4.1.tar.gz", hash = "sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b"}, +] +webargs = [ + {file = "webargs-6.0.0-py2.py3-none-any.whl", hash = "sha256:dfe01cd3711cee9a3651bfd5ca67770ace4a6f35f3cae583aa8400bbf7706bb4"}, + {file = "webargs-6.0.0.tar.gz", hash = "sha256:d66a056b3a40c5a3774a650fd349db5970cd91fa8f04ac50d00582c949b45b26"}, +] +werkzeug = [ + {file = "Werkzeug-1.0.1-py2.py3-none-any.whl", hash = "sha256:2de2a5db0baeae7b2d2664949077c2ac63fbd16d98da0ff71837f7d1dea3fd43"}, + {file = "Werkzeug-1.0.1.tar.gz", hash = "sha256:6c80b1e5ad3665290ea39320b91e1be1e0d5f60652b964a3070216de83d2e47c"}, +] +wrapt = [ + {file = "wrapt-1.11.2.tar.gz", hash = "sha256:565a021fd19419476b9362b05eeaa094178de64f8361e44468f9e9d7843901e1"}, +] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e3d9a7d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,26 @@ +[tool.poetry] +name = "picobrew_server" +version = "1.0.0" +description = "A reverse-engineered server for the Picobrew homebrewing machines" +authors = ["Tom Herold "] +repository = "https://github.com/hotzenklotz/picobrew-server" +keywords = ["picobrew", "zymatic", "homebrewing", "beerxml"] +license = "MIT" + +[tool.poetry.dependencies] +python = "^3.7" +Flask = "1.1.2" +Flask-Cors = "3.0.8" +webargs = "6.0.0" +Werkzeug = "1.0.1" +pybeerxml = "^1.0.8" + + +[tool.poetry.dev-dependencies] +black = "^19.10b0" +pylint = "^2.4.4" +mypy = "^0.770" + +[build-system] +requires = ["poetry>=0.12"] +build-backend = "poetry.masonry.api" diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 9630684..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,4 +0,0 @@ --r requirements.txt -black==19.10b0 -mypy==0.770 -pylint==2.4.4 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 45d5d22..0000000 --- a/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -Flask == 1.1.2 -Flask-Cors == 3.0.8 -webargs == 6.0.0 -Werkzeug == 1.0.1 -pybeerxml == 1.0.7 -gunicorn == 20.0.4 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 224a779..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[metadata] -description-file = README.md \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index f98c26d..0000000 --- a/setup.py +++ /dev/null @@ -1,52 +0,0 @@ -import sys -import os -from setuptools import setup, find_packages -from setuptools.command.install import install - - -VERSION = "1.0.0" - - -def readme(): - """print long description""" - with open("README.md") as f: - return f.read() - - -class VerifyVersionCommand(install): - """Custom command to verify that the git tag matches our version""" - - description = "verify that the git tag matches our version" - - def run(self): - tag = os.getenv("CIRCLE_TAG") or os.getenv("GITHUB_REF") - - if tag != VERSION: - info = "Git tag: {0} does not match the version of this app: {1}".format( - tag, VERSION - ) - sys.exit(info) - - -setup( - name="picobrew_server", - packages=find_packages(), - include_package_data=True, - zip_safe=False, - install_requires=["flask",], - version=VERSION, - description="A reverse-engineered server for the Picobrew homebrewing machines", - long_description=readme(), - long_description_content_type="text/markdown", - author="Tom Herold", - author_email="heroldtom@gmail.com", - url="https://github.com/hotzenklotz/picobrew-server", - download_url="https://github.com/hotzenklotz/picobrew-server/tarball/{}".format( - VERSION - ), - cmdclass={"verify": VerifyVersionCommand}, - platforms="any", - keywords=["picobrew", "zymatic", "beerxml", "beer", "brewing"], - classifiers=["Programming Language :: Python",], - license="MIT", -) From 7206384a62f9de87ef4953d56a7ce95040af6a12 Mon Sep 17 00:00:00 2001 From: Tom Herold Date: Tue, 5 May 2020 14:03:22 +0200 Subject: [PATCH 03/10] updated readme --- .github/workflows/test_lint.yaml | 8 ++--- README.md | 48 +++++++++++++++++++++----- lint.sh | 5 --- picobrew_server/__init__.py | 1 - picobrew_server/blueprints/frontend.py | 2 +- pyproject.toml | 1 + 6 files changed, 45 insertions(+), 20 deletions(-) delete mode 100755 lint.sh diff --git a/.github/workflows/test_lint.yaml b/.github/workflows/test_lint.yaml index 288d4d5..39f1f0c 100644 --- a/.github/workflows/test_lint.yaml +++ b/.github/workflows/test_lint.yaml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.6, 3.7] + python-version: [3.6, 3.7, 3.8] steps: - uses: actions/checkout@v1 @@ -30,15 +30,15 @@ jobs: - name: Check code formatting run: | source ~/.venv/bin/activate - python -m black . + python -m black picobrew_server - name: Lint code run: | source ~/.venv/bin/activate - ./lint.sh + python -m pylint picobrew_server - name: Check typing run: | source ~/.venv/bin/activate - python -m mypy . + python -m mypy picobrew_server diff --git a/README.md b/README.md index d964b96..97b0fc1 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,57 @@ # picobrew-server + + + This project reverse-engineers a server for the proprietary PicoBrew protocol for use with the [PicoBrew Zymatic](http://www.picobrew.com/), a homebrewing machine. It is intended to provide an alternative to run the machine without a connection to the official servers at picobrew.com. Run your own server and sync your recipes offline. # HTTP API The PicoBrew Zymatic's built-in Ardunio uses an unencrypted HTTP communication protocol. All request are `GET` requests and are not authenticated. The following documentation is based on Firmware 1.1.8. -- [API Docs on Postman](https://documenter.getpostman.com/view/234053/Szf54VEX?version=latest) -- [API Docs on GitHub](https://github.com/hotzenklotz/picobrew-server/wiki/PicoBrew-API) +- [PicoBrew Zymatic API Docs on Postman](https://documenter.getpostman.com/view/234053/Szf54VEX?version=latest) +- [PicoBrew Zymatic API Docs on GitHub](https://github.com/hotzenklotz/picobrew-server/wiki/PicoBrew-API) # Installation -- Install Python 3.7 - -``` -// Install Python requirements -pip install -r requirements.txt +1. Install Python 3.7 +2. In a terminal download, install and run the project: +```bash +// Download and +pip install picobrew_server -// Start the server -sudo python server.py +// Start the server in production mode on port 80 +FLASK_APP=picobrew_server flask run --port 80 --host 0.0.0.0 ``` - Connect the PicoBrew machine to your computer and enable DNS spoofing. Re-route `www.picobrew.com` to your computer. [More Details](https://github.com/hotzenklotz/picobrew-server/wiki/Install) +# Development + +1. Install Python 3.7 & [Poetry](https://python-poetry.org/): + +```bash +pip install poetry +``` + +2. Install all dependecies: + +```bash +poetry install + +// Start the server on http://localhost:5000 +FLASK_APP=picobrew_server flask run +``` + +3. Lint, Format, and Type Check changes: +``` +pylint picobrew_server +black picobrew_server +mypy picobrew_server +``` + + # Demo You can try out the admin UI for uploading your XML files in this [online demo](https://picobrew.herokuapp.com). Please note, this website is for showcasing only and you should deploy your own version. @@ -50,6 +78,8 @@ ToDo # Disclaimer This software is provided "as is" and any expressed or implied warranties are disclaimed. This software submits recipes with temperature targets to your PicoBrew machine and will cause it to heat water. Any damage to your PicoBrew machine is at your own risk. +If the Zymatic faults and the screen goes blank, DON'T leave it powered on. The circulating pump will shut off and the heater stays on. A tube in the glycol loop may rupture. + # License MIT @ Tom Herold diff --git a/lint.sh b/lint.sh deleted file mode 100755 index 789be86..0000000 --- a/lint.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -set -eEuo pipefail -# Pylint doesn't lint files in directories that don't have an __init__.py -# This will maybe be fixed by https://github.com/PyCQA/pylint/issues/352 -find . -not -path '*/\.*' -type f -name '*.py' | xargs python -m pylint \ No newline at end of file diff --git a/picobrew_server/__init__.py b/picobrew_server/__init__.py index 13b2334..de1792c 100755 --- a/picobrew_server/__init__.py +++ b/picobrew_server/__init__.py @@ -14,4 +14,3 @@ app.register_blueprint(frontend.frontend) app.register_blueprint(errors.errors) app.register_blueprint(picobrew_api.picobrew_api) - diff --git a/picobrew_server/blueprints/frontend.py b/picobrew_server/blueprints/frontend.py index 1adbf4d..0d84e0d 100644 --- a/picobrew_server/blueprints/frontend.py +++ b/picobrew_server/blueprints/frontend.py @@ -56,7 +56,7 @@ def upload_recipe(): file_directory = Path("recipes") file_directory.mkdir(exist_ok=True) - + filename = file_directory.joinpath(secure_filename(file.filename)) if filename.suffix in ALLOWED_FILE_EXTENSIONS: diff --git a/pyproject.toml b/pyproject.toml index e3d9a7d..6c4d9df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,7 @@ authors = ["Tom Herold "] repository = "https://github.com/hotzenklotz/picobrew-server" keywords = ["picobrew", "zymatic", "homebrewing", "beerxml"] license = "MIT" +readme = "README.md" [tool.poetry.dependencies] python = "^3.7" From de5df75557072dc3964544b8275a4bf297b8e5bd Mon Sep 17 00:00:00 2001 From: Tom Herold Date: Tue, 5 May 2020 14:23:53 +0200 Subject: [PATCH 04/10] update poetry lockfile --- poetry.lock | 82 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 70 insertions(+), 12 deletions(-) diff --git a/poetry.lock b/poetry.lock index 542cbed..ebbcaa3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -11,13 +11,13 @@ category = "dev" description = "An abstract syntax tree for Python with inference support." name = "astroid" optional = false -python-versions = ">=3.5.*" -version = "2.3.3" +python-versions = ">=3.5" +version = "2.4.1" [package.dependencies] lazy-object-proxy = ">=1.4.0,<1.5.0" six = ">=1.12,<2.0" -wrapt = ">=1.11.0,<1.12.0" +wrapt = ">=1.11,<2.0" [package.dependencies.typed-ast] python = "<3.8" @@ -179,6 +179,30 @@ optional = false python-versions = "*" version = "0.6.1" +[[package]] +category = "dev" +description = "Optional static typing for Python" +name = "mypy" +optional = false +python-versions = ">=3.5" +version = "0.770" + +[package.dependencies] +mypy-extensions = ">=0.4.3,<0.5.0" +typed-ast = ">=1.4.0,<1.5.0" +typing-extensions = ">=3.7.4" + +[package.extras] +dmypy = ["psutil (>=4.0)"] + +[[package]] +category = "dev" +description = "Experimental type system extensions for programs checked with the mypy typechecker." +name = "mypy-extensions" +optional = false +python-versions = "*" +version = "0.4.3" + [[package]] category = "dev" description = "Utility library for gitignore style pattern matching of file paths." @@ -204,13 +228,14 @@ description = "python code static checker" name = "pylint" optional = false python-versions = ">=3.5.*" -version = "2.4.4" +version = "2.5.1" [package.dependencies] -astroid = ">=2.3.0,<2.4" +astroid = ">=2.4.0,<=2.5" colorama = "*" isort = ">=4.2.5,<5" mccabe = ">=0.6,<0.7" +toml = ">=0.7.1" [[package]] category = "dev" @@ -244,6 +269,14 @@ optional = false python-versions = "*" version = "1.4.1" +[[package]] +category = "dev" +description = "Backported and Experimental Type Hints for Python 3.5+" +name = "typing-extensions" +optional = false +python-versions = "*" +version = "3.7.4.2" + [[package]] category = "main" description = "Declarative parsing and validation of HTTP request objects, with built-in support for popular web frameworks, including Flask, Django, Bottle, Tornado, Pyramid, webapp2, Falcon, and aiohttp." @@ -280,10 +313,10 @@ description = "Module for decorators, wrappers and monkey patching." name = "wrapt" optional = false python-versions = "*" -version = "1.11.2" +version = "1.12.1" [metadata] -content-hash = "405e30386e78f2eeaca67e0725d39b3246b1d66fd2aa8c489776d511131403aa" +content-hash = "d7f285035c82c113351a2d49e25561cf48d1791d31f7c2ea3310e02131780d3b" python-versions = "^3.7" [metadata.files] @@ -292,8 +325,8 @@ appdirs = [ {file = "appdirs-1.4.3.tar.gz", hash = "sha256:9e5896d1372858f8dd3344faf4e5014d21849c756c8d5701f78f8a103b372d92"}, ] astroid = [ - {file = "astroid-2.3.3-py3-none-any.whl", hash = "sha256:840947ebfa8b58f318d42301cf8c0a20fd794a33b61cc4638e28e9e61ba32f42"}, - {file = "astroid-2.3.3.tar.gz", hash = "sha256:71ea07f44df9568a75d0f354c49143a4575d90645e9fead6dfb52c26a85ed13a"}, + {file = "astroid-2.4.1-py3-none-any.whl", hash = "sha256:d8506842a3faf734b81599c8b98dcc423de863adcc1999248480b18bd31a0f38"}, + {file = "astroid-2.4.1.tar.gz", hash = "sha256:4c17cea3e592c21b6e222f673868961bad77e1f985cb1694ed077475a89229c1"}, ] attrs = [ {file = "attrs-19.3.0-py2.py3-none-any.whl", hash = "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c"}, @@ -392,6 +425,26 @@ mccabe = [ {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, ] +mypy = [ + {file = "mypy-0.770-cp35-cp35m-macosx_10_6_x86_64.whl", hash = "sha256:a34b577cdf6313bf24755f7a0e3f3c326d5c1f4fe7422d1d06498eb25ad0c600"}, + {file = "mypy-0.770-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:86c857510a9b7c3104cf4cde1568f4921762c8f9842e987bc03ed4f160925754"}, + {file = "mypy-0.770-cp35-cp35m-win_amd64.whl", hash = "sha256:a8ffcd53cb5dfc131850851cc09f1c44689c2812d0beb954d8138d4f5fc17f65"}, + {file = "mypy-0.770-cp36-cp36m-macosx_10_6_x86_64.whl", hash = "sha256:7687f6455ec3ed7649d1ae574136835a4272b65b3ddcf01ab8704ac65616c5ce"}, + {file = "mypy-0.770-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:3beff56b453b6ef94ecb2996bea101a08f1f8a9771d3cbf4988a61e4d9973761"}, + {file = "mypy-0.770-cp36-cp36m-win_amd64.whl", hash = "sha256:15b948e1302682e3682f11f50208b726a246ab4e6c1b39f9264a8796bb416aa2"}, + {file = "mypy-0.770-cp37-cp37m-macosx_10_6_x86_64.whl", hash = "sha256:b90928f2d9eb2f33162405f32dde9f6dcead63a0971ca8a1b50eb4ca3e35ceb8"}, + {file = "mypy-0.770-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:c56ffe22faa2e51054c5f7a3bc70a370939c2ed4de308c690e7949230c995913"}, + {file = "mypy-0.770-cp37-cp37m-win_amd64.whl", hash = "sha256:8dfb69fbf9f3aeed18afffb15e319ca7f8da9642336348ddd6cab2713ddcf8f9"}, + {file = "mypy-0.770-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:219a3116ecd015f8dca7b5d2c366c973509dfb9a8fc97ef044a36e3da66144a1"}, + {file = "mypy-0.770-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7ec45a70d40ede1ec7ad7f95b3c94c9cf4c186a32f6bacb1795b60abd2f9ef27"}, + {file = "mypy-0.770-cp38-cp38-win_amd64.whl", hash = "sha256:f91c7ae919bbc3f96cd5e5b2e786b2b108343d1d7972ea130f7de27fdd547cf3"}, + {file = "mypy-0.770-py3-none-any.whl", hash = "sha256:3b1fc683fb204c6b4403a1ef23f0b1fac8e4477091585e0c8c54cbdf7d7bb164"}, + {file = "mypy-0.770.tar.gz", hash = "sha256:8a627507ef9b307b46a1fea9513d5c98680ba09591253082b4c48697ba05a4ae"}, +] +mypy-extensions = [ + {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, + {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, +] pathspec = [ {file = "pathspec-0.8.0-py2.py3-none-any.whl", hash = "sha256:7d91249d21749788d07a2d0f94147accd8f845507400749ea19c1ec9054a12b0"}, {file = "pathspec-0.8.0.tar.gz", hash = "sha256:da45173eb3a6f2a5a487efba21f050af2b41948be6ab52b6a1e3ff22bb8b7061"}, @@ -401,8 +454,8 @@ pybeerxml = [ {file = "pybeerxml-1.0.8.tar.gz", hash = "sha256:fb7c9042c7f0d0d9125a6fb3b4b2755f834e182aca239e3496c2975afe142731"}, ] pylint = [ - {file = "pylint-2.4.4-py3-none-any.whl", hash = "sha256:886e6afc935ea2590b462664b161ca9a5e40168ea99e5300935f6591ad467df4"}, - {file = "pylint-2.4.4.tar.gz", hash = "sha256:3db5468ad013380e987410a8d6956226963aed94ecb5f9d3a28acca6d9ac36cd"}, + {file = "pylint-2.5.1-py3-none-any.whl", hash = "sha256:357e30b0cce26b078e58a6a668afdee9b9a04bd25ec982691f2f95c26301e674"}, + {file = "pylint-2.5.1.tar.gz", hash = "sha256:f1a99799b1748bc5241e9a6b5a518893b34e2fd6245460207dec71f46c0abc17"}, ] regex = [ {file = "regex-2020.4.4-cp27-cp27m-win32.whl", hash = "sha256:90742c6ff121a9c5b261b9b215cb476eea97df98ea82037ec8ac95d1be7a034f"}, @@ -459,6 +512,11 @@ typed-ast = [ {file = "typed_ast-1.4.1-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34"}, {file = "typed_ast-1.4.1.tar.gz", hash = "sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b"}, ] +typing-extensions = [ + {file = "typing_extensions-3.7.4.2-py2-none-any.whl", hash = "sha256:f8d2bd89d25bc39dabe7d23df520442fa1d8969b82544370e03d88b5a591c392"}, + {file = "typing_extensions-3.7.4.2-py3-none-any.whl", hash = "sha256:6e95524d8a547a91e08f404ae485bbb71962de46967e1b71a0cb89af24e761c5"}, + {file = "typing_extensions-3.7.4.2.tar.gz", hash = "sha256:79ee589a3caca649a9bfd2a8de4709837400dfa00b6cc81962a1e6a1815969ae"}, +] webargs = [ {file = "webargs-6.0.0-py2.py3-none-any.whl", hash = "sha256:dfe01cd3711cee9a3651bfd5ca67770ace4a6f35f3cae583aa8400bbf7706bb4"}, {file = "webargs-6.0.0.tar.gz", hash = "sha256:d66a056b3a40c5a3774a650fd349db5970cd91fa8f04ac50d00582c949b45b26"}, @@ -468,5 +526,5 @@ werkzeug = [ {file = "Werkzeug-1.0.1.tar.gz", hash = "sha256:6c80b1e5ad3665290ea39320b91e1be1e0d5f60652b964a3070216de83d2e47c"}, ] wrapt = [ - {file = "wrapt-1.11.2.tar.gz", hash = "sha256:565a021fd19419476b9362b05eeaa094178de64f8361e44468f9e9d7843901e1"}, + {file = "wrapt-1.12.1.tar.gz", hash = "sha256:b62ffa81fb85f4332a4f609cab4ac40709470da05643a082ec1eb88e6d9b97d7"}, ] From 2d18052ec93d829f2e4b92fd89522bd9e39becb7 Mon Sep 17 00:00:00 2001 From: Tom Herold Date: Tue, 5 May 2020 14:45:35 +0200 Subject: [PATCH 05/10] remove python 3.6 from testing --- .github/workflows/test_lint.yaml | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_lint.yaml b/.github/workflows/test_lint.yaml index 39f1f0c..ef601a7 100644 --- a/.github/workflows/test_lint.yaml +++ b/.github/workflows/test_lint.yaml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.6, 3.7, 3.8] + python-version: [3.7, 3.8] steps: - uses: actions/checkout@v1 diff --git a/README.md b/README.md index 97b0fc1..876f254 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The PicoBrew Zymatic's built-in Ardunio uses an unencrypted HTTP communication p # Installation -1. Install Python 3.7 +1. Install Python 3.7 or above 2. In a terminal download, install and run the project: ```bash // Download and @@ -29,7 +29,7 @@ FLASK_APP=picobrew_server flask run --port 80 --host 0.0.0.0 # Development -1. Install Python 3.7 & [Poetry](https://python-poetry.org/): +1. Install Python 3.7+ & [Poetry](https://python-poetry.org/): ```bash pip install poetry From 7bce81e50640475fe138fac30913a894cac0232d Mon Sep 17 00:00:00 2001 From: Tom Herold Date: Tue, 5 May 2020 15:24:22 +0200 Subject: [PATCH 06/10] fix linting --- .pylintrc | 2 +- picobrew_server/blueprints/frontend.py | 2 +- picobrew_server/blueprints/picobrew_api.py | 11 +++++++---- poetry.lock | 8 ++++---- pyproject.toml | 3 +-- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.pylintrc b/.pylintrc index 6f5528f..8cabaa6 100644 --- a/.pylintrc +++ b/.pylintrc @@ -192,7 +192,7 @@ never-returning-functions=sys.exit # Format style used to check logging format string. `old` means using % # formatting, `new` is for `{}` formatting,and `fstr` is for f-strings. -logging-format-style=fstr +logging-format-style=old # Logging modules to check that the string format arguments are in logging # function parameter format. diff --git a/picobrew_server/blueprints/frontend.py b/picobrew_server/blueprints/frontend.py index 0d84e0d..ea7f3e7 100644 --- a/picobrew_server/blueprints/frontend.py +++ b/picobrew_server/blueprints/frontend.py @@ -44,7 +44,7 @@ def get_recipe(filename: Path) -> List[PicoBrewRecipe]: # pylint: disable=broad-except except Exception as error: - logger.error(f"Failed to parse recipe {filename}. {error}") + logger.error("Failed to parse recipe %s. %s", filename, error) return [] diff --git a/picobrew_server/blueprints/picobrew_api.py b/picobrew_server/blueprints/picobrew_api.py index adc444d..b3d7e05 100644 --- a/picobrew_server/blueprints/picobrew_api.py +++ b/picobrew_server/blueprints/picobrew_api.py @@ -117,7 +117,7 @@ def create_new_session(recipe_id: Text, _args) -> Text: json.dump(session_data, out_file, indent=2) except IOError as error: - logger.error(f"Could create new session storage file. {error}") + logger.error("Could create new session storage file. %s", error) return "##" return "#{0}#".format(session_id) @@ -162,7 +162,7 @@ def log_to_session(session_id: Text, args) -> Text: json.dump(session, out_file, indent=2) except IOError as error: - logging.error(f"Couldn't save heating log to file. {error}") + logging.error("Couldn't save heating log to file. %s", error) return "" @@ -193,7 +193,10 @@ def parse_session_recovery_request(session, code) -> Text: except IOError as error: logging.error( - f"Unable to resume session {session}. Recipe {recipe_file}. {error}" + "Unable to resume session %s. Recipe %s. %s", + error, + recipe_file, + session, ) abort(500) @@ -203,7 +206,7 @@ def parse_session_recovery_request(session, code) -> Text: except IOError as error: logging.error( - f"Unable to resume session {session}. Recipe {recipe_file}. {error}" + "Unable to resume session %s. Recipe %s. %s", error, recipe_file, session ) abort(500) diff --git a/poetry.lock b/poetry.lock index ebbcaa3..e8351d6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -228,7 +228,7 @@ description = "python code static checker" name = "pylint" optional = false python-versions = ">=3.5.*" -version = "2.5.1" +version = "2.5.2" [package.dependencies] astroid = ">=2.4.0,<=2.5" @@ -316,7 +316,7 @@ python-versions = "*" version = "1.12.1" [metadata] -content-hash = "d7f285035c82c113351a2d49e25561cf48d1791d31f7c2ea3310e02131780d3b" +content-hash = "fb7d1ff8727cc4c575133c80f589216ebbffe9d2365231a6793b55bf1de1ba78" python-versions = "^3.7" [metadata.files] @@ -454,8 +454,8 @@ pybeerxml = [ {file = "pybeerxml-1.0.8.tar.gz", hash = "sha256:fb7c9042c7f0d0d9125a6fb3b4b2755f834e182aca239e3496c2975afe142731"}, ] pylint = [ - {file = "pylint-2.5.1-py3-none-any.whl", hash = "sha256:357e30b0cce26b078e58a6a668afdee9b9a04bd25ec982691f2f95c26301e674"}, - {file = "pylint-2.5.1.tar.gz", hash = "sha256:f1a99799b1748bc5241e9a6b5a518893b34e2fd6245460207dec71f46c0abc17"}, + {file = "pylint-2.5.2-py3-none-any.whl", hash = "sha256:dd506acce0427e9e08fb87274bcaa953d38b50a58207170dbf5b36cf3e16957b"}, + {file = "pylint-2.5.2.tar.gz", hash = "sha256:b95e31850f3af163c2283ed40432f053acbc8fc6eba6a069cb518d9dbf71848c"}, ] regex = [ {file = "regex-2020.4.4-cp27-cp27m-win32.whl", hash = "sha256:90742c6ff121a9c5b261b9b215cb476eea97df98ea82037ec8ac95d1be7a034f"}, diff --git a/pyproject.toml b/pyproject.toml index 6c4d9df..ce3c2a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,10 +16,9 @@ webargs = "6.0.0" Werkzeug = "1.0.1" pybeerxml = "^1.0.8" - [tool.poetry.dev-dependencies] black = "^19.10b0" -pylint = "^2.4.4" +pylint = "^2.5.2" mypy = "^0.770" [build-system] From 19d5d570a9f7deb89a407fa32846cb944fc71139 Mon Sep 17 00:00:00 2001 From: Tom Herold Date: Tue, 5 May 2020 16:18:23 +0200 Subject: [PATCH 07/10] add github action for publishing to pypi --- .github/workflows/publish_pypi.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/test_lint.yaml | 3 ++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish_pypi.yml diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml new file mode 100644 index 0000000..fca1118 --- /dev/null +++ b/.github/workflows/publish_pypi.yml @@ -0,0 +1,28 @@ +name: Publish to PyPI + +on: + release: + types: + - created + +jobs: + publish: + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + with: + python-version: 3.7 + architecture: 'x64' # (x64 or x86) + + - name: Setup venv + run: python -m venv ~/.venv + + - name: Publish to PyPI + run: | + source ~/.venv/bin/activate + pip install poetry + + poetry install + poetry publish --build --username ${{ secrets.PYPI_USERNAME }} --password ${{ secrets.PYPI_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/test_lint.yaml b/.github/workflows/test_lint.yaml index ef601a7..7dd8d08 100644 --- a/.github/workflows/test_lint.yaml +++ b/.github/workflows/test_lint.yaml @@ -3,7 +3,7 @@ name: Test and Lint on: [push] jobs: - build_test_deploy: + build_test: runs-on: ubuntu-18.04 strategy: max-parallel: 4 @@ -42,3 +42,4 @@ jobs: source ~/.venv/bin/activate python -m mypy picobrew_server + \ No newline at end of file From a609294c244baf723075a40d01f906bad09478b5 Mon Sep 17 00:00:00 2001 From: Tom Herold Date: Tue, 5 May 2020 16:22:42 +0200 Subject: [PATCH 08/10] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 876f254..168f681 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The PicoBrew Zymatic's built-in Ardunio uses an unencrypted HTTP communication p 1. Install Python 3.7 or above 2. In a terminal download, install and run the project: ```bash -// Download and +// Download and install pip install picobrew_server // Start the server in production mode on port 80 From bdf6d4f96230869228872b5cad0747dc5da73c7c Mon Sep 17 00:00:00 2001 From: Tom Herold Date: Tue, 5 May 2020 16:38:00 +0200 Subject: [PATCH 09/10] restored procfile for heroku --- Procfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 Procfile diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..275da83 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: gunicorn server:app \ No newline at end of file From 4ffbebbbe44708ebfee46f32ed45e4f70288e8af Mon Sep 17 00:00:00 2001 From: Tom Herold Date: Tue, 5 May 2020 20:48:16 +0200 Subject: [PATCH 10/10] apply PR feedback --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 168f681..a0d3507 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,14 @@ The PicoBrew Zymatic's built-in Ardunio uses an unencrypted HTTP communication p pip install picobrew_server // Start the server in production mode on port 80 -FLASK_APP=picobrew_server flask run --port 80 --host 0.0.0.0 + +// Windows +set FLASK_APP=picobrew_server +flask run --port 80 --host 0.0.0.0 + +// OSX / Linux +export FLASK_APP=picobrew_server +flask run --port 80 --host 0.0.0.0 ``` - Connect the PicoBrew machine to your computer and enable DNS spoofing. Re-route `www.picobrew.com` to your computer.