I'm testing 2.14 and in my repo, I have a plugins ...
# general
r
I'm testing 2.14 and in my repo, I have a plugins for pants. Now, pants tells me it can't infer owners for some imports like pants.engine.fs.Digest and so on. Should I add pantsbuild.pants in my requirements.txt ?
h
Do you have a target like
pants_requirements(name="pants", resolve="pants-plugins")
in your build file under your plugin directory?
r
I don't , just the regular python_requirements
h
Ah, yeah, I think that's one of the early steps of setting up plugins
r
Ah, I thought it wasn't mandatory
I'll give it a try, thanks!
h
definitely not mandatory - only a best practice to treat your plugin code like production quality, that you want to run linters etc on it
r
ok but if I'm not including that, how can I fix the error I got?
h
You'd have to set a whole bunch of
# pants: no-infer-dep
or whatever it is
Or likely change something in
pants.toml
to not warn about it
Since it's a one liner and also lets you set up a venv to have nice editor autocompletion when developing in that directory, I'm a big fan even if you don't use it for linting/tests/etc.
h
[python-infer].unowned_dependency_behavior = 'ignore'
I think
h
I'm a big fan of the unknown dependencies being warnings (with option to elevate to error) in the newest releases. It caught a few places in our repo where folks hadn't declared direct requirements properly and were grabbing things transitively.
💯 1
r
it works with the pants_requirements. I'll keep it 🙂
thanks for the help!
❤️ 1