Commit 9d6fde94 authored by Marco Montabone 's avatar Marco Montabone

Fix tasks.py due to an Invoke breaking change

parent 8bd86365
...@@ -25,6 +25,11 @@ BASE = os.path.dirname(__file__) ...@@ -25,6 +25,11 @@ BASE = os.path.dirname(__file__)
PYTHON = "python3" PYTHON = "python3"
PROJECT = "managetests" PROJECT = "managetests"
# This is because invoke can't keep backward compatibility..
_invoke_v = invoke.__version__.split(".")
if int(_invoke_v[0]) == 0 and int(_invoke_v[1]) <= 12:
invoke.task = invoke.ctask
def create_env(name, requirements=False, self=False, force=False): def create_env(name, requirements=False, self=False, force=False):
"""Create a new virtual environment""" """Create a new virtual environment"""
...@@ -47,13 +52,13 @@ def create_env(name, requirements=False, self=False, force=False): ...@@ -47,13 +52,13 @@ def create_env(name, requirements=False, self=False, force=False):
@invoke.task @invoke.task
def devel(): def devel(ctx):
"""Setup the development environment""" """Setup the development environment"""
create_env("devel", self=True, force=True) create_env("devel", self=True, force=True)
@invoke.task @invoke.task
def build(): def build(ctx):
"""Create a new build""" """Create a new build"""
env = create_env("build", requirements=True) env = create_env("build", requirements=True)
...@@ -67,7 +72,7 @@ def build(): ...@@ -67,7 +72,7 @@ def build():
@invoke.task @invoke.task
def clean(): def clean(ctx):
"""Clean all the build things""" """Clean all the build things"""
for dir in "build", "%s.egg-info" % PROJECT: for dir in "build", "%s.egg-info" % PROJECT:
path = os.path.join(BASE, dir) path = os.path.join(BASE, dir)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment