From 29b5f4cfb6f058d35454854451f49a80ef54e3d6 Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Mon, 12 Nov 2018 18:11:04 -0300 Subject: [PATCH] Pipfile: add pyflakes - requirements: add pipenv so tox can use it when running - add setup.py - add tox.ini --- Pipfile | 1 + Pipfile.lock | 16 ++++++++++++---- README.md | 17 +++++++++++++++-- requirements.txt | 1 + setup.py | 10 ++++++++++ tox.ini | 10 ++++++++++ 6 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 requirements.txt create mode 100644 setup.py create mode 100644 tox.ini diff --git a/Pipfile b/Pipfile index 0721b14..0178c3a 100644 --- a/Pipfile +++ b/Pipfile @@ -16,6 +16,7 @@ quart = {editable = true, ref = "e23714d5", git = "https://gitlab.com/pgjones/qu [dev-packages] pytest = "==3.10.1" pytest-asyncio = "==0.9.0" +pyflakes = "*" [requires] python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock index a107732..00577b1 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "a8bf8c0b56b1a98958247f12c6928caa241407cd0596d2dab58650260d452a97" + "sha256": "facb4ec2c4c7ece37adbeb5dd9dcf23bef7c4d6a5cd952393f022a6369a9bbf3" }, "pipfile-spec": 6, "requires": { @@ -173,10 +173,10 @@ }, "hypercorn": { "hashes": [ - "sha256:824dc6385854a8cee440a444405c7ae3cd083cf3a86d850c22f7e98c5236c22e", - "sha256:f96c8cd6f3e60812f89388580cf4c692b8a4a5b88888e73bd9f0d9afad435a05" + "sha256:d563272b41269e9b2a73b1058f2471a511b545f64090b3fc2d6006cbaf8109fe", + "sha256:f6e8c5f02e9c97d6981c56098be379cb0f9c2a48f64c1d5dd2a8f228b61bc2b8" ], - "version": "==0.4.0" + "version": "==0.4.1" }, "hyperframe": { "hashes": [ @@ -388,6 +388,14 @@ ], "version": "==1.7.0" }, + "pyflakes": { + "hashes": [ + "sha256:9a7662ec724d0120012f6e29d6248ae3727d821bba522a0e6b356eff19126a49", + "sha256:f661252913bc1dbe7fcfcbf0af0db3f42ab65aabd1a6ca68fe5d466bace94dae" + ], + "index": "pypi", + "version": "==2.0.0" + }, "pytest": { "hashes": [ "sha256:3f193df1cfe1d1609d4c583838bea3d532b18d6160fd3f55c9447fdca30848ec", diff --git a/README.md b/README.md index 3b3756f..3cbd787 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This project is a rewrite of [litecord-reference]. ## Notes - - There are no testing being run on the current codebase. Which means the code is definitely unstable. + - Unit testing isn't completly perfect. - No voice is planned to be developed, for now. - You must figure out connecting to the server yourself. Litecord will not distribute Discord's official client code nor provide ways to modify the client. @@ -17,7 +17,7 @@ This project is a rewrite of [litecord-reference]. ## Install Requirements: -- Python 3.6 or higher +- Python 3.7 or higher - PostgreSQL - [Pipenv] @@ -61,3 +61,16 @@ $ pipenv run hypercorn run:app $ git pull $ pipenv run ./manage.py migrate ``` + +## Running tests + +To run tests we must create users that we know the passwords of. +Because of that, **never setup a testing environment in production.** + +```sh +# setup the testing users +$ pipenv run ./manage.py setup_tests + +# run tests +$ pipenv run tox +``` diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..990d168 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pipenv diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..d0235c2 --- /dev/null +++ b/setup.py @@ -0,0 +1,10 @@ +from setuptools import setup + +setup( + name='litecord', + version='0.0.1', + description='Implementation of the Discord API', + url='https://litecord.top', + author='Luna Mendes', + python_requires='>=3.7' +) diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..4e15385 --- /dev/null +++ b/tox.ini @@ -0,0 +1,10 @@ +[tox] +envlist = py3 + +[testenv] +deps = -rrequirements.txt +commands = + pipenv install --dev + pyflakes run.py + pyflakes litecord/ + pytest tests