Skip to content

Commit b497e2c

Browse files
Johnetordofffelliott
authored andcommitted
update tasks.py to support invoke v0.13.0
* invoke v0.13.0 broke back-compat by requiring the context object be passed to all tasks. This change updates our tasks and bumps the required version of invoke.
1 parent dc5f150 commit b497e2c

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ install:
1616
- travis_retry pip install --upgrade pip
1717
- travis_retry pip install setuptools==30.4.0
1818
- travis_retry pip install wheel==0.26.0
19-
- travis_retry pip install invoke==0.11.1
19+
- travis_retry pip install invoke==0.13.0
2020
- travis_retry invoke wheelhouse --develop
2121
- travis_retry invoke install --develop
2222

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ aiohttp==0.18.4
22
chardet==2.3.0
33
furl==0.4.2
44
humanfriendly==2.1
5-
invoke==0.11.1
5+
invoke==0.13.0
66
mako==1.0.1
77
raven==5.27.0
88
setuptools==30.4.0

tasks.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import os
22

3-
from invoke import task, run
3+
from invoke import task
44

55
WHEELHOUSE_PATH = os.environ.get('WHEELHOUSE')
66

77

8-
def monkey_patch():
8+
def monkey_patch(ctx):
99
# Force an older cacert.pem from certifi v2015.4.28, prevents an ssl failure w/ identity.api.rackspacecloud.com.
1010
#
1111
# SubjectAltNameWarning: Certificate for identity.api.rackspacecloud.com has no `subjectAltName`, falling
@@ -25,40 +25,40 @@ def create_default_context(purpose=ssl.Purpose.SERVER_AUTH, *, cafile=None, capa
2525

2626

2727
@task
28-
def wheelhouse(develop=False):
28+
def wheelhouse(ctx, develop=False):
2929
req_file = 'dev-requirements.txt' if develop else 'requirements.txt'
3030
cmd = 'pip wheel --find-links={} -r {} --wheel-dir={}'.format(WHEELHOUSE_PATH, req_file, WHEELHOUSE_PATH)
31-
run(cmd, pty=True)
31+
ctx.run(cmd, pty=True)
3232

3333

3434
@task
35-
def install(develop=False):
36-
run('python setup.py develop')
35+
def install(ctx, develop=False):
36+
ctx.run('python setup.py develop')
3737
req_file = 'dev-requirements.txt' if develop else 'requirements.txt'
3838
cmd = 'pip install --upgrade -r {}'.format(req_file)
3939

4040
if WHEELHOUSE_PATH:
4141
cmd += ' --no-index --find-links={}'.format(WHEELHOUSE_PATH)
42-
run(cmd, pty=True)
42+
ctx.run(cmd, pty=True)
4343

4444

4545
@task
46-
def flake():
47-
run('flake8 .', pty=True)
46+
def flake(ctx):
47+
ctx.run('flake8 .', pty=True)
4848

4949

5050
@task
51-
def test(verbose=False):
52-
flake()
51+
def test(ctx, verbose=False):
52+
flake(ctx)
5353
cmd = 'py.test --cov-report term-missing --cov mfr tests'
5454
if verbose:
5555
cmd += ' -v'
56-
run(cmd, pty=True)
56+
ctx.run(cmd, pty=True)
5757

5858

5959
@task
60-
def server():
61-
monkey_patch()
60+
def server(ctx):
61+
monkey_patch(ctx)
6262

6363
if os.environ.get('REMOTE_DEBUG', None):
6464
import pydevd

0 commit comments

Comments
 (0)