Skip to content

[Bug]: pyi_deps, pyi_srcs not supported by py_library #1514

Description

@addisonjones3

What happened?

When running Gazelle on a Python target that contains

from typing import TYPE_CHECKING
if TYPE_CHECKING:
    from lib.my_module import AnExampleClass

Gazelle will attempt to create a pyi_deps item of "//lib:my_module". pyi_deps is not supported in the rules_py py_library API at this time and will create a build failure.

Minimal example for repro:

https://github.com/addisonjones3/rules_py_pyi_repro

main branch fails on bazel build //...
pre-gazelle is the state prior to bazel run //:gazelle_python

Version

Development (host) and target OS/architectures: Linux amd64

Output of bazel --version: 7.7.1

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:

bazel_dep(name = "aspect_gazelle_prebuilt", version = "0.0.24")
bazel_dep(name = "aspect_rules_py", version = "1.8.4")

Language(s) and/or frameworks involved:

How to reproduce

Clone repro repo

To verify failure:

bazel build //...

To show Gazelle is automatically creating those deps when run:
Switch to pre-gazelle branch

bazel run //:gazelle_python & \
bazel build //...

Any other information?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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