dry-zebra-75841
03/31/2025, 6:15 AMsrc/**/*.pyfast-xylophone-56613
03/31/2025, 12:43 PMpython_sources(sources=['***/**.py]) it will force all the python files to be bundled together. However, you must remove python_sources() from any BUILD files in subdirectories because pants won't allow any overlap.dry-zebra-75841
03/31/2025, 12:47 PMpython_sources(sources=['***/**.py]) and then no other BUILD files underneath. And this solves the "two parents for a target" issue?dry-zebra-75841
03/31/2025, 12:47 PMfast-xylophone-56613
03/31/2025, 12:49 PMdry-zebra-75841
03/31/2025, 12:50 PMfast-xylophone-56613
03/31/2025, 12:51 PMdry-zebra-75841
03/31/2025, 12:52 PMdry-zebra-75841
03/31/2025, 12:53 PMbut Pants cannot safely infer a dependency because more than one target owns this module, so it is ambiguous which to use:fast-xylophone-56613
03/31/2025, 12:53 PMelegant-florist-94385
03/31/2025, 12:53 PMpython_source(s) that reference that particular filefast-xylophone-56613
03/31/2025, 12:53 PMdry-zebra-75841
03/31/2025, 12:57 PMpython_source() BUILD files in a number of directories, and then one in a parent directory with that glob. Im getting the feeling I should just remove all the lower level ones and rely on the top level? Is that a bad idea? or totally fine? Particularly in a codebase that is basically all or nothing.elegant-florist-94385
03/31/2025, 12:59 PMparametrize, but that's another discussion)elegant-florist-94385
03/31/2025, 1:01 PMpython_sources is okay. but a couple downsides to be aware of.
1. If you need a smaller glob of files from a subdirectory, you can't have it. (This would involve duplicated targets, so it may be better to have src/app/A, and src/app/B each with a glob and then whatever needs global can just depend on both of them).
2. You CAN use overrides in your python_sources to customize particular fields on a particular file (and this can be used on globs too).
a. The downside is that these customizations live in the top level build file, and not near the particular file being customized