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

ambitious-actor-36781

12/02/2021, 9:14 PM
are the default source patterns extensible globally? I want to make
factories.py
globally a
python_test_util
and not a
python_source
maybe something like
Copy code
[default-sources]
python_sources += ['!factories.py']
python_test_utils += ['factories.py']
and if not, is this easily done via a plugin?
w

witty-crayon-22786

12/02/2021, 9:16 PM
the downside is that rather than
python_test_util
you’d need to use the macro, since we don’t support shadowing existing symbols (afaik)
a

ambitious-actor-36781

12/02/2021, 9:20 PM
yeah, considered that, and will probably go that way but... • I've already once gone and retrospectively macroed a load of things, and that was !fun. • You can't access the defaults in a macro • my macros are already a mess. • I kinda don't like writing macros because they're unlintable, and the limitations on what you can/can't do in them is 😬
macros very quickly became "oh I'll just do that in a macro" to "oh why did I do that in a macro"
w

witty-crayon-22786

12/02/2021, 9:32 PM
yea, all very good points.
this probably relates to https://github.com/pantsbuild/pants/issues/13767 then. Although in many cases we do have capital-O Options for things like this, the ability to adjust defaults in a minimally boilerplatey but still obvious way is an open question
4 Views