I think I'm building up a list of plugins I'll nee...
# plugins
i
I think I'm building up a list of plugins I'll need to exist over time, but I want to do a simplish thing to get started. I'm thinking that the plugins should live in a directory in my monorepo, but I'm concerned about the python versioning and how my IDE (pycharm) would act. My overall codebase is on python 3.10, but it seems efforts to update pants to running on 3.10 are paused right now? How much of a concern is that for me?
e
Since your codebase is newer than the plugin codebase, your only concern is "are there stdlib that have been yanked since 3.7 that I want to use in my plugin" since plugin code generally needs to be 3.7 compat. Other than that - which is unlikely, FWICT Python syntax is never yanked.
i
yeah, worst case I see is that newer syntaxes can't be used. With some specialized linting rules for those packages it could be a fine thing.
e
You don't actually need specialized rules with Pants. If the targets owning the in-repo pants plugin code are given
>=3.7,<3.10
interpreter constraints, Pants will partition those targets into their own runs of tools that are sentive to the Python version.
That's all automatic once you label a target (or a resolve) with a specific set of ICs.
w
https://www.pantsbuild.org/docs/plugins-overview#building-in-repo-plugins-with-pants talks about this a bit: generally you’ll want to put your plugins in a separate resolve, so they are isolated from the rest of your code.
e
Your, IDE on the other hand, is probably not quite so smart. I know idea can't handle this anyway. It assumes one venv / interpreter.
i
yeah, the single interpreter limitation is pretty annoying 😕