镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

pip.parse fails for source-less wheels with dependencies #4053

Closed

Description

@hartikainen

(I diagnosed this with heavy help from Opus.)

🐞 bug report

Affected Rule

pip.parse.

Is this a regression?

Yes, I believe 2.2.0 works, while 2.3.1 fails.

Description

I expected py-spy==0.4.1 to work as a py_library dependency, but observed that whl_library_targets points the wrapper's srcs at an empty source target. Bazel then rejects the wrapper during analysis.

🔬 Minimal Reproduction

See examples/py-spy.

From that directory, run:

bazel test //:py_spy_test

🔥 Exception or Error

... //:srcs does not produce any py_library srcs files (expected .py or .py3)

🌍 Your Environment

Operating System:

macOS 26.5.2 arm64

Output of bazel version:

Build label: 9.2.0

Rules_python version:

2.3.1

Anything else relevant?

The workaround is to stay on 2.2.0. I have a small fix and unit tests on the separate py-spy-fix branch.

Activity

  1. honnix commented on Aug 18, 2026

    @honnix

    We hit a similar regression with stub-only packages (e.g. types-requests, types-protobuf) on 2.3.1. These packages contain only .pyi files and no .py files. The whl_library_targets macro separates .pyi files into pyi_srcs, leaving the py_library's srcs attribute empty, which Bazel rejects with:

    'srcs' does not produce any py_library srcs files (expected .py or .py3)

    Same error as the py-spy case but different trigger — binary wheels with compiled extensions vs pure-stub type packages with only .pyi files.

  2. added a commit that references this issue on Aug 22, 2026
    4f4eafd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions