From 6f9f931f568bd15c12a17f417feb23a26ce29737 Mon Sep 17 00:00:00 2001 From: LI Yu Date: Thu, 30 Apr 2015 00:34:58 +0800 Subject: [PATCH 1/2] Update __init__.py Expose build function --- pynt/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pynt/__init__.py b/pynt/__init__.py index e6c86e9..86d8038 100644 --- a/pynt/__init__.py +++ b/pynt/__init__.py @@ -5,9 +5,9 @@ __version__ = "0.8.1" __license__ = "MIT License" __contact__ = "http://rags.github.com/pynt/" -from ._pynt import task, main +from ._pynt import task, main, build import pkgutil __path__ = pkgutil.extend_path(__path__,__name__) -__all__ = ["task", "main"] \ No newline at end of file +__all__ = ["task", "main", "build"] From 0b862f6e7e3b1186416164721378acf92b0dff41 Mon Sep 17 00:00:00 2001 From: LI Yu Date: Wed, 27 May 2015 15:39:58 +0800 Subject: [PATCH 2/2] Propagate args and kwargs to all dependencies Only the top task can receive args and kwargs, and it is last evaluated, this is useless. We should let all dependencies also able to access args. E.g., I may have a task run depends on task deploy, and I want to run some tests. So I pass a test params to run, but deploy has also to know this, as it needs it to deploy test files. --- pynt/_pynt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pynt/_pynt.py b/pynt/_pynt.py index e0a76ee..4243f4a 100644 --- a/pynt/_pynt.py +++ b/pynt/_pynt.py @@ -162,7 +162,7 @@ def _run(module, logger, task, completed_tasks, from_command_line = False, args # Satsify dependencies recursively. Maintain set of completed tasks so each # task is only performed once. for dependency in task.dependencies: - completed_tasks = _run(module,logger,dependency,completed_tasks) + completed_tasks = _run(module,logger,dependency,completed_tasks, from_command_line=False, args=args, kwargs=kwargs) # Perform current task, if need to. if from_command_line or task not in completed_tasks: @@ -292,4 +292,4 @@ def _get_logger(module): return logger def main(): - build(sys.argv[1:]) \ No newline at end of file + build(sys.argv[1:])