| 1 |
========= |
| 2 |
Prior art |
| 3 |
========= |
| 4 |
|
| 5 |
Why another task-running/subprocess-spawning Python library? As usual, the |
| 6 |
short answer is "there were already great 80-90% solutions out there, but none |
| 7 |
that fit our needs 100%." Specifically: |
| 8 |
|
| 9 |
- **Multiple tasks at once** - almost no other Python command-line oriented |
| 10 |
libraries allow for invocations like:: |
| 11 |
|
| 12 |
runner --core-opts task1 --task1-opts task2 --task2-opts |
| 13 |
|
| 14 |
and the few that do have half-baked implementations of the feature or are |
| 15 |
lacking in other ways. |
| 16 |
- **Ability to mirror and capture subprocess output simultaneously** (in |
| 17 |
addition to everything flowing from that, like the ability to transparently |
| 18 |
auto-respond) - the standard library's ``subprocess`` can't do this and most |
| 19 |
other tools choose one or the other, or have other tradeoffs such as not |
| 20 |
supporting (or *only* supporting!) pseudoterminals. |
| 21 |
- **Simplicity** - tools that try to do many things often suffer for it due to |
| 22 |
lack of focus. We wanted to build something clean and simple that just did |
| 23 |
one thing (ok...two things) well. |
| 24 |
- **Customizability/control** - Invoke was designed to work well with (and be a |
| 25 |
foundation for) other tools such as `Fabric <http://fabfile.org>`_'s second |
| 26 |
version, and we felt that the work needed to adapt existing tools towards |
| 27 |
this goal would impede progress. |
| 28 |
|
| 29 |
Some of the pre-existing solutions in this space in the Python world include: |
| 30 |
|
| 31 |
- `Argh <http://packages.python.org/argh/index.html>`_: One of the more |
| 32 |
appealing options, but being built on argparse it doesn't support the |
| 33 |
multi-task invocation we needed. Also has its own "prior art" list which is |
| 34 |
worth your time. |
| 35 |
- `Baker <http://pypi.python.org/pypi/Baker/1.02>`_: Nice and simple, but |
| 36 |
unfortunately too much so for our needs. |
| 37 |
- `Paver <http://paver.github.com/paver/>`_: Tries to do too much, clunky API, |
| 38 |
user-hostile error messages, multi-task feature existed but was lacking. |
| 39 |
- `Argparse <http://docs.python.org/library/argparse.html>`_: The modern gold |
| 40 |
standard for CLI parsing (albeit without command execution). Unfortunately, |
| 41 |
we were unable to get multiple tasks working despite lots of experimentation. |
| 42 |
Multiple tasks with their own potentially overlapping argument names, simply |
| 43 |
doesn't mesh with how ``argparse`` thinks about the command line. |
| 44 |
- `Click <https://github.com/pallets/click>`_: is actually not pre-existing |
| 45 |
(Invoke's first public releases predate Click by a number of years) but it |
| 46 |
deserves mention anyway, as it's become popular in this particular niche. |