https://pantsbuild.org/ logo
#general
Title
# general
l

lemon-oxygen-72498

10/11/2022, 12:20 PM
I ran pant's
HEAD
at the time I'm writing, as follows:
Copy code
> PANTS_SHA=35ab958651cab95a5342a51247fd41d0e8654439 ./pants --version
with the following diff in my configuration:
Copy code
@@ -6,10 +6,11 @@ backend_packages = [
   "pants.backend.python.lint.black",
   "pants.backend.python.lint.flake8",
   "pants.backend.python.lint.isort",
+  "pants.backend.python.typecheck.pyright",
   "pants.backend.shell.lint.shellcheck",
 ]
 
-use_deprecated_directory_cli_args_semantics = false
+# use_deprecated_directory_cli_args_semantics = false
but the backend is not found 😕
Copy code
> PANTS_SHA=35ab958651cab95a5342a51247fd41d0e8654439 ./pants --version
... warnings about Goal.environment_migrated=True ...
Traceback (most recent call last):
  File "/home/churlin/.cache/pants/setup/bootstrap-Linux-x86_64/2.15.0.dev4+git35ab9586_py39/lib/python3.9/site-packages/pants/init/extension_loader.py", line 143, in load_backend
    module = importlib.import_module(backend_module)
  File "/home/churlin/.pyenv/versions/3.9.13/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pants.backend.python.typecheck.pyright'
14:17:41.73 [ERROR] Failed to load the pants.backend.python.typecheck.pyright.register backend: ModuleNotFoundError("No module named 'pants.backend.python.typecheck.pyright'")
@wide-midnight-78598> any clue as to what I'm doing wrong?
w

wide-midnight-78598

10/11/2022, 12:34 PM
I believe there is an
experimental
missing Let me check my repo
I don't believe you need the javascript one there, as it should be pulled in automatically with the registration - but just in case, I'm showing it commented out
Copy code
backend_packages.add = [
  "pants.backend.python",
"pants.backend.experimental.python.typecheck.pyright",
#  "pants.backend.experimental.javascript",
]
./pants check ::
I believe should be the command
l

lemon-oxygen-72498

10/11/2022, 1:27 PM
Adding
experimental
didn't help 😕
Copy code
> head -n 16 pants.toml 
[GLOBAL]
pants_version = "2.13.0"
backend_packages = [
  "pants.backend.shell",
  "pants.backend.python",
  "pants.backend.python.lint.black",
  "pants.backend.python.lint.flake8",
  "pants.backend.python.lint.isort",
  "pants.backend.experimental.javascript",
  "pants.backend.experimental.python.typecheck.pyright",
  "pants.backend.shell.lint.shellcheck",
]

# use_deprecated_directory_cli_args_semantics = false
> PANTS_SHA=35ab958651cab95a5342a51247fd41d0e8654439 ./pants check ::
...
ModuleNotFoundError: No module named 'pants.backend.experimental.javascript'
15:22:44.48 [ERROR] Failed to load the pants.backend.experimental.javascript.register backend: ModuleNotFoundError("No module named 'pants.backend.experimental.javascript'")
It's failing on the
experimental.javascript
backend here. Do I need something special to turn on
experimental
backends? I see that my local clone is indeed missing your new backend:
Copy code
> ls $HOME/.cache/pants/setup/bootstrap-Linux-x86_64/2.15.0.dev4+git35ab9586_py39/lib/python3.9/site-packages/pants/backend/experimental/python/
__init__.py  lint  packaging  __pycache__  register.py
There is no
typecheck
folder in there 😕
h

hundreds-father-404

10/11/2022, 1:42 PM
oh @wide-midnight-78598 we forgot to add to
/bin/BUILD
for the
plugins
target -- this is such a common gotcha when adding new backends. Sorry I didn't catch that
w

wide-midnight-78598

10/11/2022, 1:51 PM
@lemon-oxygen-72498 Sorry! Turns out there was something missing - I mostly use
pants_from_sources
- so I don't run into some of these errors during dev 🥹 @hundreds-father-404
src/python/pants/bin/BUILD
? Do we need to add all plugins there? I don't recall touching this file before
👀 1
l

lemon-oxygen-72498

10/11/2022, 1:54 PM
@wide-midnight-78598> That's okay 🙂 At the speed your first PR was merged, I'm not too worried the fix will land soon 😄
w

wide-midnight-78598

10/11/2022, 2:02 PM
Well, if it's that file I suggested - turns out a few plugins are missing, so may as well try to correct that 🙂
h

hundreds-father-404

10/11/2022, 3:06 PM
exactly
w

wide-midnight-78598

10/11/2022, 3:52 PM
👍 Will PR