Repository navigation
reportPrivateImportUsage when running in subdirectory #11109
Replies: 1 comment
|
The selected files can change whether I reproduced your split with Pyright 1.1.407, three editable If from packageA.foo import myclass as myclassAlternatively, keep the import and add There is a version difference: with 1.1.414, the same fixture reports the implicit export in both runs. The current tracked-file code detects Linux/Windows checks. Codex-assisted answer and reproduction; your exact Pyright version/configuration weren't provided, so this may not cover every cause in your workspace. |
Uh oh!
There was an error while loading. Please reload this page.
We have a repository that uses a uv workspace. The workspace is defined at the root directory of the repository, and we have packages within the workspace in subdirectories.
A developer ran into a weird error where they were getting reportPrivateImportUsage errors when running pyright in a subdirectory (
uv run pyright packageC). However, running pyright at the workspace root (uv run pyright) doesn't produce the error.I'm simplifying to keep things simple, but consider the following 3 modules in 3 different packages:
packageA/foo.py:
packageB/bar.py
packageC/moo.py
Regardless of whether this is good practice or not (obviously not), when running
uv run pyrightat the workspace root, we get no errors. But if we runuv run pyright packageC, we get the reportPrivateImportUsage error formyclass. My devs want to understand why CI didn't catch it (because we run pyright at the workspace root). I still don't totally understand why we get different behaviors depending on whether we specify a subdirectory to pyright. Can I get an explanation? Thank you so much!All reactions