Closed Avasam closed 1 year ago
In that case it would probably make sense to rename ignore_missing_stub
to partial
or partial_stub
and clearly document what it does on the typeshed side. I'm a bit uncomfortable about adding the partial marker just by looking at some field named ignore_missing_stub
.
In that case it would probably make sense to rename
ignore_missing_stub
topartial
orpartial_stub
and clearly document what it does on the typeshed side. I'm a bit uncomfortable about adding the partial marker just by looking at some field namedignore_missing_stub
.
I personally wouldn't rename [tool.stubtest].ignore_missing_stub
(at least not due to this feature).
I infer from it, because having stubtest ignore missing stubs usually means that, well, there's missing stubs! (and so, the stub package should probably be marked as partial, so that we don't hide public API that is not yet typed).
I do recognize this may not always be the case in the future (as we both alluded to, ignore_missing_stub
and partial
are semantically different), so if you'd prefer going immediately for a different setting, let's do that 😃 (and the required changes in typeshed).
I see two ways of doing it (more suggestions welcome). Whichever solution should be well documented in typeshed.
py.typed
markers itself. And a test to ensure it contains partial\n
. stub_uploader then only needs to include them in its filters.partial
or partial_stub
, keep this PR mostly as-is.Now for example use cases where partial_stub = true
and ignore_missing_stub = false
:
partial_stub = false
and ignore_missing_stub = true
:
skip
+ ignore_missing_stub
wouldn't hurt)I'd prefer to split those features, i.e. have a separate partial_stub
key in the METADATA.toml
file for the use cases you outlined and to avoid "hidden" side effects.
Closes #93
I'm sure this can be improved. Also please review and test carefully (I'm still running integration tests, but they're taking forever).
The basic idea is to infer a stub package beingEdit: went for a separate metadata key.partial
from findingignore_missing_stub = true
in the metadata. If we decide to add a specific "partial" entry in the metadata, the logic will stay the same, only the property's inner code will change.Alternatively typeshed could add the
partial\n
py.typed
marker itself (assuming it can use packages instead of single files for single-file source w/o problem with stubtest)