From c71f693d3ac03a7fb642fc465ed27a12ebb30cbd Mon Sep 17 00:00:00 2001 From: NyanKiyoshi Date: Sun, 16 Sep 2018 16:31:46 +0200 Subject: [PATCH 1/7] Add python 2.7, 3.4 to the test matrix and isort --- .travis.yml | 19 +++++-------------- Pipfile | 1 + Pipfile.lock | 10 +++++++++- requirements-dev.txt | 18 ++++++++++++++++++ requirements.txt | 17 +++++++++++++++++ setup.py | 5 ++++- tests/conftest.py | 2 +- tests/test_application.py | 3 +-- tests/test_core_utils.py | 3 +-- tests/test_sendkeys.py | 3 ++- texrrow/application.py | 1 - texrrow/core/views.py | 1 + texrrow/sendkeys/views.py | 3 ++- texrrow/settings.py | 1 + 14 files changed, 63 insertions(+), 24 deletions(-) create mode 100644 requirements-dev.txt create mode 100644 requirements.txt diff --git a/.travis.yml b/.travis.yml index 099515e..763d2ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,16 +5,13 @@ cache: - node_modules sudo: false python: + - "2.7" + - "3.4" - "3.5" - "3.6" - "pypy3" -services: - - postgresql -env: - global: - - DATABASE_URL=postgres://postgres@localhost:5432/showcased install: - - pip install codecov pytest-cov pipenv + - pip install codecov pytest-cov - nvm install 8 - npm i - npm run build-assets --production @@ -27,17 +24,11 @@ matrix: sudo: required dist: xenial allow_failures: - - python: "pypy3" - python: "nightly" fast_finish: true -before_script: # code coverage tool - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - - chmod +x ./cc-test-reporter - - ./cc-test-reporter before-build script: - - pipenv install + - pip install -r requirements.txt + - pip install -r requirements-dev.txt - pytest --cov --cov-report= -after_script: - - if [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_PYTHON_VERSION" == "3.7" ]]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi after_success: - codecov diff --git a/Pipfile b/Pipfile index 2604ad3..61ec952 100644 --- a/Pipfile +++ b/Pipfile @@ -16,6 +16,7 @@ pipenv-to-requirements = "*" coverage = "*" blinker = "*" flask-debugtoolbar = "*" +mock = "*" [requires] python_version = "3" diff --git a/Pipfile.lock b/Pipfile.lock index c34f4b9..49f6686 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "b2a1cc21d4c5ff61935d63f7917f0a5a3abdb68437ba1aa142fc612f31c6f40e" + "sha256": "6817b47de01b5ed22b701e8108b0cf518b53387d324926eb6eb745dcbaaa3707" }, "pipfile-spec": 6, "requires": { @@ -216,6 +216,14 @@ ], "version": "==1.0" }, + "mock": { + "hashes": [ + "sha256:5ce3c71c5545b472da17b72268978914d0252980348636840bd34a00b5cc96c1", + "sha256:b158b6df76edd239b8208d481dc46b6afd45a846b7812ff0ce58971cf5bc8bba" + ], + "index": "pypi", + "version": "==2.0.0" + }, "more-itertools": { "hashes": [ "sha256:c187a73da93e7a8acc0001572aebc7e3c69daf7bf6881a2cea10650bd4420092", diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..41cd079 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,18 @@ +################################################################################ +# This requirements file has been automatically generated from `Pipfile` with +# `pipenv-to-requirements` +# +# +# This has been done to maintain backward compatibility with tools and services +# that do not support `Pipfile` yet. +# +# Do NOT edit it directly, use `pipenv install [-d]` to modify `Pipfile` and +# `Pipfile.lock` and then regenerate `requirements*.txt`. +################################################################################ + +blinker +coverage +flask-debugtoolbar +mock +pipenv-to-requirements +pytest diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..da290ce --- /dev/null +++ b/requirements.txt @@ -0,0 +1,17 @@ +################################################################################ +# This requirements file has been automatically generated from `Pipfile` with +# `pipenv-to-requirements` +# +# +# This has been done to maintain backward compatibility with tools and services +# that do not support `Pipfile` yet. +# +# Do NOT edit it directly, use `pipenv install [-d]` to modify `Pipfile` and +# `Pipfile.lock` and then regenerate `requirements*.txt`. +################################################################################ + +flask +flask-babel +flask-bootstrap-4-alpha +flask-wtf +keyboard diff --git a/setup.py b/setup.py index 8760d2a..ad6fda9 100755 --- a/setup.py +++ b/setup.py @@ -40,10 +40,13 @@ 'Operating System :: POSIX :: BSD :: NetBSD', 'Operating System :: POSIX :: BSD :: OpenBSD', 'Operating System :: POSIX :: Other', - 'Programming Language :: Python :: 3 :: Only', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.4', 'Framework :: Flask', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', diff --git a/tests/conftest.py b/tests/conftest.py index ee543d2..6e1de11 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,8 +1,8 @@ from os.path import dirname, join, realpath -from unittest import mock import pytest +import mock from texrrow.application import create_app diff --git a/tests/test_application.py b/tests/test_application.py index fe08417..2e11d92 100644 --- a/tests/test_application.py +++ b/tests/test_application.py @@ -1,5 +1,4 @@ -from unittest import mock - +import mock from texrrow import application diff --git a/tests/test_core_utils.py b/tests/test_core_utils.py index f836834..66d1768 100644 --- a/tests/test_core_utils.py +++ b/tests/test_core_utils.py @@ -1,7 +1,6 @@ -from unittest import mock - import pytest +import mock from texrrow.core.utils import environ diff --git a/tests/test_sendkeys.py b/tests/test_sendkeys.py index ac37462..fee69ad 100644 --- a/tests/test_sendkeys.py +++ b/tests/test_sendkeys.py @@ -1,7 +1,8 @@ import pytest -from unittest import mock from flask import url_for +import mock + from .settings import NEXT_SLIDE_KEY, PREV_SLIDE_KEY diff --git a/texrrow/application.py b/texrrow/application.py index 14ae44e..55d5504 100644 --- a/texrrow/application.py +++ b/texrrow/application.py @@ -1,7 +1,6 @@ import os.path import jinja2 - from flask_babel import pgettext from flask_wtf.csrf import generate_csrf diff --git a/texrrow/core/views.py b/texrrow/core/views.py index 06c95dc..9f8d170 100644 --- a/texrrow/core/views.py +++ b/texrrow/core/views.py @@ -1,4 +1,5 @@ from flask import render_template + from .extensions import app diff --git a/texrrow/sendkeys/views.py b/texrrow/sendkeys/views.py index 5cd0746..c84890c 100644 --- a/texrrow/sendkeys/views.py +++ b/texrrow/sendkeys/views.py @@ -1,5 +1,6 @@ +from flask import Blueprint, Response, current_app + import keyboard -from flask import Blueprint, current_app, Response sendkeys_bp = Blueprint( url_prefix='/sendkeys', name='sendkeys', import_name=__name__) diff --git a/texrrow/settings.py b/texrrow/settings.py index 1a5e613..f6aa07d 100644 --- a/texrrow/settings.py +++ b/texrrow/settings.py @@ -1,4 +1,5 @@ import os.path + from texrrow.core.utils.environ import getenv, getenv_bool APP_DIR = os.path.abspath(os.path.dirname(__file__)) From 4f243bebca44add1f8332dfba47915e2e5df451e Mon Sep 17 00:00:00 2001 From: NyanKiyoshi Date: Sun, 16 Sep 2018 16:58:24 +0200 Subject: [PATCH 2/7] Fix raise from compatibility --- Pipfile | 1 + Pipfile.lock | 13 +++++++++++-- README.md | 18 +++++++++++++++++- requirements.txt | 1 + texrrow/core/utils/environ.py | 5 ++++- 5 files changed, 34 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 61ec952..bfd4dc5 100644 --- a/Pipfile +++ b/Pipfile @@ -9,6 +9,7 @@ flask-wtf = "*" flask-babel = "*" flask-bootstrap-4-alpha = {ref = "fork", git = "https://github.com/NyanKiyoshi/flask-bootstrap-4-alpha"} keyboard = "*" +six = "*" [dev-packages] pytest = "*" diff --git a/Pipfile.lock b/Pipfile.lock index 49f6686..cc7e199 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "6817b47de01b5ed22b701e8108b0cf518b53387d324926eb6eb745dcbaaa3707" + "sha256": "7112d3e4b82a61c7749163e7b243d4a01c62174cab82e57dfb5e48d4e00f112a" }, "pipfile-spec": 6, "requires": { @@ -48,7 +48,7 @@ }, "flask-bootstrap-4-alpha": { "git": "https://github.com/NyanKiyoshi/flask-bootstrap-4-alpha", - "ref": "8c340bf2192327bba49cece1f0ffc7af82e5d40e" + "ref": "9382548fa789955fa644f6813eacf181a095bb74" }, "flask-wtf": { "hashes": [ @@ -92,6 +92,14 @@ ], "version": "==2018.5" }, + "six": { + "hashes": [ + "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", + "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" + ], + "index": "pypi", + "version": "==1.11.0" + }, "werkzeug": { "hashes": [ "sha256:c3fd7a7d41976d9f44db327260e263132466836cef6f91512889ed60ad26557c", @@ -284,6 +292,7 @@ "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" ], + "index": "pypi", "version": "==1.11.0" }, "virtualenv": { diff --git a/README.md b/README.md index 7029552..fb33438 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,20 @@ -# Texrrow +

Texrrow

+ +

+ + PyPi Release + + + Python Versions + + + Build Status + + + Code Coverage + +

+ A simple python web-server to remotely control a LaTeX presentation from a mobile phone to give dynamic and powerful speeches. ## Development Usage diff --git a/requirements.txt b/requirements.txt index da290ce..771fab6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,3 +15,4 @@ flask-babel flask-bootstrap-4-alpha flask-wtf keyboard +six diff --git a/texrrow/core/utils/environ.py b/texrrow/core/utils/environ.py index 2c99cf5..dcd0945 100644 --- a/texrrow/core/utils/environ.py +++ b/texrrow/core/utils/environ.py @@ -1,3 +1,4 @@ +from six import raise_from from os import environ E_INVALID_BOOL = '%r is an invalid boolean value.' @@ -7,7 +8,9 @@ def getenv_or_raise(name, error_message): try: return environ[name] except KeyError as exc: - raise KeyError(error_message) from exc + exc_value = KeyError(error_message) + raise_from(exc_value, exc) + raise exc_value def getenv_int(name, default=None): From 42d01a863c25c1dbb54002e5b2453a1220546792 Mon Sep 17 00:00:00 2001 From: NyanKiyoshi Date: Sun, 16 Sep 2018 17:39:41 +0200 Subject: [PATCH 3/7] Prepare a PyPi ready release --- LICENSE | 21 +++++++ Makefile | 105 ++++++++++++++++++++++++++++++++++ Pipfile | 5 +- Pipfile.lock | 81 ++++++++++++++------------ requirements-dev.txt | 29 ++++++++-- requirements.txt | 22 +++++-- setup.py | 19 ++++-- texrrow/__main__.py | 3 + texrrow/core/utils/environ.py | 3 +- texrrow/sendkeys/views.py | 3 +- 10 files changed, 235 insertions(+), 56 deletions(-) create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 texrrow/__main__.py diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ee6ced2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 NyanKiyoshi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c824013 --- /dev/null +++ b/Makefile @@ -0,0 +1,105 @@ +.PHONY: build + +MODULE:=texrrow + +all: ensure-pip dev style checks dists test + +ensure-pip: + pip install --user --upgrade pipenv pip + pip --version + pipenv --version + +ensure-pip-ci: + pip install --upgrade pipenv pip + pip --version + pipenv --version + +dev: + pipenv install --dev + pipenv run pip install -e . + +dev-ci: + pipenv install --dev --skip-lock + pipenv run pip install -e . + +dev-py2: + pipenv install --dev --two + pipenv run pip install -e . + +style: isort autopep8 yapf + +isort: + pipenv run isort -y + +autopep8: + pipenv run autopep8 --in-place --recursive setup.py $(MODULE) + +yapf: + pipenv run yapf --style .yapf --recursive -i $(MODULE) + +checks: flake8 pylint + +flake8: + pipenv run python setup.py flake8 + +pylint: + pipenv run pylint --rcfile=.pylintrc --output-format=colorized $(MODULE) + +sc: style checks +sct: style checks test + +build: dists + +test: + pipenv run pytest $(MODULE) + +test-verbose: + pipenv run pytest -s $(MODULE) + +test-coverage: + pipenv run py.test -v --cov $(MODULE) --cov-report term-missing + +dists: requirements sdist bdist wheels + +requirements: + pipenv run pipenv_to_requirements -f + +release: requirements + +sdist: requirements + pipenv run python setup.py sdist + +bdist: requirements + pipenv run python setup.py bdist + +wheels: requirements + pipenv run python setup.py bdist_wheel + +pypi-publish: build release + pipenv run twine upload --repository pypi dist/*.whl + +pypi-test-publish: build release + pipenv run twine upload --repository testpypi dist/*.whl + +update: + pipenv update + +githook: style + +push: githook + @git push origin --tags + +clean: + pipenv --rm + +prepare-release: requirements + +# aliases to gracefully handle typos on poor dev's terminal +check: checks +devel: dev +develop: dev +dist: dists +install: install-system +pypi: pypi-publish +styles: style +wheel: wheels diff --git a/Pipfile b/Pipfile index bfd4dc5..7c96586 100644 --- a/Pipfile +++ b/Pipfile @@ -7,9 +7,9 @@ name = "pypi" flask = "*" flask-wtf = "*" flask-babel = "*" -flask-bootstrap-4-alpha = {ref = "fork", git = "https://github.com/NyanKiyoshi/flask-bootstrap-4-alpha"} keyboard = "*" six = "*" +"flask-bootstrap-4-alpha" = "*" [dev-packages] pytest = "*" @@ -21,3 +21,6 @@ mock = "*" [requires] python_version = "3" + +[pipenv] +allow_prereleases = true diff --git a/Pipfile.lock b/Pipfile.lock index cc7e199..727ebef 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "7112d3e4b82a61c7749163e7b243d4a01c62174cab82e57dfb5e48d4e00f112a" + "sha256": "9bb8b183e1176a4efefa7d3b26d9890f27ec0de9f1aa49b685c48653e055b686" }, "pipfile-spec": 6, "requires": { @@ -30,6 +30,12 @@ ], "version": "==6.7" }, + "dominate": { + "hashes": [ + "sha256:4b8ce6f33633c9dd9175b228d21c00c801b6bd0327747cd5e17fc2da934c3a69" + ], + "version": "==2.3.1" + }, "flask": { "hashes": [ "sha256:2271c0070dbcb5275fad4a82e29f23ab92682dc45f9dfbc22c02ba9b9322ce48", @@ -47,8 +53,11 @@ "version": "==0.11.2" }, "flask-bootstrap-4-alpha": { - "git": "https://github.com/NyanKiyoshi/flask-bootstrap-4-alpha", - "ref": "9382548fa789955fa644f6813eacf181a095bb74" + "hashes": [ + "sha256:33204c191b4323fd2d4ecb1232dd3573759e24572685679c3aef9d600f7031bd" + ], + "index": "pypi", + "version": "==4.0.0b3.dev2" }, "flask-wtf": { "hashes": [ @@ -100,6 +109,12 @@ "index": "pypi", "version": "==1.11.0" }, + "visitor": { + "hashes": [ + "sha256:2c737903b2b6864ebc6167eef7cf3b997126f1aa94bdf590f90f1436d23e480a" + ], + "version": "==0.1.3" + }, "werkzeug": { "hashes": [ "sha256:c3fd7a7d41976d9f44db327260e263132466836cef6f91512889ed60ad26557c", @@ -154,40 +169,36 @@ }, "coverage": { "hashes": [ - "sha256:03481e81d558d30d230bc12999e3edffe392d244349a90f4ef9b88425fac74ba", - "sha256:0b136648de27201056c1869a6c0d4e23f464750fd9a9ba9750b8336a244429ed", - "sha256:10a46017fef60e16694a30627319f38a2b9b52e90182dddb6e37dcdab0f4bf95", - "sha256:198626739a79b09fa0a2f06e083ffd12eb55449b5f8bfdbeed1df4910b2ca640", - "sha256:23d341cdd4a0371820eb2b0bd6b88f5003a7438bbedb33688cd33b8eae59affd", - "sha256:28b2191e7283f4f3568962e373b47ef7f0392993bb6660d079c62bd50fe9d162", - "sha256:2a5b73210bad5279ddb558d9a2bfedc7f4bf6ad7f3c988641d83c40293deaec1", - "sha256:2eb564bbf7816a9d68dd3369a510be3327f1c618d2357fa6b1216994c2e3d508", - "sha256:337ded681dd2ef9ca04ef5d93cfc87e52e09db2594c296b4a0a3662cb1b41249", - "sha256:3a2184c6d797a125dca8367878d3b9a178b6fdd05fdc2d35d758c3006a1cd694", - "sha256:3c79a6f7b95751cdebcd9037e4d06f8d5a9b60e4ed0cd231342aa8ad7124882a", - "sha256:3d72c20bd105022d29b14a7d628462ebdc61de2f303322c0212a054352f3b287", - "sha256:3eb42bf89a6be7deb64116dd1cc4b08171734d721e7a7e57ad64cc4ef29ed2f1", - "sha256:4635a184d0bbe537aa185a34193898eee409332a8ccb27eea36f262566585000", - "sha256:56e448f051a201c5ebbaa86a5efd0ca90d327204d8b059ab25ad0f35fbfd79f1", - "sha256:5a13ea7911ff5e1796b6d5e4fbbf6952381a611209b736d48e675c2756f3f74e", - "sha256:69bf008a06b76619d3c3f3b1983f5145c75a305a0fea513aca094cae5c40a8f5", - "sha256:6bc583dc18d5979dc0f6cec26a8603129de0304d5ae1f17e57a12834e7235062", - "sha256:701cd6093d63e6b8ad7009d8a92425428bc4d6e7ab8d75efbb665c806c1d79ba", - "sha256:7608a3dd5d73cb06c531b8925e0ef8d3de31fed2544a7de6c63960a1e73ea4bc", - "sha256:76ecd006d1d8f739430ec50cc872889af1f9c1b6b8f48e29941814b09b0fd3cc", - "sha256:7aa36d2b844a3e4a4b356708d79fd2c260281a7390d678a10b91ca595ddc9e99", - "sha256:7d3f553904b0c5c016d1dad058a7554c7ac4c91a789fca496e7d8347ad040653", - "sha256:7e1fe19bd6dce69d9fd159d8e4a80a8f52101380d5d3a4d374b6d3eae0e5de9c", - "sha256:8c3cb8c35ec4d9506979b4cf90ee9918bc2e49f84189d9bf5c36c0c1119c6558", - "sha256:9d6dd10d49e01571bf6e147d3b505141ffc093a06756c60b053a859cb2128b1f", - "sha256:be6cfcd8053d13f5f5eeb284aa8a814220c3da1b0078fa859011c7fffd86dab9", - "sha256:c1bb572fab8208c400adaf06a8133ac0712179a334c09224fb11393e920abcdd", - "sha256:de4418dadaa1c01d497e539210cb6baa015965526ff5afc078c57ca69160108d", - "sha256:e05cb4d9aad6233d67e0541caa7e511fa4047ed7750ec2510d466e806e0255d6", - "sha256:f3f501f345f24383c0000395b26b726e46758b71393267aeae0bd36f8b3ade80" + "sha256:0dcf381f51f589f1f797449602a7fe4e63be8a7963c259c13742af3f30be902e", + "sha256:11a4bb30306def2fa012e3429de44a93ef2ae3b6ad3f6b800f6c578658a5c402", + "sha256:166c957a38b034050a14201f64eec11fc95e17bf2ba31fc07d887db82bae1a47", + "sha256:184e6680f85fcc1b371f67ab732290ecf96a225448198e14ec170986db47b0aa", + "sha256:1904deb72c561a8e445feb190db07ca4b165ee85567894b4b85fdb9bf21a27c0", + "sha256:1f2003b83426cfaadebff8b9bb1fb3650134a15fda3a81434cc8415896d7a7bc", + "sha256:1f462997b1804f8b5d1ee2b262626fc76b746e66023eb64f529af35991167c7c", + "sha256:213697f49eba45b5fb05e77f63bdb7c0d13eed12dcd08e6af43224615b28b524", + "sha256:2557da232b0daeb55afe2f7e55f7b80c56bfa2981864c6638b32b5691da9f4c3", + "sha256:395a8525f1456439a5d6c248bc1397040491047e3e0e0c4ceb2059155419cd3b", + "sha256:43d6334b35e50e74d034ec075ffd9082c559bca624924af6c7e9d2b8aef0f362", + "sha256:4566c74bde36aaaef0372fb11678edf43dcc73f4eb8dbb6987250658c4a3b95a", + "sha256:6d39cc527c9c7a30f20bed14b5cf9a7e87ef1f3528c1847d1c81caf75a31ebb6", + "sha256:8bd69d3cba21d885df6fe8728cee779a722da08cf84072558956c148b5ab61e5", + "sha256:a1d0fcbbe0735eb66c6622266b12e60ea8d37ada405cb8f73b154c5eec467187", + "sha256:ab706bfbb365f232be01a536a9199ee6bfc80c9b63fb7825fdd5f4ae5cc2a12c", + "sha256:afbf4cee68d2f2968b06951cf16c0b18513eb59bb3af0685084de6cacb04e217", + "sha256:bbc8913cd5889df7eab597a4b4074a2c6c5ee6ca9aad58a9ba0f3f847b1a99df", + "sha256:bd5428ab378a7432e43afa52b6bb9c5d48f5029f395a97dc9ebf87fc0f2a9d8b", + "sha256:c3efe0185583443e04f8519818f4772d92fbbdf5f9fa23165f2f2482b20efc37", + "sha256:d40277e918da575d008e2955a0ca6600f870bdb3570b07ee3a754ea9301862e7", + "sha256:d4b6ec6951e20ea3f5d1fefe35b4bcbf692d4306f1b932c28dd2ee4cb167152c", + "sha256:d5837e813ad62c856bc80f988c4e24e0d2b7b22a8a1dad8c1cfcb8ff4d4750a8", + "sha256:d9583ae0e152c5fb0142cb55c3a11e1b13006c00d0c3e8b35ccc2d4ebfc6645e", + "sha256:e27380cbe4088a1df514e75aa4fe6dc9e98bbd7902cf28ab16e8b2de0f8cb344", + "sha256:e624daef32f8808296312e72190c7e576852cb75c27935b31c1bbbde14ab353c", + "sha256:ef4278e5ac1e47c731ec5e3e48351721e01d2eb4fefa9b97fcdba7495a82cfad" ], "index": "pypi", - "version": "==4.5.1" + "version": "==5.0a2" }, "flask": { "hashes": [ diff --git a/requirements-dev.txt b/requirements-dev.txt index 41cd079..9f81180 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -10,9 +10,26 @@ # `Pipfile.lock` and then regenerate `requirements*.txt`. ################################################################################ -blinker -coverage -flask-debugtoolbar -mock -pipenv-to-requirements -pytest +atomicwrites==1.2.1 +attrs==18.2.0 +blinker==1.4 +certifi==2018.8.24 +click==6.7 +coverage==5.0a2 +flask-debugtoolbar==0.10.1 +flask==1.0.2 +itsdangerous==0.24 +jinja2==2.10 +markupsafe==1.0 +mock==2.0.0 +more-itertools==4.3.0 +pbr==4.2.0 +pipenv-to-requirements==0.5.1 +pipenv==2018.7.1 +pluggy==0.7.1 +py==1.6.0 +pytest==3.8.0 +six==1.11.0 +virtualenv-clone==0.3.0 +virtualenv==16.0.0 +werkzeug==0.14.1 diff --git a/requirements.txt b/requirements.txt index 771fab6..02e2076 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,9 +10,19 @@ # `Pipfile.lock` and then regenerate `requirements*.txt`. ################################################################################ -flask -flask-babel -flask-bootstrap-4-alpha -flask-wtf -keyboard -six +babel==2.6.0 +click==6.7 +dominate==2.3.1 +flask-babel==0.11.2 +flask-bootstrap-4-alpha==4.0.0b3.dev2 +flask-wtf==0.14.2 +flask==1.0.2 +itsdangerous==0.24 +jinja2==2.10 +keyboard==0.13.2 +markupsafe==1.0 +pytz==2018.5 +six==1.11.0 +visitor==0.1.3 +werkzeug==0.14.1 +wtforms==2.2.1 diff --git a/setup.py b/setup.py index ad6fda9..ded2287 100755 --- a/setup.py +++ b/setup.py @@ -10,8 +10,14 @@ long_description = '' +requirements = [] +if isfile('requirements.txt'): + with open('requirements.txt') as fp: + requirements = fp.readlines() + + setup( - name='texarrow', + name='texrrow', version='0.0.0', author='NyanKiyoshi', author_email='hello@vanille.bid', @@ -19,21 +25,24 @@ 'A simple python web-server to remotely control a LaTeX presentation ' 'from a mobile phone to give dynamic and powerful speeches.'), long_description=long_description, + long_description_content_type='text/markdown', url='https://github.com/NyanKiyoshi/texrrow/', license='MIT', maintainer='NyanKiyoshi', + entry_points={ + 'console_scripts': [ + 'texrrow=texrrow.__main__:main']}, packages=find_packages(exclude=['tests']), include_package_data=True, data_files=[ - ('', ['README.md', 'LICENSE'])], + ('', ['README.md', 'LICENSE', 'requirements.txt'])], keywords=[], - extras_require={ - 'mysql': ['flask-mysqldb']}, + install_requires=requirements, classifiers=[ 'Development Status :: 1 - Planning', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', - 'Operating System :: POSIX :: Linux' + 'Operating System :: POSIX :: Linux', 'Operating System :: POSIX :: BSD', 'Operating System :: POSIX :: BSD :: BSD/OS', 'Operating System :: POSIX :: BSD :: FreeBSD', diff --git a/texrrow/__main__.py b/texrrow/__main__.py new file mode 100644 index 0000000..b2e1285 --- /dev/null +++ b/texrrow/__main__.py @@ -0,0 +1,3 @@ +def main(): + from .application import create_app + create_app().run() diff --git a/texrrow/core/utils/environ.py b/texrrow/core/utils/environ.py index dcd0945..64d50b6 100644 --- a/texrrow/core/utils/environ.py +++ b/texrrow/core/utils/environ.py @@ -1,6 +1,7 @@ -from six import raise_from from os import environ +from six import raise_from + E_INVALID_BOOL = '%r is an invalid boolean value.' diff --git a/texrrow/sendkeys/views.py b/texrrow/sendkeys/views.py index c84890c..131902e 100644 --- a/texrrow/sendkeys/views.py +++ b/texrrow/sendkeys/views.py @@ -1,6 +1,5 @@ -from flask import Blueprint, Response, current_app - import keyboard +from flask import Blueprint, Response, current_app sendkeys_bp = Blueprint( url_prefix='/sendkeys', name='sendkeys', import_name=__name__) From a0489690425bde66146db37b4c5d332544b675be Mon Sep 17 00:00:00 2001 From: NyanKiyoshi Date: Sun, 16 Sep 2018 17:52:54 +0200 Subject: [PATCH 4/7] Add pypy2 to the test matrix and fix a coverage issue --- .travis.yml | 1 + texrrow/core/utils/environ.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 763d2ef..8aabdca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ python: - "3.4" - "3.5" - "3.6" + - "pypy" - "pypy3" install: - pip install codecov pytest-cov diff --git a/texrrow/core/utils/environ.py b/texrrow/core/utils/environ.py index 64d50b6..879e224 100644 --- a/texrrow/core/utils/environ.py +++ b/texrrow/core/utils/environ.py @@ -11,7 +11,7 @@ def getenv_or_raise(name, error_message): except KeyError as exc: exc_value = KeyError(error_message) raise_from(exc_value, exc) - raise exc_value + raise exc_value # pragma: no cover def getenv_int(name, default=None): From fcc019ee4db7dda3f7827fa0d68bed248c230dd2 Mon Sep 17 00:00:00 2001 From: NyanKiyoshi Date: Sun, 16 Sep 2018 17:58:48 +0200 Subject: [PATCH 5/7] Add .appveyor config file --- .appveyor.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..7c903fe --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,22 @@ +environment: + matrix: + - PYTHON: C:\Python37-x64 + - PYTHON: C:\Python36-x64 + - PYTHON: C:\Python35-x64 + - PYTHON: C:\Python34-x64 + - PYTHON: C:\Python27-x64 + +init: + - SET PATH=%PYTHON%;%PATH% + +install: + - python -m pip install -r requirements.txt + - python -m pip install -r requirements-dev.txt + +build: false + +test_script: + - python -m pytest + +cache: + - '%LOCALAPPDATA%\pip\Cache' From 3170afc784362d758d640f7df886ed17e53e950a Mon Sep 17 00:00:00 2001 From: NyanKiyoshi <6186720+NyanKiyoshi@users.noreply.github.com> Date: Sun, 16 Sep 2018 21:28:50 +0200 Subject: [PATCH 6/7] Add a UWSGI app and a flask app --- .ci/test_servers.py | 60 ++++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 11 +++++--- Pipfile | 1 + Pipfile.lock | 32 ++++++++++++++++++++++- README.md | 7 ++++++ requirements-dev.txt | 4 +++ requirements.txt | 2 +- setup.cfg | 3 +++ setup.py | 5 +++- texrrow/__main__.py | 25 ++++++++++++++++-- texrrow/wsgi.py | 13 ++++++++++ 11 files changed, 155 insertions(+), 8 deletions(-) create mode 100644 .ci/test_servers.py create mode 100644 texrrow/wsgi.py diff --git a/.ci/test_servers.py b/.ci/test_servers.py new file mode 100644 index 0000000..84081b3 --- /dev/null +++ b/.ci/test_servers.py @@ -0,0 +1,60 @@ +"""We want to ensure that users can run Texrrow through UWSGI without issues. +This script is ran by Travis and AppVeyor to ensure the compatibility. + +This is a heavy test and incompatible test with pytest. +Thus we keep it separated from the rest of the tests.""" +import os +import signal +import sys +import time + +import mock +import requests +import requests.exceptions + +from texrrow import __main__ as main + +TEST_PORT = 12345 + + +def _knock_url_and_wait(url, timeout_per_request=1, global_timeout=10): + status = None + end_time = time.time() + global_timeout + while status is None: + try: + response = requests.head(url, timeout=timeout_per_request) + status = response.status_code + except requests.exceptions.ConnectionError: # noqa + if time.time() > end_time: + raise + assert status == 200 + + +def _run_and_test(to_run): + child_pid = os.fork() + if child_pid == 0: + to_run() + sys.exit(0) + try: + test_url = 'http://127.0.0.1:%d' % TEST_PORT + time.sleep(0.1) + pid, status = os.waitpid(child_pid, os.P_NOWAIT) + + # ensure the process did not exit + assert not os.WEXITSTATUS(pid) + + # try to ping uwsgi and get a HTTP 200 + _knock_url_and_wait(test_url) + finally: + os.kill(child_pid, signal.SIGTERM) + os.wait() + + +@mock.patch.object(main, 'PORT', new=TEST_PORT) +def test_start_servers(): + _run_and_test(main.start_uwsgi) + _run_and_test(main.start_flask) + + +if __name__ == '__main__': + test_start_servers() diff --git a/.travis.yml b/.travis.yml index 8aabdca..6d59ca1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,10 +12,14 @@ python: - "pypy" - "pypy3" install: - - pip install codecov pytest-cov + - pip install codecov pytest-cov uwsgi + - pip install -r requirements.txt + - pip install -r requirements-dev.txt + - rm requirements.txt - nvm install 8 - npm i - npm run build-assets --production + - python setup.py develop matrix: include: - python: "3.7" @@ -26,10 +30,11 @@ matrix: dist: xenial allow_failures: - python: "nightly" + - python: "pypy" + - python: "pypy3" fast_finish: true script: - - pip install -r requirements.txt - - pip install -r requirements-dev.txt - pytest --cov --cov-report= + - python .ci/test_servers.py after_success: - codecov diff --git a/Pipfile b/Pipfile index 7c96586..408fffe 100644 --- a/Pipfile +++ b/Pipfile @@ -18,6 +18,7 @@ coverage = "*" blinker = "*" flask-debugtoolbar = "*" mock = "*" +requests = "*" [requires] python_version = "3" diff --git a/Pipfile.lock b/Pipfile.lock index 727ebef..782c81f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "9bb8b183e1176a4efefa7d3b26d9890f27ec0de9f1aa49b685c48653e055b686" + "sha256": "61e849445da8704ec053a9f279dca3673b93fd841127db303ca4c2ae87e38870" }, "pipfile-spec": 6, "requires": { @@ -160,6 +160,13 @@ ], "version": "==2018.8.24" }, + "chardet": { + "hashes": [ + "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", + "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" + ], + "version": "==3.0.4" + }, "click": { "hashes": [ "sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d", @@ -216,6 +223,13 @@ "index": "pypi", "version": "==0.10.1" }, + "idna": { + "hashes": [ + "sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e", + "sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16" + ], + "version": "==2.7" + }, "itsdangerous": { "hashes": [ "sha256:cbb3fcf8d3e33df861709ecaf89d9e6629cff0a217bc2848f1b41cd30d360519" @@ -298,6 +312,14 @@ "index": "pypi", "version": "==3.8.0" }, + "requests": { + "hashes": [ + "sha256:63b52e3c866428a224f97cab011de738c36aec0185aa91cfacd418b5d58911d1", + "sha256:ec22d826a36ed72a7358ff3fe56cbd4ba69dd7a6718ffd450ff0e9df7a47ce6a" + ], + "index": "pypi", + "version": "==2.19.1" + }, "six": { "hashes": [ "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", @@ -306,6 +328,14 @@ "index": "pypi", "version": "==1.11.0" }, + "urllib3": { + "hashes": [ + "sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf", + "sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5" + ], + "markers": "python_version != '3.0.*' and python_version != '3.1.*' and python_version < '4' and python_version >= '2.6' and python_version != '3.3.*' and python_version != '3.2.*'", + "version": "==1.23" + }, "virtualenv": { "hashes": [ "sha256:2ce32cd126117ce2c539f0134eb89de91a8413a29baac49cbab3eb50e2026669", diff --git a/README.md b/README.md index fb33438..881dcf3 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,13 @@ A simple python web-server to remotely control a LaTeX presentation from a mobile phone to give dynamic and powerful speeches. +## Usage +``` +texrrow [PORT=5000] +``` +Run `texrrow` in your shell and open your browser in [http://127.0.0.1:5000](http://127.0.0.1:5000)! + + ## Development Usage ### Install Requirements ```shell diff --git a/requirements-dev.txt b/requirements-dev.txt index 9f81180..6d4c1bd 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -14,10 +14,12 @@ atomicwrites==1.2.1 attrs==18.2.0 blinker==1.4 certifi==2018.8.24 +chardet==3.0.4 click==6.7 coverage==5.0a2 flask-debugtoolbar==0.10.1 flask==1.0.2 +idna==2.7 itsdangerous==0.24 jinja2==2.10 markupsafe==1.0 @@ -29,7 +31,9 @@ pipenv==2018.7.1 pluggy==0.7.1 py==1.6.0 pytest==3.8.0 +requests==2.19.1 six==1.11.0 +urllib3==1.23 virtualenv-clone==0.3.0 virtualenv==16.0.0 werkzeug==0.14.1 diff --git a/requirements.txt b/requirements.txt index 02e2076..08007a7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,7 +22,7 @@ jinja2==2.10 keyboard==0.13.2 markupsafe==1.0 pytz==2018.5 -six==1.11.0 +six>=1.10.0 visitor==0.1.3 werkzeug==0.14.1 wtforms==2.2.1 diff --git a/setup.cfg b/setup.cfg index 8cf1700..bc7d74f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,6 +5,9 @@ omit = */test_*.py tests/*.py */commands/populatedb.py + */__main__.py + .ci/* + */wsgi* source = texrrow diff --git a/setup.py b/setup.py index ded2287..d95782c 100755 --- a/setup.py +++ b/setup.py @@ -31,13 +31,16 @@ maintainer='NyanKiyoshi', entry_points={ 'console_scripts': [ - 'texrrow=texrrow.__main__:main']}, + 'texrrow-uwsgi=texrrow.__main__:start_uwsgi', + 'texrrow=texrrow.__main__:start_flask']}, packages=find_packages(exclude=['tests']), include_package_data=True, data_files=[ ('', ['README.md', 'LICENSE', 'requirements.txt'])], keywords=[], install_requires=requirements, + extras_require={ + 'uwsgi': ['uwsgi']}, classifiers=[ 'Development Status :: 1 - Planning', 'License :: OSI Approved :: MIT License', diff --git a/texrrow/__main__.py b/texrrow/__main__.py index b2e1285..b47bc4d 100644 --- a/texrrow/__main__.py +++ b/texrrow/__main__.py @@ -1,3 +1,24 @@ -def main(): +import os +import os.path +import sys + +PORT = 5000 +UWSGI_PATH = os.path.realpath(os.path.join(sys.executable, os.pardir, 'uwsgi')) + + +def _get_port_from_argv(): + if len(sys.argv) > 1: + port = int(sys.argv[1]) + return port + return PORT + + +def start_flask(): from .application import create_app - create_app().run() + create_app().run(host='0.0.0.0', port=_get_port_from_argv(), debug=False) + + +def start_uwsgi(): + port = ':%d' % _get_port_from_argv() + argv = ['uwsgi', '--http', port, '--module', 'texrrow.wsgi:application'] + os.execve(UWSGI_PATH, argv, os.environ) diff --git a/texrrow/wsgi.py b/texrrow/wsgi.py new file mode 100644 index 0000000..b98a4d3 --- /dev/null +++ b/texrrow/wsgi.py @@ -0,0 +1,13 @@ +from texrrow.application import create_app + + +def health_check(_application, health_url): + def health_check_wrapper(environ, start_response): + if environ.get('PATH_INFO') == health_url: + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [] + return _application(environ, start_response) + return health_check_wrapper + + +application = health_check(create_app(), '/health/') From 97082a10d1d33062f74954c1fc26c6a2ec5a64dd Mon Sep 17 00:00:00 2001 From: NyanKiyoshi Date: Mon, 17 Sep 2018 20:16:26 +0200 Subject: [PATCH 7/7] Fix python 3.4 compatibility issues --- .appveyor.yml | 2 +- .travis.yml | 2 - Makefile | 19 +-- Pipfile | 27 ---- Pipfile.lock | 362 ------------------------------------------- Piplock | 29 ---- requirements-dev.txt | 43 +---- requirements.txt | 31 +--- setup.py | 6 +- 9 files changed, 18 insertions(+), 503 deletions(-) delete mode 100644 Pipfile delete mode 100644 Pipfile.lock delete mode 100644 Piplock diff --git a/.appveyor.yml b/.appveyor.yml index 7c903fe..64425f1 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -10,8 +10,8 @@ init: - SET PATH=%PYTHON%;%PATH% install: - - python -m pip install -r requirements.txt - python -m pip install -r requirements-dev.txt + - python setup.py develop build: false diff --git a/.travis.yml b/.travis.yml index 6d59ca1..8e6e9c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,9 +13,7 @@ python: - "pypy3" install: - pip install codecov pytest-cov uwsgi - - pip install -r requirements.txt - pip install -r requirements-dev.txt - - rm requirements.txt - nvm install 8 - npm i - npm run build-assets --production diff --git a/Makefile b/Makefile index c824013..e907f41 100644 --- a/Makefile +++ b/Makefile @@ -59,26 +59,21 @@ test-verbose: test-coverage: pipenv run py.test -v --cov $(MODULE) --cov-report term-missing -dists: requirements sdist bdist wheels +dists: sdist bdist wheels -requirements: - pipenv run pipenv_to_requirements -f - -release: requirements - -sdist: requirements +sdist: pipenv run python setup.py sdist -bdist: requirements +bdist: pipenv run python setup.py bdist -wheels: requirements +wheels: pipenv run python setup.py bdist_wheel -pypi-publish: build release +pypi-publish: build pipenv run twine upload --repository pypi dist/*.whl -pypi-test-publish: build release +pypi-test-publish: build pipenv run twine upload --repository testpypi dist/*.whl update: @@ -92,8 +87,6 @@ push: githook clean: pipenv --rm -prepare-release: requirements - # aliases to gracefully handle typos on poor dev's terminal check: checks devel: dev diff --git a/Pipfile b/Pipfile deleted file mode 100644 index 408fffe..0000000 --- a/Pipfile +++ /dev/null @@ -1,27 +0,0 @@ -[[source]] -url = "https://pypi.org/simple" -verify_ssl = true -name = "pypi" - -[packages] -flask = "*" -flask-wtf = "*" -flask-babel = "*" -keyboard = "*" -six = "*" -"flask-bootstrap-4-alpha" = "*" - -[dev-packages] -pytest = "*" -pipenv-to-requirements = "*" -coverage = "*" -blinker = "*" -flask-debugtoolbar = "*" -mock = "*" -requests = "*" - -[requires] -python_version = "3" - -[pipenv] -allow_prereleases = true diff --git a/Pipfile.lock b/Pipfile.lock deleted file mode 100644 index 782c81f..0000000 --- a/Pipfile.lock +++ /dev/null @@ -1,362 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "61e849445da8704ec053a9f279dca3673b93fd841127db303ca4c2ae87e38870" - }, - "pipfile-spec": 6, - "requires": { - "python_version": "3" - }, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.org/simple", - "verify_ssl": true - } - ] - }, - "default": { - "babel": { - "hashes": [ - "sha256:6778d85147d5d85345c14a26aada5e478ab04e39b078b0745ee6870c2b5cf669", - "sha256:8cba50f48c529ca3fa18cf81fa9403be176d374ac4d60738b839122dfaaa3d23" - ], - "version": "==2.6.0" - }, - "click": { - "hashes": [ - "sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d", - "sha256:f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b" - ], - "version": "==6.7" - }, - "dominate": { - "hashes": [ - "sha256:4b8ce6f33633c9dd9175b228d21c00c801b6bd0327747cd5e17fc2da934c3a69" - ], - "version": "==2.3.1" - }, - "flask": { - "hashes": [ - "sha256:2271c0070dbcb5275fad4a82e29f23ab92682dc45f9dfbc22c02ba9b9322ce48", - "sha256:a080b744b7e345ccfcbc77954861cb05b3c63786e93f2b3875e0913d44b43f05" - ], - "index": "pypi", - "version": "==1.0.2" - }, - "flask-babel": { - "hashes": [ - "sha256:462a3c599b0ccf426ca1757cc612f1db383844efd346d14170da04c8c76dd521", - "sha256:c0d75710bd4b0fe866f9f2347de6e19208712f9cec006436b4c1c15d4cb0c939" - ], - "index": "pypi", - "version": "==0.11.2" - }, - "flask-bootstrap-4-alpha": { - "hashes": [ - "sha256:33204c191b4323fd2d4ecb1232dd3573759e24572685679c3aef9d600f7031bd" - ], - "index": "pypi", - "version": "==4.0.0b3.dev2" - }, - "flask-wtf": { - "hashes": [ - "sha256:5d14d55cfd35f613d99ee7cba0fc3fbbe63ba02f544d349158c14ca15561cc36", - "sha256:d9a9e366b32dcbb98ef17228e76be15702cd2600675668bca23f63a7947fd5ac" - ], - "index": "pypi", - "version": "==0.14.2" - }, - "itsdangerous": { - "hashes": [ - "sha256:cbb3fcf8d3e33df861709ecaf89d9e6629cff0a217bc2848f1b41cd30d360519" - ], - "version": "==0.24" - }, - "jinja2": { - "hashes": [ - "sha256:74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd", - "sha256:f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4" - ], - "version": "==2.10" - }, - "keyboard": { - "hashes": [ - "sha256:58912e4be21529fc5b57f89af7f90b0b5f5af4db08c74a8233821700eaabf189", - "sha256:d4375e4be666a91b71e782fdffa017cbf1a6de98f8c9fe8b66e9386944380c45" - ], - "index": "pypi", - "version": "==0.13.2" - }, - "markupsafe": { - "hashes": [ - "sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665" - ], - "version": "==1.0" - }, - "pytz": { - "hashes": [ - "sha256:a061aa0a9e06881eb8b3b2b43f05b9439d6583c206d0a6c340ff72a7b6669053", - "sha256:ffb9ef1de172603304d9d2819af6f5ece76f2e85ec10692a524dd876e72bf277" - ], - "version": "==2018.5" - }, - "six": { - "hashes": [ - "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", - "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" - ], - "index": "pypi", - "version": "==1.11.0" - }, - "visitor": { - "hashes": [ - "sha256:2c737903b2b6864ebc6167eef7cf3b997126f1aa94bdf590f90f1436d23e480a" - ], - "version": "==0.1.3" - }, - "werkzeug": { - "hashes": [ - "sha256:c3fd7a7d41976d9f44db327260e263132466836cef6f91512889ed60ad26557c", - "sha256:d5da73735293558eb1651ee2fddc4d0dedcfa06538b8813a2e20011583c9e49b" - ], - "version": "==0.14.1" - }, - "wtforms": { - "hashes": [ - "sha256:0cdbac3e7f6878086c334aa25dc5a33869a3954e9d1e015130d65a69309b3b61", - "sha256:e3ee092c827582c50877cdbd49e9ce6d2c5c1f6561f849b3b068c1b8029626f1" - ], - "version": "==2.2.1" - } - }, - "develop": { - "atomicwrites": { - "hashes": [ - "sha256:0312ad34fcad8fac3704d441f7b317e50af620823353ec657a53e981f92920c0", - "sha256:ec9ae8adaae229e4f8446952d204a3e4b5fdd2d099f9be3aaf556120135fb3ee" - ], - "markers": "python_version >= '2.7' and python_version != '3.3.*' and python_version != '3.1.*' and python_version != '3.0.*' and python_version != '3.2.*'", - "version": "==1.2.1" - }, - "attrs": { - "hashes": [ - "sha256:10cbf6e27dbce8c30807caf056c8eb50917e0eaafe86347671b57254006c3e69", - "sha256:ca4be454458f9dec299268d472aaa5a11f67a4ff70093396e1ceae9c76cf4bbb" - ], - "version": "==18.2.0" - }, - "blinker": { - "hashes": [ - "sha256:471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6" - ], - "index": "pypi", - "version": "==1.4" - }, - "certifi": { - "hashes": [ - "sha256:376690d6f16d32f9d1fe8932551d80b23e9d393a8578c5633a2ed39a64861638", - "sha256:456048c7e371c089d0a77a5212fb37a2c2dce1e24146e3b7e0261736aaeaa22a" - ], - "version": "==2018.8.24" - }, - "chardet": { - "hashes": [ - "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", - "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" - ], - "version": "==3.0.4" - }, - "click": { - "hashes": [ - "sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d", - "sha256:f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b" - ], - "version": "==6.7" - }, - "coverage": { - "hashes": [ - "sha256:0dcf381f51f589f1f797449602a7fe4e63be8a7963c259c13742af3f30be902e", - "sha256:11a4bb30306def2fa012e3429de44a93ef2ae3b6ad3f6b800f6c578658a5c402", - "sha256:166c957a38b034050a14201f64eec11fc95e17bf2ba31fc07d887db82bae1a47", - "sha256:184e6680f85fcc1b371f67ab732290ecf96a225448198e14ec170986db47b0aa", - "sha256:1904deb72c561a8e445feb190db07ca4b165ee85567894b4b85fdb9bf21a27c0", - "sha256:1f2003b83426cfaadebff8b9bb1fb3650134a15fda3a81434cc8415896d7a7bc", - "sha256:1f462997b1804f8b5d1ee2b262626fc76b746e66023eb64f529af35991167c7c", - "sha256:213697f49eba45b5fb05e77f63bdb7c0d13eed12dcd08e6af43224615b28b524", - "sha256:2557da232b0daeb55afe2f7e55f7b80c56bfa2981864c6638b32b5691da9f4c3", - "sha256:395a8525f1456439a5d6c248bc1397040491047e3e0e0c4ceb2059155419cd3b", - "sha256:43d6334b35e50e74d034ec075ffd9082c559bca624924af6c7e9d2b8aef0f362", - "sha256:4566c74bde36aaaef0372fb11678edf43dcc73f4eb8dbb6987250658c4a3b95a", - "sha256:6d39cc527c9c7a30f20bed14b5cf9a7e87ef1f3528c1847d1c81caf75a31ebb6", - "sha256:8bd69d3cba21d885df6fe8728cee779a722da08cf84072558956c148b5ab61e5", - "sha256:a1d0fcbbe0735eb66c6622266b12e60ea8d37ada405cb8f73b154c5eec467187", - "sha256:ab706bfbb365f232be01a536a9199ee6bfc80c9b63fb7825fdd5f4ae5cc2a12c", - "sha256:afbf4cee68d2f2968b06951cf16c0b18513eb59bb3af0685084de6cacb04e217", - "sha256:bbc8913cd5889df7eab597a4b4074a2c6c5ee6ca9aad58a9ba0f3f847b1a99df", - "sha256:bd5428ab378a7432e43afa52b6bb9c5d48f5029f395a97dc9ebf87fc0f2a9d8b", - "sha256:c3efe0185583443e04f8519818f4772d92fbbdf5f9fa23165f2f2482b20efc37", - "sha256:d40277e918da575d008e2955a0ca6600f870bdb3570b07ee3a754ea9301862e7", - "sha256:d4b6ec6951e20ea3f5d1fefe35b4bcbf692d4306f1b932c28dd2ee4cb167152c", - "sha256:d5837e813ad62c856bc80f988c4e24e0d2b7b22a8a1dad8c1cfcb8ff4d4750a8", - "sha256:d9583ae0e152c5fb0142cb55c3a11e1b13006c00d0c3e8b35ccc2d4ebfc6645e", - "sha256:e27380cbe4088a1df514e75aa4fe6dc9e98bbd7902cf28ab16e8b2de0f8cb344", - "sha256:e624daef32f8808296312e72190c7e576852cb75c27935b31c1bbbde14ab353c", - "sha256:ef4278e5ac1e47c731ec5e3e48351721e01d2eb4fefa9b97fcdba7495a82cfad" - ], - "index": "pypi", - "version": "==5.0a2" - }, - "flask": { - "hashes": [ - "sha256:2271c0070dbcb5275fad4a82e29f23ab92682dc45f9dfbc22c02ba9b9322ce48", - "sha256:a080b744b7e345ccfcbc77954861cb05b3c63786e93f2b3875e0913d44b43f05" - ], - "index": "pypi", - "version": "==1.0.2" - }, - "flask-debugtoolbar": { - "hashes": [ - "sha256:3d9657bc0c3633ace429e3ff451742bb59d1b7a7b95c9eb23a65ac9be2812959", - "sha256:ec810083123aae0632eb32ba11e1cb4cdace81e7ce6c5009dd06c5204afbce52" - ], - "index": "pypi", - "version": "==0.10.1" - }, - "idna": { - "hashes": [ - "sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e", - "sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16" - ], - "version": "==2.7" - }, - "itsdangerous": { - "hashes": [ - "sha256:cbb3fcf8d3e33df861709ecaf89d9e6629cff0a217bc2848f1b41cd30d360519" - ], - "version": "==0.24" - }, - "jinja2": { - "hashes": [ - "sha256:74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd", - "sha256:f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4" - ], - "version": "==2.10" - }, - "markupsafe": { - "hashes": [ - "sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665" - ], - "version": "==1.0" - }, - "mock": { - "hashes": [ - "sha256:5ce3c71c5545b472da17b72268978914d0252980348636840bd34a00b5cc96c1", - "sha256:b158b6df76edd239b8208d481dc46b6afd45a846b7812ff0ce58971cf5bc8bba" - ], - "index": "pypi", - "version": "==2.0.0" - }, - "more-itertools": { - "hashes": [ - "sha256:c187a73da93e7a8acc0001572aebc7e3c69daf7bf6881a2cea10650bd4420092", - "sha256:c476b5d3a34e12d40130bc2f935028b5f636df8f372dc2c1c01dc19681b2039e", - "sha256:fcbfeaea0be121980e15bc97b3817b5202ca73d0eae185b4550cbfce2a3ebb3d" - ], - "version": "==4.3.0" - }, - "pbr": { - "hashes": [ - "sha256:1b8be50d938c9bb75d0eaf7eda111eec1bf6dc88a62a6412e33bf077457e0f45", - "sha256:b486975c0cafb6beeb50ca0e17ba047647f229087bd74e37f4a7e2cac17d2caa" - ], - "version": "==4.2.0" - }, - "pipenv": { - "hashes": [ - "sha256:6ecf60c66187c6ca25a2dcd095036aba07539354a5011d94805fbfc5932582b0", - "sha256:bb6bd074f853d9bab675942226a785a64d4fc42b5847538755e9573f5b77f63a", - "sha256:d4b1aea904ae1488b7060137059642246baae709232f4536ad723ce216e4b540" - ], - "markers": "python_version != '3.3.*' and python_version != '3.1.*' and python_version != '3.2.*' and python_version >= '2.7' and python_version != '3.0.*'", - "version": "==2018.7.1" - }, - "pipenv-to-requirements": { - "hashes": [ - "sha256:1ddb3ef76062cc6f360d29771881ebb4911d1581591ec61a6334953834622d23" - ], - "index": "pypi", - "version": "==0.5.1" - }, - "pluggy": { - "hashes": [ - "sha256:6e3836e39f4d36ae72840833db137f7b7d35105079aee6ec4a62d9f80d594dd1", - "sha256:95eb8364a4708392bae89035f45341871286a333f749c3141c20573d2b3876e1" - ], - "markers": "python_version != '3.1.*' and python_version != '3.0.*' and python_version >= '2.7' and python_version != '3.2.*' and python_version != '3.3.*'", - "version": "==0.7.1" - }, - "py": { - "hashes": [ - "sha256:06a30435d058473046be836d3fc4f27167fd84c45b99704f2fb5509ef61f9af1", - "sha256:50402e9d1c9005d759426988a492e0edaadb7f4e68bcddfea586bc7432d009c6" - ], - "markers": "python_version >= '2.7' and python_version != '3.3.*' and python_version != '3.1.*' and python_version != '3.0.*' and python_version != '3.2.*'", - "version": "==1.6.0" - }, - "pytest": { - "hashes": [ - "sha256:453cbbbe5ce6db38717d282b758b917de84802af4288910c12442984bde7b823", - "sha256:a8a07f84e680482eb51e244370aaf2caa6301ef265f37c2bdefb3dd3b663f99d" - ], - "index": "pypi", - "version": "==3.8.0" - }, - "requests": { - "hashes": [ - "sha256:63b52e3c866428a224f97cab011de738c36aec0185aa91cfacd418b5d58911d1", - "sha256:ec22d826a36ed72a7358ff3fe56cbd4ba69dd7a6718ffd450ff0e9df7a47ce6a" - ], - "index": "pypi", - "version": "==2.19.1" - }, - "six": { - "hashes": [ - "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", - "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" - ], - "index": "pypi", - "version": "==1.11.0" - }, - "urllib3": { - "hashes": [ - "sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf", - "sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5" - ], - "markers": "python_version != '3.0.*' and python_version != '3.1.*' and python_version < '4' and python_version >= '2.6' and python_version != '3.3.*' and python_version != '3.2.*'", - "version": "==1.23" - }, - "virtualenv": { - "hashes": [ - "sha256:2ce32cd126117ce2c539f0134eb89de91a8413a29baac49cbab3eb50e2026669", - "sha256:ca07b4c0b54e14a91af9f34d0919790b016923d157afda5efdde55c96718f752" - ], - "markers": "python_version != '3.2.*' and python_version >= '2.7' and python_version != '3.1.*' and python_version != '3.0.*'", - "version": "==16.0.0" - }, - "virtualenv-clone": { - "hashes": [ - "sha256:4507071d81013fd03ea9930ec26bc8648b997927a11fa80e8ee81198b57e0ac7", - "sha256:b5cfe535d14dc68dfc1d1bb4ac1209ea28235b91156e2bba8e250d291c3fb4f8" - ], - "version": "==0.3.0" - }, - "werkzeug": { - "hashes": [ - "sha256:c3fd7a7d41976d9f44db327260e263132466836cef6f91512889ed60ad26557c", - "sha256:d5da73735293558eb1651ee2fddc4d0dedcfa06538b8813a2e20011583c9e49b" - ], - "version": "==0.14.1" - } - } -} diff --git a/Piplock b/Piplock deleted file mode 100644 index b31227c..0000000 --- a/Piplock +++ /dev/null @@ -1,29 +0,0 @@ -[[source]] -url = "https://pypi.org/simple" -verify_ssl = true -name = "pypi" - -[packages] -flask = "*" -flask-sqlalchemy = "*" -flask-migrate = "*" -sqlalchemy-migrate = "*" -flask-wtf = "*" -flask-babel = "*" -wtforms-alchemy = "*" -"jinja2-highlight" = "*" -"psycopg2" = "*" -sqlalchemy-utils = "*" -python-slugify = "*" -flask-login = "*" -passlib = "*" - -[dev-packages] -pytest = "*" -pipenv-to-requirements = "*" -coverage = "*" -blinker = "*" -flask-debugtoolbar = "*" - -[requires] -python_version = "3" diff --git a/requirements-dev.txt b/requirements-dev.txt index 6d4c1bd..77842d5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,39 +1,4 @@ -################################################################################ -# This requirements file has been automatically generated from `Pipfile` with -# `pipenv-to-requirements` -# -# -# This has been done to maintain backward compatibility with tools and services -# that do not support `Pipfile` yet. -# -# Do NOT edit it directly, use `pipenv install [-d]` to modify `Pipfile` and -# `Pipfile.lock` and then regenerate `requirements*.txt`. -################################################################################ - -atomicwrites==1.2.1 -attrs==18.2.0 -blinker==1.4 -certifi==2018.8.24 -chardet==3.0.4 -click==6.7 -coverage==5.0a2 -flask-debugtoolbar==0.10.1 -flask==1.0.2 -idna==2.7 -itsdangerous==0.24 -jinja2==2.10 -markupsafe==1.0 -mock==2.0.0 -more-itertools==4.3.0 -pbr==4.2.0 -pipenv-to-requirements==0.5.1 -pipenv==2018.7.1 -pluggy==0.7.1 -py==1.6.0 -pytest==3.8.0 -requests==2.19.1 -six==1.11.0 -urllib3==1.23 -virtualenv-clone==0.3.0 -virtualenv==16.0.0 -werkzeug==0.14.1 +pytest +coverage +blinker +flask-debugtoolbar diff --git a/requirements.txt b/requirements.txt index 08007a7..029f135 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,28 +1,7 @@ -################################################################################ -# This requirements file has been automatically generated from `Pipfile` with -# `pipenv-to-requirements` -# -# -# This has been done to maintain backward compatibility with tools and services -# that do not support `Pipfile` yet. -# -# Do NOT edit it directly, use `pipenv install [-d]` to modify `Pipfile` and -# `Pipfile.lock` and then regenerate `requirements*.txt`. -################################################################################ - -babel==2.6.0 -click==6.7 -dominate==2.3.1 +flask==1.0.2 +flask-wtf==0.14.2 flask-babel==0.11.2 +keyboard>=0.13,<0.14 +six>=1.8.0 flask-bootstrap-4-alpha==4.0.0b3.dev2 -flask-wtf==0.14.2 -flask==1.0.2 -itsdangerous==0.24 -jinja2==2.10 -keyboard==0.13.2 -markupsafe==1.0 -pytz==2018.5 -six>=1.10.0 -visitor==0.1.3 -werkzeug==0.14.1 -wtforms==2.2.1 +mock diff --git a/setup.py b/setup.py index d95782c..bb82870 100755 --- a/setup.py +++ b/setup.py @@ -10,10 +10,8 @@ long_description = '' -requirements = [] -if isfile('requirements.txt'): - with open('requirements.txt') as fp: - requirements = fp.readlines() +with open('requirements.txt') as fp: + requirements = fp.readlines() setup(