Skip to content

stubtest: use separate table in METADATA.toml - #8096

Merged
hauntsaninja merged 3 commits into
python:masterfrom
hauntsaninja:stubtestthird
Jun 19, 2022
Merged

hauntsaninja merged 3 commits into
python:masterfrom
hauntsaninja:stubtestthird

Conversation

@hauntsaninja

Copy link
Copy Markdown
Collaborator

I want to start enabling --ignore-missing-stub on third party packages, like we do for stdlib, since this helps ensure type completeness. I thought it might make sense to separate out the metadata little bit.

@hauntsaninja hauntsaninja changed the title stubtest_third_party: use separate table in METADATA.toml stubtest: use separate table in METADATA.toml Jun 18, 2022
@github-actions

This comment has been minimized.

@hauntsaninja

Copy link
Copy Markdown
Collaborator Author

I think the locale failures might be a 3.10.5 thing, since https://github.com/python/typeshed/runs/6946462440?check_suite_focus=true from a couple minutes ago was green with 3.10.4

@AlexWaygood

Copy link
Copy Markdown
Member

I think the locale failures might be a 3.10.5 thing, since https://github.com/python/typeshed/runs/6946462440?check_suite_focus=true from a couple minutes ago was green with 3.10.4

Yeah looks like it. Now failing on master too. Weird that it's only failing on Darwin https://github.com/python/typeshed/runs/6946737526?check_suite_focus=true

@AlexWaygood

Copy link
Copy Markdown
Member

I want to start enabling --ignore-missing-stub on third party packages, like we do for stdlib, since this helps ensure type completeness.

Idk about this. We've (correctly) always said in the past that "some stubs" are better than "no stubs". Isn't this going to increase the burden for third-party contributors to contribute stubs to typeshed?

@hauntsaninja

Copy link
Copy Markdown
Collaborator Author

Yes, some stubs are often better than no stubs. The idea is that we make this per project configurable (and the default can be as is today).

This PR would mean that such per project stubtest configuration is more cleanly separated from the more important stuff in METADATA.toml

If that setup still sounds concerning, let's open an issue and discuss more? (since ignore-missing-stub is a little tangential to this PR)

@AlexWaygood

Copy link
Copy Markdown
Member

Yes, some stubs are often better than no stubs. The idea is that we make this per project configurable (and the default can be as is today).

Okay, sg!

This PR also looks good. We could also consider merging the requirements-stubtest.txt file that we have for some stubs into METADATA.toml. It's a bit weird that we currently have apt-dependencies in METADATA.toml, but we keep regular dependencies in a separate file, e.g.: https://github.com/python/typeshed/blob/master/stubs/google-cloud-ndb/%40tests/requirements-stubtest.txt

Comment thread tests/check_consistent.py Outdated
Comment thread tests/check_consistent.py Outdated
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@hauntsaninja

Copy link
Copy Markdown
Collaborator Author

I took a look at requirements-stubtest.txt. It seems like we have two use cases: 1) installing extras, 2) pinning things for cases where upstream pins aren't correct.
Agreed it would be nice to have consistency with apt_dependencies and put it in METADATA.toml. For case 1 it could also be nice to have "extra" installation be explicit, e.g. for html5lib we could do package_extras = ["all"] and then not have a requirements file.

That said, I think that's out of scope for this PR. I'd also want to look into the history of why we chose a separate file before doing any refactoring :-)

@hauntsaninja
hauntsaninja merged commit 64181e8 into python:master Jun 19, 2022
@hauntsaninja
hauntsaninja deleted the stubtestthird branch June 19, 2022 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants