How do I change the setup so pants can only recogn...
# general
m
How do I change the setup so pants can only recognize tests if
test_*.py
? I don't want
*_test.py
๐Ÿ˜—
c
There is no configuration knob for changing the default, so youโ€™d either have to use a macro/custom target, or override it everywhere, I think.
You can exclude certain files, though.. using a
"!file_test.py"
syntax..
(the double exclam syntax is for something else, I donโ€™t recall at the moment..)
m
So nothing available for global level?
c
Nope, but this has come up before, perhaps you have a compelling use case for a feature request for a global option to support tweaking the default source globs for targets.
m
yeah, not having tailor add the
python_tests()
on those
would you say that is compelling enough? ๐Ÿค”
๐Ÿคฃ 1
๐Ÿ‘ˆ 1
๐Ÿ‘€ 1
c
Interesting thing is that a macro wouldnโ€™t help for that.. so yeah.. could be (looking into tailor a bit..) ๐Ÿ™‚ ๐Ÿ˜„
There is options for tailor to ignore paths and/or targets. https://www.pantsbuild.org/v2.9/docs/reference-tailor#section-ignore-paths Perhaps it would be enough to run tailor with an ignore for
*_test.py
files?
๐Ÿ‘ 1
m
let me test
it works to avoid the python_tests()... but it will not add the pex_binary if I have a
if ___name___...
but works for me
๐Ÿ‘ 1
c
OK ๐Ÿ™‚
m
thanks ๐Ÿ‘