Skip to content

.pyi from third party stubs packages should take precedence over bundled .pyi files #95

@jorenham

Description

@jorenham

This docstring suggests that currently bundled .pyi are prioritized over those from third party stubs packages:

def merge_files_with_stubs(package_files: list[str], typeshed_stubs: list[str]) -> list[str]:
"""Merge package files with typeshed stubs, preferring .pyi files from the package itself."""

But this is at odds with the typing spec: https://typing.python.org/en/latest/spec/distributing.html#import-resolution-ordering

This can affect the coverage of e.g. scipy, which bundles a couple of incomplete .pyi that in scipy-stubs are actually complete.

A more extreme example would be numtype, which intends to override all of numpy's bundled stubs with its own numpy-stubs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions