is there a way to turn off the python-dependency-d...
# general
is there a way to turn off the python-dependency-discovery? It just doesn't feel like it works that great. I'm adding
to my dependencies more often than not. at the point I want to just make it explicit.
How come you're having to add? Is xyz imported? If so, you may have to update the module mapping for third-party requirements
haven't been able to get the google-cloud packages to work. (e.g. google-cloud-kms provides
) One package (graphtik) is slightly broken and has an unspecified dependency on pandas, but if I add
pandas: [graphtik]
to my
I then get errors about ambiguous dependencies. and another package (spacy) also depends on the dataset library. small things, and ultimately not really a Pants issue.
What pants version are you on? There's a workaround for the unspecified dependencies issue, altho a little clunky atm. 2.8 adds a general "overrides mechanism" to allow macros / target generators to override metadata for a specific target. If you're able to use Pants 2.8, I can add that feature to python_requirements() macro so that this problem is fixed in a easy, declarative way For Google cloud mapping, definitely we want to fix that! Would you be willing to open a ticket please with more info?
Thanks! While it's valid to not use dep inference, we strongly encourage using it. Not only does it greatly reduce maintenance burden, but also usually results in much more precise dependencies. No risk that when you delete an import you forget to update the BUILD file, for example And the dependencies are between individual files (what 2.8+ calls
targets). Whereas when maintaining a BUILD file by hand it would be too much boilerplate to specify dependencies at a file level, so dependencies are usually between
targets (formerly
), which are much coarser. For both Pants and Toolchain repos, dependencies became 30% more precise after adopting dependency inference -- But, it's key dependency inference works well. So we're highly motivated to solve the problems you mentioned. Thank you for flagging them!
As promised @ambitious-actor-36781 🙂 cc @narrow-activity-17405, you've mentioned this would help you in the past. I will cherry-pick into 2.8's release candidate
👍 1
oh neat.
❤️ 1
Glad that'll work for you! As alluded to in PR description, this
mechanism is a flagship feature of Pants 2.8 in general. Allows you to do things like
Copy code
     "": {"timeout": 120},
     "": {"timeout": 200},
Upcoming blog and docs changes will share more about that
I was going to ask "How do I treat this one file as a special snowflake?" and now that's answered too.
💯 1