Package: paque
Paque¯\_(ツ)_/¯InstallationTab completionWhy?What?How?FAQWhy YAML and not FOOML?Is this production ready?What's with the name?ContributingFuture developmentPaque simplifies running simple workflows you want to run. It offers a few
features ofmake, but removing most of its power. It runs on apaquefileorpaquefile.yaml(or just pass the name of the file). You can see a simpleexample in the root folder.It supports Python 3.6.5+ (for no particular reason aside from being my default,
it should work just fine on any relatively recent Python 3)InstallationIt should be enough to runpipinstallpaqueand thenpaquetaskname# If you have a paquefile or paquefile.yaml fileTab completionThis is a reminder to myself to implement tab completion (at lest for ZSH, since
I have done that before)Why?I had a series ofDockerfileI wanted to build sequentially, and run some
commands. It wasn't a right fit for docker-compose, so I wrote a makefile
(here).
The result was excellent, BUT if you want to add logging, or any kind of
information you need to start resorting to "makefile hacks" (like passing
variables down the dependency stack, or accessing subpaths of requirements...)
that didn't feel right.So, I decided to write this.What?You define your tasks in a YAML file with specific syntax, of the form:taskname:-run:"whatitruns"-message:"whatitlogs"-depends:-task_it_depends_1-task_it_depends_2-sleep:integerotherwise:-run:-"Youcanrunseveralcommands"-"Passingthemasanarray"-message:-"Likewiseforlogging"-"Yes."You can also use arguments, multiple arguments, and conditionstaskname:-run:"{something}{folder}"-message:"Thisdoes{something}on{folder}"-condition:"do-if-bash-says-this-is-0"main:-depends:-taskname folder:/Users/foo/ something:rmdirFor now you can't have spaces in arguments. Sorry. Also, there is no way at the
moment to pass arguments from the command line to tasks, this will be coming
soon.For usage, you would justpaquetasknameHow?YAML (following the rules above) is converted into a dictionary of task names
andTasksby aParser. Then a simple
depth-first-searchplannerfinds an execution that satisfies
all dependencies and transitive dependencies (with arguments) oftaskname.
Finally, the plan is passed to anexecutorthat offloads it
to the shell (or just logs it).FAQWhy YAML and not FOOML?I find YAML pretty readable and writable, as long as you restrict what you can
do. Since there is no nesting here, you can't shoot yourself in the foot with
YAML. If you really can't stand YAML, you have two optionsUsedhalland convert from dhall to YAML (recommended)Write aparserfor your favourite markupIs this production ready?Well…¯\_(ツ)_/¯I'm pretty sure there is an issue with argument replacement
in a corner case, but I can't put my finger on which. For simple use cases, this
should be safe. Since there is no branching, there is not much that can go wrong
though.What's with the name?For one, it'spython+make=pake, but it was taken (I should have checked
before), so left it atpaque. It's also a form of "pa' qué", an Spanish slang
for "para qué". I.e.what for?¯\_(ツ)_/¯ContributingI'm happy to receive PRs, so don't be shy. Also let me know if you used it, that
could be fun. As you see from the root folder, you will need to usepoetryFuture developmentI will keep using it, so any bugs I find will be fixed. Likewise, I will keep
improving it, although the current version is "almost enough". Currently on the
"roadmap" I have:Fix dry-run display of run when it is multilineGenerate a graphviz plot of the plan(s). This was one of the motivations to
write my own thingy, after allBetter tests: I wrote the ones I have with a combination of TDD and "let's
test and print". I want less tests of happy paths and more tests of corner
casesCustom exceptions, right now it's just "raise that"Automatically convert paquefile.dhall into a YAML paquefile (this was supposed
to be in this version but I got lazy)Have a nicer CLI (probably usingcleo)Moved to usingclick, after the
great experience withmotlloPossibly, running tasks in parallel (this is a hard one given how the planner
works, so probably won't)Conditionals?Available as optional tasks. The condition ison what is
run, assumes that the taskhas runif condition isfalse. So,a false
condition does not stop execution of the rest of the planFixing the bug that is likely there in argument substitution (note: I have
been usingpaquequite regularly in other projects and I have still not hit
it)