Skip to content

typeshed and third-party packages #4967

@srittau

Description

@srittau

Quick background: typeshed is a collection of PEP 484 type hint files for Python's standard library as well as third-party libraries that don't ship their own type hints. Currently, type checkers such as mypy and pytype as well as IDEs such as PyCharm ship a complete copy of typeshed. Of course, this does not scale well and is fairly inflexible.

Therefore, we are currently discussing (in python/typeshed#2491) to take a similar route to typescript's DefinitelyTyped project: typeshed aims to become a central repository for high-quality type stubs for projects that don't ship their own. third-party stubs are automatically built and uploaded to pypi - one PEP 561 stubs-only package per upstream package - when they change in the repository.

It is of course highly desirable for those stubs to follow a consistent naming scheme. In typescript, for a packages foo, you know you can just install the package @types/foo to get appropriate high-quality hints from DefinitelyTyped. Our currently plan is to use foo-ts as a package name for an upstream package called foo, but we are absolutely not married to that scheme.

One issue we are worried about is possible name squatting. Since the whole point is that package names are predictable, it is very easy to squat the names of successful packages that don't have type hints, yet. This could potentially be harmful if potentially dangerous code is uploaded under a squatted, since I expect people to blindly install foo-ts in the future if typeshed becomes successful. (I know I do with DefinitelyTyped packages.)

We appreciate all feedback and input on this, either here or in python/typeshed#2491. If another venue is a better place to raise this issue, please let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs discussiona product management/policy issue maintainers and users should discusssquattingIssues related to preventing any kinds of namesquatting, typosquatting, dependency confusion

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions