Skip to content

py.typed missing from pypi-published bazel-runfiles wheel causes mypy to fail to import #2503

Open
@aaronsky

Description

@aaronsky

🐞 bug report

Affected Rule

I'm filing this issue with regards to the bazel-runfiles package published to PyPI.

Is this a regression?

unknown

Description

I can see in the wheel that there is no py.typed marker file, even though this file is provided as data to the py_library here. This omission causes Mypy to fail to import the package's type hints, and produces an error when running Mypy without rules_mypy (such as in my IDE). My understanding of how Mypy works, based on the information here and the fact that bazel-runfiles is not a stubs package, is that this py.typed file is required in order for Mypy to work.

Is this working as designed?

🔬 Minimal Reproduction

Download the wheel from here and observe the absent py.typed file.

🔥 Exception or Error




ci/bazel/testing/unit/collect_test_results.py:8: error: Skipping analyzing "runfiles": module is installed, but missing library stubs or py.typed marker  [import-untyped]
ci/bazel/testing/unit/collect_test_results.py:8: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

🌍 Your Environment

Operating System:

  
macOS 15.2
  

Output of bazel version:

  
Bazelisk version: 1.25.0
INFO: Invocation ID: 6cddecd0-8331-45bd-9d3b-1db39b6d2abb
Build label: 7.4.1
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Mon Nov 11 21:27:36 2024 (1731360456)
Build timestamp: 1731360456
Build timestamp as int: 1731360456
  

Rules_python version:

  
1.0.0
  

Anything else relevant?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions