https://pantsbuild.org/ logo
#general
Title
# general
f

fresh-cat-90827

10/03/2022, 11:58 AM
is there a more succinct way to glob all files that are not Python modules than getting all files first and then negating
Copy code
resources(
    name="testdata",
    sources=["tests/testdata/**/*", "!tests/testdata/**/*.py"],
)
?
1
c

curved-television-6568

10/03/2022, 12:18 PM
The negation is applied in the same intrinsic operation that is collecting all files from your
**/*
pattern, so I think this is rather succinct already.
h

hundreds-father-404

10/03/2022, 3:32 PM
Yeah, this is the most succinct it can be
f

fresh-cat-90827

10/03/2022, 3:58 PM
gotcha, thanks folks! I was curious if I missed some fancy syntax closer to the regex e.g.
"tests/testdata/**/*.(!py)"
, but thanks for confirming that’s the way to go! Merging my PRs now then 😛
👍 2