Hey <@U02TSJJT9DJ>, thanks for the progress on `py...
# general
l
Hey @wide-midnight-78598, thanks for the progress on
pyright
! I'm coming with an additional request 😉 I've tried pinning `pyright`'s version as follows in `pants.toml`:
Copy code
[pyright]
version = "pyright==1.1.258"
lockfile = "pants_dir/3rdparty/pyright_lockfile.lock"
But this isn't recognized:
Copy code
→ PANTS_SHA=11b4fd412631c6315b474e49fe482dec1767cf29 ./pants check libs/geometry::
...
10:00:25.71 [ERROR] Invalid option 'lockfile' under [pyright] in /home/churlin/dev/kaiko-eng/pants.toml
10:00:25.71 [ERROR] Invalid option 'version' under [pyright] in /home/churlin/dev/kaiko-eng/pants.toml
10:00:25.71 [ERROR] Invalid config entries detected. See log for details on which entries to update or remove.
Am I doing something wrong or is the locking support missing? I need it because right now
pants
pulls a different version of
pyright
than my regular CI and I get discrepancies 😕 I can create an issue if that would help you, let me know.
w
Since it's a NodeJS backend, it operates a little differently - but this is something to note: Can you try "pyright@1.1.258"?
Oh wait a sec, version doens't work? There is no lockfile support yet, as, again, it's a NodeJS backend running in the python side (which is weird). Might need to shim the versions or something
Doh - yeah,
Subsystem
does not specify a version. In most Python tools, that comes with
PythonToolRequirementsBase
I think we'll need a
NodeToolBase
, to match
PythonToolBase
Kinda makes me wish we had a more composable infra, in lieu of subclassing as much
A quick patch is this in the
pyright
subsystem, I think
Copy code
version = StrOption(
        advanced=True,
        default=lambda cls: cls.default_version,
        help="Requirement string for the tool.",
    )
and then setting:
default_version
to
version
Copy code
process = await Get(
        Process,
        NpxProcess(
            npm_package=pyright.default_version,
However, a more "correct" solution would be to apply some default Npx/Npm base subsystem which has some standard defaults setup, or maybe even a mixin.
l
I see, thanks for the explanations 👍 I'll fill an issue as this will be blocking us 😞
w
🫳 🎤
Copy code
PANTS_SHA=800d4bc94b38f6cea3b30b247c1d90186af8b426 ./pants --pyright-version=pyright@1.1.257 help-advanced pyright

`pyright` subsystem advanced options
------------------------------------
 
  --pyright-version=<str>
  PANTS_PYRIGHT_VERSION
  version
      default: pyright@1.1.274
      current value: pyright@1.1.257 (from command-line flag)
          overrode: pyright@1.1.258 (from pants.toml)
      Version string for the tool in the form package@version (e.g. prettier@2.6.2)
❤️ 1