Hey y’all just wanted to do a sanity check, I’m fi...
# general
w
Hey y’all just wanted to do a sanity check, I’m finishing my migration to pants v2 so there’s a couple of reorganizing that I’m doing.. 1. For the dependency inference part, it’ll automatically “know” the transitive dependencies? I don’t have to explicitly define any internal dependency anymore? So far the
package
and
run
are working fine so I’m assuming and hoping that I still get that sweet
--changed-dependees=transitive
out of the box too… 2. This one I’m not sure if I’m tripping or not but I have an internal ML lib with classifiers, featurizers and all that weird cool stuff. But some of them have huge dependencies such as Tensorflow others dont.. so I was wondering: • Should I move the internal modules/packages into their own “library” such as:
Copy code
# current one
libraries/
  ml_stuff/
    __init__
    BUILD
    preprocessing/
      __init__
      BUILD
    classifiers/
    ...

# new one
libraries/
  ml_stuff_preprocessing/
  ml_stuff_classifiers/
• Or…
pants
can get those specific inside packages in case I only need..
ml_stuff.preprocessing
? And if that requires Tensorflow it would get it, otherwise it wouldnt (?)
w
dependencies are inferred at the file level, and so if it’s inferred, it should only be inferred for the files that need it
if you manually add the Huge Dep to the
dependencies
list of a target in a
BUILD
file, then you’re saying: “trust me, all of the files in this target need this dep”
w
which is what I had for v1, but now I’m using
BUILD
files everywhere with a simple
python_library()
inside and I noticed that the behavior changed
w
so: re 1.: to confirm that individual files (or targets) have the dependencies you’d expect, you can use
./pants dependencies --transitive $file
or
./pants dependencies --transitive $target
💯 1
and re 2.: the dependencies that are added by inference are “file level” dependencies. so the default is to depend on one file at a time… which is “less than” an entire target. that means you don’t need to define smaller targets unless you need to manually add a dep that you don’t want to apply to quite as many files
@wooden-thailand-8386: does that make sense?
💯 1
w
Yup, thanks for the double check. I sort of had a feeling that that’s what was happening but now I understand why. 🙂
👖 1