I am working on a custom plugin. How do I go about...
# plugins
f
I am working on a custom plugin. How do I go about getting a collection of
SpecsPaths
from a string representing a glob, e.g.
foo/bar/*.py
?
1
The help page mentions
SpecsPaths
for this, which is exactly what I need; however, I'd like to either raise an exception or log an error if a glob doesn't expand to any source file. I have a custom
Target
with a custom field containing a list of globs, so I don't think I can take advantage of the unmatched_build_file_globs global option? 😕 I can solve this by doing
glob.glob
in plain Python (to expand a glob pattern and see if any files are found) and I could even do that with
async def
/
await
so that Python doesn't wait on a massive glob like
***/**
and can continue with the rest of the globs in the loop. However, it may make more sense to do with Pants engine instead?