Skip to content

[Bug]: grpc artifacts cannot be imported #651

@qdii

Description

@qdii

What happened?

I made a minimum repro in a git repository to illustrate the issue:

Steps to reproduce:

  1. git clone https://github.com/qdii/aspect_py_grpc.git
  2. cd aspect_py_grpc
  3. bazel run //mm:user_factory.venv
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions