@@ -147,106 +147,10 @@ stubbing.
147147
148148#### The ` METADATA.toml ` file
149149
150- The metadata file describes the stubs package using the
151- [ TOML file format] ( https://toml.io/en/ ) . Currently, the following keys are
152- supported:
153-
154- * ` version ` : The versions of the library that the stubs support. Two
155- formats are supported:
156- - A concrete version. This is especially suited for libraries that
157- use [ Calendar Versioning] ( https://calver.org/ ) .
158- - A version range ending in ` .* ` . This is suited for libraries that
159- reflect API changes in the version number only, where the API-independent
160- part is represented by the asterisk. In the case
161- of [ Semantic Versioning] ( https://semver.org/ ) , this version could look
162- like this: ` 2.7.* ` .
163- When the stubs are updated to a newer version
164- of the library, the version of the stub should be bumped (note that
165- previous versions are still available on PyPI).
166- * ` dependencies ` (optional): A list of other stub packages or packages with type
167- information that are imported by the stubs in this package. Only packages
168- generated by typeshed or required by the upstream package are allowed to
169- be listed here, for security reasons. See
170- [ this issue] ( https://github.com/typeshed-internal/stub_uploader/issues/90 )
171- for more information about what external dependencies are allowed.
172- * ` optional-dependencies ` (optional): A list of other stub packages or packages
173- with type information that are imported by some stubs in this package. This
174- is often used for packages that provide optional features that require extra
175- dependencies. The same limitations apply to this field as to ` dependencies ` .
176- * ` extra-description ` (optional): Can be used to add a custom description to
177- the package's long description. It should be a multi-line string in
178- Markdown format.
179- * ` stub-distribution ` (optional): Distribution name to be uploaded to PyPI.
180- This defaults to ` types-<distribution> ` and should only be set in special
181- cases.
182- * ` upstream-repository ` (recommended): The URL of the upstream repository.
183- * ` obsolete-since ` (optional): This table is part of our process for
184- [ removing obsolete third-party libraries] ( #third-party-library-removal-policy ) .
185- It contains the first version of the corresponding library that ships
186- its own ` py.typed ` file, and the date when that version was released.
187- * ` no-longer-updated ` (optional): This field is set to ` true ` before removing
188- stubs for other reasons than the upstream library shipping with type
189- information.
190- * ` upload ` (optional): This field is set to ` false ` to prevent automatic
191- uploads to PyPI. This should only be used in special cases, e.g. when the stubs
192- break the upload.
193- * ` partial-stub ` (optional): This field marks the type stub package as
194- [ partial] ( https://typing.python.org/en/latest/spec/distributing.html#partial-stub-packages ) .
195- This is for 3rd-party stubs that don't cover the entirety of the package's public API.
196- * ` requires-python ` (optional): The minimum version of Python required to install
197- the type stub package. It must be in the form ` >=3.* ` . If omitted, the oldest
198- Python version supported by typeshed is used.
199-
200- In addition, we specify configuration for stubtest in the ` tool.stubtest ` table.
201- This has the following keys:
202- * ` skip ` (default: ` false ` ): Whether stubtest should be run against this
203- package. Please avoid setting this to ` true ` , and add a comment if you have
204- to.
205- * ` ignore-missing-stub ` (default: ` false ` ): When set to ` true ` , this will add
206- the ` --ignore-missing-stub ` option to the stubtest call. See
207- [ tests/README.md] ( ./tests/README.md ) for more information. In most cases,
208- this field should be identical to ` partial-stub ` .
209- * ` stubtest-dependencies ` (default: ` [] ` ): A list of Python packages that need
210- to be installed for stubtest to run successfully. These packages are installed
211- in addition to the dependencies in the ` dependencies ` and
212- ` optional-dependencies ` fields.
213- * ` apt-dependencies ` (default: ` [] ` ): A list of Ubuntu APT packages
214- that need to be installed for stubtest to run successfully.
215- * ` brew-dependencies ` (default: ` [] ` ): A list of MacOS Homebrew packages
216- that need to be installed for stubtest to run successfully
217- * ` choco-dependencies ` (default: ` [] ` ): A list of Windows Chocolatey packages
218- that need to be installed for stubtest to run successfully
219- * ` extras ` (default: ` [] ` ): A list of optional dependency groups
220- ([ extras] ( https://packaging.python.org/en/latest/specifications/core-metadata/#provides-extra-multiple-use ) )
221- that need to be installed for stubtest to run successfully.
222- For example, ` extras = ["foo"] ` installs the package as ` <package>[foo] ` .
223- * ` supported-platforms ` (default: all platforms): A list of OSes on which
224- stubtest can be run. When a package is not platform-specific, this should
225- not be set. If the package is platform-specific, this should usually be set
226- to the supported platforms, unless stubtest is known to fail on a
227- specific platform.
228- * ` ci-platforms ` (default: ` ["linux"] ` ): A list of OSes on which to run
229- stubtest as part of our continuous integration (CI) tests. Can contain
230- ` win32 ` , ` linux ` , and ` darwin ` values. If not specified, stubtest is run
231- only on ` linux ` . Only add extra OSes to the test if there are
232- platform-specific branches in a stubs package.
233- * ` mypy-plugins ` (default: ` [] ` ): A list of Python modules to use as mypy plugins
234- when running stubtest. For example: ` mypy-plugins = ["mypy_django_plugin.main"] `
235- * ` mypy-plugins-config ` (default: ` {} ` ): A dictionary mapping plugin names to their
236- configuration dictionaries for use by mypy plugins. For example:
237- ` mypy-plugins-config = {"django-stubs" = {"django_settings_module" = "@tests.django_settings"}} `
238- * ` install-environment ` (default: ` {} ` ): A dictionary of environment variables
239- to set while ` pip install ` ing the package and its dependencies for stubtest.
240- Useful for packages that read build-time options from the environment, for
241- example to disable CPU-specific compiler flags that do not survive CI's
242- shared wheel cache. For example:
243- ` install-environment = { HNSWLIB_NO_NATIVE = "1" } `
244-
245- ` *-dependencies ` are usually packages needed to ` pip install ` the implementation
246- distribution.
247-
248- The format of all ` METADATA.toml ` files can be checked by running
249- ` python3 ./tests/check_typeshed_structure.py ` .
150+ Each third-party stub package must have a metadata file to describe the
151+ package. For example, the metadata for a package ` parrot ` lives in
152+ ` stubs/parrot/METADATA.toml ` . See
153+ [ docs/metadata-files.md] ( ./docs/metadata-files.md ) for a full description.
250154
251155### Dependencies
252156
@@ -476,7 +380,8 @@ to your PR to fix any minor issues, but this is not always possible.
476380If a PR lingers with unresolved problems for too long , we may close it
477381([see below](# closing-stale-prs)).
478382
479- Also, do not squash your commits or use `git commit -- amend` after you have submitted a pull request, as this
383+ Also, do not squash your commits, force push, or use `git commit -- amend` after
384+ you have submitted a pull request, as this
480385erases context during review. We will squash commits when the pull request is merged.
481386This way, your pull request will appear as a single commit in our git history, even
482387if it consisted of several smaller commits.
0 commit comments