diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 981bdbb81..af0bbde57 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,7 +54,12 @@ Modules that are only available for Python 2 are not listed in `VERSIONS`. ### Third-party library stubs -Modules that are not shipped with Python but have a type description in Python +We accept stubs for third-party packages into typeshed as long as: +* the package is publicly available on the [Python Package Index](https://pypi.org/); +* the package supports any Python version supported by typeshed; and +* the package does not ship with its own stubs or type annotations. + +Stubs for third-party packages go into `stubs`. Each subdirectory there represents a PyPI distribution, and contains the following: * `METADATA.toml`, describing the package. See below for details. @@ -66,7 +71,12 @@ contains the following: and also with Python 2 if `python2 = true` is set in `METADATA.toml` (see below). * (Rarely) some docs specific to a given type stub package in `README` file. -When a third party stub is +The fastest way to generate new stubs is to use [stubgen](https://mypy.readthedocs.io/en/stable/stubgen.html), +a tool shipped with mypy. Please make sure to use the latest version. +The generated stubs usually need some trimming of imports. You also need +to run `black` and `isort` manually on the generated stubs (see below). + +When a third party stub is added or modified, an updated version of the corresponding distribution will be automatically uploaded to PyPI within a few hours. Each time this happens the least significant