Skip to content
Snippets Groups Projects
Commit c5ba02a7 authored by Steven Loria's avatar Steven Loria
Browse files

Upgrade to invoke 0.13.0

parent ade2a08f
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,6 @@ python: ...@@ -8,6 +8,6 @@ python:
- 3.5 - 3.5
install: install:
- pip install cookiecutter - pip install cookiecutter
- pip install invoke==0.12.2 - pip install invoke==0.13.0
script: script:
- invoke test - invoke test
...@@ -5,7 +5,7 @@ import os ...@@ -5,7 +5,7 @@ import os
import json import json
import shutil import shutil
from invoke import task, run from invoke import task
HERE = os.path.abspath(os.path.dirname(__file__)) HERE = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(HERE, 'cookiecutter.json'), 'r') as fp: with open(os.path.join(HERE, 'cookiecutter.json'), 'r') as fp:
...@@ -17,13 +17,13 @@ REQUIREMENTS = os.path.join(COOKIE, 'requirements', 'dev.txt') ...@@ -17,13 +17,13 @@ REQUIREMENTS = os.path.join(COOKIE, 'requirements', 'dev.txt')
@task @task
def build(): def build(ctx):
"""Build the cookiecutter.""" """Build the cookiecutter."""
run('cookiecutter {0} --no-input'.format(HERE)) ctx.run('cookiecutter {0} --no-input'.format(HERE))
@task @task
def clean(): def clean(ctx):
"""Clean out generated cookiecutter.""" """Clean out generated cookiecutter."""
if os.path.exists(COOKIE): if os.path.exists(COOKIE):
shutil.rmtree(COOKIE) shutil.rmtree(COOKIE)
...@@ -32,14 +32,15 @@ def clean(): ...@@ -32,14 +32,15 @@ def clean():
print('App directory does not exist. Skipping.') print('App directory does not exist. Skipping.')
def _run_manage_command(command): def _run_flask_command(ctx, command):
run('FLASK_APP={0} flask {1}'.format(AUTOAPP, command), echo=True) ctx.run('FLASK_APP={0} flask {1}'.format(AUTOAPP, command), echo=True)
@task(pre=[clean, build]) @task(pre=[clean, build])
def test(): def test(ctx):
"""Run lint commands and tests.""" """Run lint commands and tests."""
run('pip install -r {0} --ignore-installed'.format(REQUIREMENTS), echo=True) ctx.run('pip install -r {0} --ignore-installed'.format(REQUIREMENTS),
echo=True)
os.chdir(COOKIE) os.chdir(COOKIE)
_run_manage_command('lint') _run_flask_command('lint')
_run_manage_command('test') _run_flask_command('test')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment