Skip to content

Metadata to aid static analysis #2537

@rickeylev

Description

@rickeylev

Static analysis tools need additional information to help understand Python targets correctly. The use case of particular note are type checkers.

See discussion #2455_

At a minimum, these tools need the original source files. For type checkers, pyi files are also needed. Similarly, things like proto (or other code gen) would also benefit from a way to provide pyi files.

  • Add PyInfo fields: {direct, transitive} x {original_sources, pyi_files}
  • Add py_library.{pyi_{srcs, deps}
  • Update py_library et al to populate, merge, propagate this information
  • Update pypi generation code to set attributes appropriately.

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