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
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:
class myclass:
...
packageB/bar.py
from packageA.foo import myclass
packageC/moo.py
from packageB.bar import myclass
Regardless of whether this is good practice or not (obviously not), when running uv run pyright at the workspace root, we get no errors. But if we run uv run pyright packageC, we get the reportPrivateImportUsage error for myclass. 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!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
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!Beta Was this translation helpful? Give feedback.
All reactions