The Joys Of Data-Driven Programming

Cem Karan cfkaran2 at gmail.com
Wed Aug 31 09:44:27 EDT 2016


On Aug 31, 2016, at 9:02 AM, Paul Moore <p.f.moore at gmail.com> wrote:

> On 31 August 2016 at 13:49, Cem Karan <cfkaran2 at gmail.com> wrote:
>>> Has anyone else found this to be the case? Is there any "make replacement" out there that focuses more on named sets of actions (maybe with prerequisite/successor type interdependencies), and less on building file dependency graphs?
>> 
>> Maybe Ninja (https://ninja-build.org/)?  I personally like it because of how simple it is, and the fact that it doesn't use leading tabs the way that make does.  It is intended to be the assembler for higher-level build systems which are more like compilers.  I personally use it as a make replacement because it does what I tell it to do, and nothing else.  It may fit what you're after.
> 
> It still seems focused on the file dependency graph (at least, from a
> quick look).
> 
> I'm thinking more of the makefile pattern
> 
> myproj.whl:
>    pip wheel .
> ve: build
>    virtualenv ve
>    ve/bin/python -m pip install ./*.whl
> test: ve
>    push ve
>    bin/python -m py.test
>    popd
> clean:
>    rm -rf ve
> 
> Basically, a couple of "subcommands", one of which has 2 prerequisites
> that are run if needed. Little more in practice than 2 shell scripts
> with a bit of "if this is already done, skip" logic.
> 
> Most makefiles I encounter or write are of this form, and make
> essentially no use of dependency rules or anything more complex than
> "does the target already exist" checks. Make would be fine for this
> except for the annoying "must use tabs" rule, and the need to rely on
> shell (= non-portable, generally unavailable on Windows) constructs
> for any non-trivial logic.
> 
> In the days when make was invented, not compiling a source file whose
> object file was up to date was a worthwhile time saving. Now I'm more
> likely to just do "cc -c *.c" and not worry about it.

OK, I see what you're doing, and you're right, Ninja could be forced to do what you want, but it isn't the tool that you need.  

Thanks,
Cem Karan


More information about the Python-list mailing list