Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Extend the glob tooling to create glob-based rules, similar to "file pattern rules" in make #9

Open
smarie opened this issue Sep 7, 2020 · 0 comments
Labels

Comments

@smarie
Copy link
Owner

smarie commented Sep 7, 2020

In GNU make there is a powerful concept that many users love for its compacity and expressiveness: so-called "pattern rules". The concept is extremely simple:

  • you define a recipe for each file matching a certain pattern,
  • that recipe typically leads to creating one or more files. The names of these files are created based on the name of the original file

For example:

%.tab.c %.tab.h: %.y
        bison -d $<

tells make that the recipe bison -d foo.y will make both foo.tab.c and foo.tab.h.

Currently in the python stdlib there is a solid foundation for the "search" part of this: glob. However it remains a bit cumbersome to define glob-generated lists of (source file/folder, destination file(s)/folder(s)). fprules is an attempt to provide such functionality.

As opposed to make where the feature is integrated in the build tool, we could imagine to provide a generic mechanism allowing any build tool to leverage the generated rules. For example doit, nox, etc. fprules follows this principle: it is not tied to a build tool in particular. However it could maybe be improved to become even more expressive (see https://github.com/smarie/python-fprules/issues)

@smarie smarie added the fprules label Sep 7, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant