Stubtest settings: change ignore_missing_stub default to false (#9779)

If you're reading about this commit from an autogenerated changelog entry, this should have no user-visible impact on how the stubs are interpreted by a type checker; it's just an internal change to how typeshed's tests work.
This commit is contained in:
Avasam
2023-02-20 17:37:45 -05:00
committed by GitHub
parent 3786ab295e
commit ed6748fb32
149 changed files with 155 additions and 283 deletions

View File

@@ -170,16 +170,13 @@ By default, stubtest emits an error if a public object is present at runtime
but missing from the stub. However, this behaviour can be disabled using the
`--ignore-missing-stub` option.
Many third-party stubs packages in typeshed are currently incomplete, and so by
default, `stubtest_third_party.py` runs stubtest with the
`--ignore-missing-stub` option to test our third-party stubs. However, this
option is not used if the distribution has `ignore_missing_stub = false` in the
`tool.stubtest` section of its `tests/METADATA.toml` file. This setting
indicates that the package is considered "complete", for example:
https://github.com/python/typeshed/blob/6950c3237065e6e2a9b64810765fec716252d52a/stubs/emoji/METADATA.toml#L3-L4
If a distribution has `ignore_missing_stub = true` in the `[tool.stubtest]` section of its
`tests/METADATA.toml` file, `stubtest_third_party.py` will test that distribution with the
`--ignore-missing-stub option`. This indicates that the stubs for this distribution are
considered "incomplete".
You can help make typeshed's stubs more complete by adding
`ignore_missing_stub = false` to the `tests/METADATA.toml` file for a
You can help make typeshed's stubs more complete by removing
`ignore_missing_stub = true` from the `tests/METADATA.toml` file for a
third-party stubs distribution, running stubtest, and then adding things that
stubtest reports to be missing to the stub. However, note that not *everything*
that stubtest reports to be missing should necessarily be added to the stub.

View File

@@ -67,7 +67,7 @@ def read_stubtest_settings(distribution: str) -> StubtestSettings:
brew_dependencies = data.get("brew_dependencies", [])
choco_dependencies = data.get("choco_dependencies", [])
extras = data.get("extras", [])
ignore_missing_stub = data.get("ignore_missing_stub", True)
ignore_missing_stub = data.get("ignore_missing_stub", False)
specified_platforms = data.get("platforms", ["linux"])
assert type(skipped) is bool