If I've got a thing with a deep nesting of package...
# general
a
If I've got a thing with a deep nesting of packages, but everything beyond the 2nd level is just one 'unit', is there a best way of dealing with this? Is it just set the
sources
of the
python_sources
to
***/**.py, !**/test_*.py
?
w
opinions are mixed, but i’ve always recommended target-per-directory, rather than using recursive globs
assuming inference is doing its job, whether those sources files are actually just one ‘unit’ isn’t something that the targets themselves need to declare, because it can be inferred from imports
h
I tend to agree
./pants tailor
will generate all this for you
a
wait, the inference works out dependencies across targets? I thought it was just on 3rdparty deps.
h
Keep in mind that unless you use explicit dependencies, dep inference will infer at the file-level anyway
It does!
Nope, it does it for your internal dependencies, and at the file level
a
oh. well ok.
starting to wonder what
dependencies=[]
is even for 😛
w
mostly for
resources
and sources that are loaded “reflectively”
(…was probably a rhetorical question, heh… but yea, it still has its uses)