https://pantsbuild.org/ logo
#development
Title
# development
s

sparse-lifeguard-95737

11/07/2022, 8:59 PM
@enough-analyst-54434 I’ve stumbled across an old TODO with your name on it - wondering if I can wipe it out 🧵
it looks like the linked issue was fixed in astroid 2.9.1
but I’m not sure how far back in the pylint version history we want to support - any thoughts?
b

bitter-ability-32190

11/07/2022, 9:00 PM
In other rules, we change behavior based on tool version. Can you do that here?
s

sparse-lifeguard-95737

11/07/2022, 9:00 PM
🧠
is it possible to get the version of an arbitrary third-party dependency (vs. the top-level tool where we have a dedicated config for the version)? so we could check against astroid directly?
e

enough-analyst-54434

11/07/2022, 9:02 PM
Not really without importing it.
b

bitter-ability-32190

11/07/2022, 9:02 PM
Anything is possible 😛 The question is how much pain you wanna feel
hurtrealbad 1
e

enough-analyst-54434

11/07/2022, 9:02 PM
You'd need a process that used importlib
b

bitter-ability-32190

11/07/2022, 9:04 PM
Presumably the middle-ground is looking for pylint version that contains asteroid version with the fix. If people are bumping asteroid later in an earlier Pylint they'll just get a slower run than if not?
Yeah, you could also dig into PEX metadata. 18 ways here.
s

sparse-lifeguard-95737

11/07/2022, 9:05 PM
if we took the middle ground, looks like pylint 2.13.0 is the cutoff
b

bitter-ability-32190

11/07/2022, 9:05 PM
FWIW
importlib.metadata
is Python 3.8, but Pants currently runs on 3.7. Thats why I can't use it directly in
debugadapter
code. You have to ask for a PEX containing the backport 😭
Yeah, you could also dog into PEX metadata. 18 ways here.
Thatd be my suggestion of the "right" way
I'd honestly +1 either solution. Try the "correct" way by asking/inspecting PEX and if that gets too hard, do the middle-ground with a comment?
s

sparse-lifeguard-95737

11/07/2022, 10:07 PM
https://github.com/pantsbuild/pants/pull/17488 I think I figured out how to make it work the “right” way 🤔