| 1 |
# -*- coding: UTF-8 -*- |
| 2 |
# pylint: disable=wrong-import-position, wrong-import-order |
| 3 |
""" |
| 4 |
Invoke build script. |
| 5 |
Show all tasks with:: |
| 6 |
|
| 7 |
invoke -l |
| 8 |
|
| 9 |
.. seealso:: |
| 10 |
|
| 11 |
* http://pyinvoke.org |
| 12 |
* https://github.com/pyinvoke/invoke |
| 13 |
""" |
| 14 |
|
| 15 |
from __future__ import absolute_import |
| 16 |
|
| 17 |
# ----------------------------------------------------------------------------- |
| 18 |
# BOOTSTRAP PATH: Use provided vendor bundle if "invoke" is not installed |
| 19 |
# ----------------------------------------------------------------------------- |
| 20 |
from . import _setup # pylint: disable=wrong-import-order |
| 21 |
INVOKE_MINVERSION = "0.14.0" |
| 22 |
_setup.setup_path() |
| 23 |
_setup.require_invoke_minversion(INVOKE_MINVERSION) |
| 24 |
|
| 25 |
# ----------------------------------------------------------------------------- |
| 26 |
# IMPORTS: |
| 27 |
# ----------------------------------------------------------------------------- |
| 28 |
import sys |
| 29 |
from invoke import Collection |
| 30 |
|
| 31 |
# -- TASK-LIBRARY: |
| 32 |
from . import clean |
| 33 |
from . import docs |
| 34 |
from . import test |
| 35 |
from . import release |
| 36 |
|
| 37 |
# ----------------------------------------------------------------------------- |
| 38 |
# TASKS: |
| 39 |
# ----------------------------------------------------------------------------- |
| 40 |
# None |
| 41 |
|
| 42 |
|
| 43 |
# ----------------------------------------------------------------------------- |
| 44 |
# TASK CONFIGURATION: |
| 45 |
# ----------------------------------------------------------------------------- |
| 46 |
namespace = Collection() |
| 47 |
namespace.add_task(clean.clean) |
| 48 |
namespace.add_task(clean.clean_all) |
| 49 |
namespace.add_collection(Collection.from_module(docs)) |
| 50 |
namespace.add_collection(Collection.from_module(test)) |
| 51 |
namespace.add_collection(Collection.from_module(release)) |
| 52 |
|
| 53 |
# -- INJECT: clean configuration into this namespace |
| 54 |
namespace.configure(clean.namespace.configuration()) |
| 55 |
if sys.platform.startswith("win"): |
| 56 |
# -- OVERRIDE SETTINGS: For platform=win32, ... (Windows) |
| 57 |
from ._compat_shutil import which |
| 58 |
run_settings = dict(echo=True, pty=False, shell=which("cmd")) |
| 59 |
namespace.configure({"run": run_settings}) |