-
-
Notifications
You must be signed in to change notification settings - Fork 53
Description
What happened?
I made a minimum repro in a git repository to illustrate the issue:
Steps to reproduce:
git clone https://github.com/qdii/aspect_py_grpc.git
cd aspect_py_grpc
bazel run //mm:user_factory.venv
pyright --verbose
What is happening:
The line: Could not import 'mm.user_pb2' in file '/home/qdii/dev/aspect_py_grpc/mm/user_factory.py'
appears.
What should have happened:
The user_pb2.py file should have been found.
Version
Development (host) and target OS/architectures: Arch Linux / x64
Output of bazel --version
: 8.4.1
Version of the Aspect rules, or other relevant rules from your
WORKSPACE
or MODULE.bazel
file: 1.6.3
Language(s) and/or frameworks involved: Python 3.12
How to reproduce
Any other information?
pyright
uses pyproject.toml
to determine which venv
to use.
In the repository's pyproject.toml
, venv
points to the virtual environment generated by aspect's rules_py.
pyright should be able to find the python file produced by the compilation of the proto file, but does not.