You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Repo: https://github.com/bugzpodder/example-python
I have a source root in /helloworld/ and a pyproject.toml there. (I also tested without source roots, and pants + pyright worked with no issues)
When I run pyright in /helloworld/ without pants, it works fine (my current workflow)
When I run pants check :: in root dir, it does not work because it can't find pyproject.toml
This is different from pants' ruff integration where it is able to work with the pyproject.toml with no issues.
@bugzpodder ➜ /workspaces/example-python/helloworld (main) $ pyright
0 errors, 0 warnings, 0 informations
@bugzpodder ➜ /workspaces/example-python/helloworld (main) $ cd ..
@bugzpodder ➜ /workspaces/example-python (main) $ pants check
@bugzpodder ➜ /workspaces/example-python (main) $ pants check ::
16:05:24.63 [INFO] Completed: Force venv to materialize
16:05:29.04 [INFO] Completed: Run Pyright on 8 files.
16:05:29.04 [ERROR] Completed: Typecheck using Pyright - pyright - pyright failed (exit code 1).
helloworld/greet/greeting_test.py
helloworld/greet/greeting_test.py:9:26 - error: Argument of type "Literal['test']" cannot be assigned to parameter "name" of type "int" in function "greet"
"Literal['test']" is incompatible with "int" (reportGeneralTypeIssues)
1 error, 0 warnings, 0 informations
✕ pyright failed.
If you check the sandbox, you'll see it added pyrightconfig.json but it did not pick up pyproject.toml in helloworld
Describe the bug
Repo: https://github.com/bugzpodder/example-python
I have a source root in /helloworld/ and a pyproject.toml there. (I also tested without source roots, and pants + pyright worked with no issues)
When I run pyright in /helloworld/ without pants, it works fine (my current workflow)
When I run
pants check ::
in root dir, it does not work because it can't find pyproject.tomlThis is different from pants' ruff integration where it is able to work with the pyproject.toml with no issues.
If you check the sandbox, you'll see it added pyrightconfig.json but it did not pick up pyproject.toml in helloworld
Pants version
2.20
OS
MacOS locally, the repo above is from a VSCode sandbox (linux)
Additional info
for running pyright outside of pants, it only recognizes the pyproject.toml in cwd (the place you run it in).
The text was updated successfully, but these errors were encountered: