Skip to content

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

Open

Description

@smarie

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions