From 56b041452441ef32dec12c28c8b2eebbe09ceafc Mon Sep 17 00:00:00 2001 From: Samuel Dion-Girardeau Date: Mon, 22 Aug 2016 19:58:38 -0400 Subject: [PATCH 1/5] Explicitly list dev requirements in dedicated file Pinning the versions to the latest stable at current time. --- CONTRIBUTING.rst | 1 + dev-requirements.txt | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 dev-requirements.txt diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 20bf915..c1cba69 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -77,6 +77,7 @@ Here's how to set up `snappass` for local development. $ mkvirtualenv snappass $ cd snappass/ $ python setup.py develop + $ pip install -r dev-requirements.txt 4. Create a branch for local development:: diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 0000000..908833f --- /dev/null +++ b/dev-requirements.txt @@ -0,0 +1,3 @@ +coverage==4.2 +flake8==3.0.4 +tox==2.3.1 From a8401434cbb246a9feb3f6740602745cf9484403 Mon Sep 17 00:00:00 2001 From: Samuel Dion-Girardeau Date: Mon, 22 Aug 2016 20:00:36 -0400 Subject: [PATCH 2/5] Bump flask to 0.11.1 One of the main advantages is the easy debug mode, with autoreload capabilities. Several other fixes & features: http://flask.pocoo.org/docs/0.11/changelog/#version-0-11 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 222c1be..2de30ad 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Flask==0.10.1 +Flask==0.11.1 Jinja2==2.7.1 MarkupSafe==0.18 Werkzeug==0.9.4 From ae9bebb365407d34f756711a9c9e75a18e9994ff Mon Sep 17 00:00:00 2001 From: Samuel Dion-Girardeau Date: Mon, 22 Aug 2016 20:13:10 -0400 Subject: [PATCH 3/5] Add debug server steps to development flow --- CONTRIBUTING.rst | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index c1cba69..fd0af6c 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -85,25 +85,35 @@ Here's how to set up `snappass` for local development. Now you can make your changes locally. -5. When you're done making changes, check that your changes pass the tests and +5. You can test your changes in a development server with debug and autoreload:: + + $ docker run -d --name redis-server -p 6379:6379 redis + $ export FLASK_DEBUG=1 && \ + export FLASK_APP=snappass.main && \ + export NO_SSL=True + $ flask run + + You now have a running instance on localhost:5000/ + +6. When you're done making changes, check that your changes pass the tests and flake8:: $ flake8 snappass tests $ tox -6. Commit your changes and push your branch to GitHub:: +7. Commit your changes and push your branch to GitHub:: $ git add . $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature -7. Check that the test coverage hasn't dropped:: +8. Check that the test coverage hasn't dropped:: coverage run --source snappass setup.py tests coverage report -m coverage html -8. Submit a pull request through the GitHub website. +9. Submit a pull request through the GitHub website. Pull Request Guidelines ----------------------- From 9177f0fab0ba9e746260b8cecfbf916b540f3eda Mon Sep 17 00:00:00 2001 From: Samuel Dion-Girardeau Date: Mon, 22 Aug 2016 20:14:25 -0400 Subject: [PATCH 4/5] Fix flake8 command in development flow - Missing setup.py, and wrong path for tests - Removed extra new lines that was causing a warning --- CONTRIBUTING.rst | 2 +- setup.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index fd0af6c..a1832c4 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -98,7 +98,7 @@ Here's how to set up `snappass` for local development. 6. When you're done making changes, check that your changes pass the tests and flake8:: - $ flake8 snappass tests + $ flake8 snappass tests.py setup.py $ tox 7. Commit your changes and push your branch to GitHub:: diff --git a/setup.py b/setup.py index 562b643..0bf1581 100644 --- a/setup.py +++ b/setup.py @@ -36,4 +36,3 @@ setup( ], zip_safe=False, ) - From 0d76a624273c2168e91b55c192b518857806da77 Mon Sep 17 00:00:00 2001 From: Samuel Dion-Girardeau Date: Mon, 22 Aug 2016 20:24:37 -0400 Subject: [PATCH 5/5] Fix coverage commands - Remove setup.py, as the tests don't run it; - Put the correct test command; - Add `$ ` prompts, for conformity with the previous steps. --- CONTRIBUTING.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index a1832c4..ac76b77 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -109,9 +109,9 @@ Here's how to set up `snappass` for local development. 8. Check that the test coverage hasn't dropped:: - coverage run --source snappass setup.py tests - coverage report -m - coverage html + $ coverage run --source snappass tests.py + $ coverage report -m + $ coverage html 9. Submit a pull request through the GitHub website.