Giter Club home page Giter Club logo

makeit's Introduction

Makeit: A reimagined task loader for doit

Makeit is an alternative task loader written for the doit task automator. Makeit includes a CLI script to execute doit tasks loaded via the makeit task loader. Makeit was written to offer greater flexibility in the definition of doit tasks by adding three capabilities to the task definition workflow:

  1. Load tasks from multiple python modules. Also allow these modules to have any name and be loaded from any directory.
  2. Allow arbitrary data to be passed to tasks by the user, or to be passed to tasks by one another.
  3. Allow tasks to declare themselves as being depended on by other tasks.

Doit tasks are fully compatible with makeit, but makeit tasks which make use of makeit's extensions will not function if dropped in to a doit dodo.py file.

Configuring makeit

When using makeit's CLI script, the working directory must contain a makeit.cfg file. This file should be a .ini formatted file (or any other format accepted by python's ConfigParser) which, at a minimum, specifies an empty [makeit] section. In order for the configuration to be useful, the [makeit] section must specify a path directive, which specifies a : separated list of directories which contain python modules defining makeit tasks.

Every python module found within any of these directories will be processed for tasks. Like doit tasks, any defined python function whose name is prefixed with task_ will be called to create tasks.

Passing data

The makeit.cfg will be processed by the makeit CLI script into a dictionary of { 'sectionname': { 'directive1': 'value1', 'directive2': 'value2' } } items. This dicitonary will then be passed to any task creation methods which accept an argument.

Injecting Dependencies

Task generation functions may return an additional property in task dictionaries when being processed by makeit. Any task dictionary which contains the key task_before and a value which names another task will by dynamically added to the task_dep array of the task which it names. If the task which it names does not exist, the key will be silently dropped.

makeit's People

Contributors

lottspot avatar

Stargazers

 avatar

Watchers

 avatar  avatar

makeit's Issues

Uptodate information not being saved in .makeit.db

The uptodate database is still being written as .doit.db rather than .makeit.db

$ ls -lh .*.db
ls: cannot access '.*.db': No such file or directory
$ makeit
$ ls -lh .*.db
-rw-r--r-- 1 james users 12K Feb 14 10:38 .doit.db

Subtasks without 'name' field throw exceptions

A task which generates subtasks which do not specify a 'name' task will raise the following exception

Traceback (most recent call last):
  File "/mnt/files/shared/projects/inque-ink/.pyenv/lib/python2.7/site-packages/doit-0.29.0-py2.7.egg/doit/doit_cmd.py", line 168, in run
    return command.parse_execute(args)
  File "/mnt/files/shared/projects/inque-ink/.pyenv/lib/python2.7/site-packages/doit-0.29.0-py2.7.egg/doit/cmd_base.py", line 122, in parse_execute
    return self.execute(params, args)
  File "/mnt/files/shared/projects/inque-ink/.pyenv/lib/python2.7/site-packages/doit-0.29.0-py2.7.egg/doit/cmd_base.py", line 380, in execute
    self, params, args)
  File "build/bdist.linux-x86_64/egg/makeit/loader.py", line 33, in load_tasks
    processed = self._process_makeit_extensions(taskdicts)
  File "build/bdist.linux-x86_64/egg/makeit/loader.py", line 100, in _process_makeit_extensions
    self._makeit_ext_depinject_do(task)
  File "build/bdist.linux-x86_64/egg/makeit/loader.py", line 128, in _makeit_ext_depinject_do
    injected_deps = self._injections.get(task['name'], [])
KeyError: 'name'

Subtasks prepared by makeit cause exceptions in doit

Doit doesn't like the subtask dictionary being passed to it by makeit, causing an exception to be raised.

Traceback (most recent call last):
  File "/mnt/files/shared/projects/inque-ink/.pyenv/lib/python2.7/site-packages/doit-0.29.0-py2.7.egg/doit/doit_cmd.py", line 168, in run
    return command.parse_execute(args)
  File "/mnt/files/shared/projects/inque-ink/.pyenv/lib/python2.7/site-packages/doit-0.29.0-py2.7.egg/doit/cmd_base.py", line 122, in parse_execute
    return self.execute(params, args)
  File "/mnt/files/shared/projects/inque-ink/.pyenv/lib/python2.7/site-packages/doit-0.29.0-py2.7.egg/doit/cmd_base.py", line 380, in execute
    self, params, args)
  File "build/bdist.linux-x86_64/egg/makeit/loader.py", line 35, in load_tasks
    return self._processed_dicts_to_tasks(processed), self.doitcfg
  File "build/bdist.linux-x86_64/egg/makeit/loader.py", line 108, in _processed_dicts_to_tasks
    tasks.append(dict_to_task(taskdict))
  File "/mnt/files/shared/projects/inque-ink/.pyenv/lib/python2.7/site-packages/doit-0.29.0-py2.7.egg/doit/task.py", line 510, in dict_to_task
    return Task(**task_dict)
TypeError: __init__() got an unexpected keyword argument 'basename'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.