Skip to content

Coverage Checks #1243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
llchan opened this issue May 4, 2017 · 5 comments
Closed

Coverage Checks #1243

llchan opened this issue May 4, 2017 · 5 comments
Labels
project: policy Organization of the typeshed project

Comments

@llchan
Copy link
Contributor

llchan commented May 4, 2017

Would it be possible to write a script to measure typeshed coverage for a given package/module, and track that over time? Specifically, I'd like to see the stdlib get to 100% over time. Sometimes stubs exist for a particular module, but they are missing a handful of defs, and we don't know until someone tries to check it in mypy and reports it.

@JelleZijlstra
Copy link
Member

We'd definitely like more automated coverage checks. I've started one at https://github.com/JelleZijlstra/stubcheck and mypy recently gained a stub testing script at python/mypy#3036, but we need to do more work to integrate those into typeshed.

@gvanrossum
Copy link
Member

Which reminds me, is there any documentation for scripts/stubtest.py? It's got scant docstrings, no usage message except "must provide at least one module to test", and when I invoke it with "fnmatch" (the only thing I've tried so far) I get complaints about modules imported in the runtime version that aren't in the stub for a good reason:

module "os" defined at line 0 at runtime but is not defined in stub
module "re" defined at line 0 at runtime but is not defined in stub
module "functools" defined at line 0 at runtime but is not defined in stub
module "posixpath" defined at line 0 at runtime but is not defined in stub

This also reveals that it doesn't do line numbers right yet, and IMO it should show the full filenames for the things it is comparing.

@JukkaL
Copy link
Contributor

JukkaL commented May 5, 2017

Stubtest still needs some polish. Somebody could spend a little time playing around with it and file issues for simple things that could be improved. I can do this unless somebody else wishes to volunteer. The issues should probably be added to the mypy repo.

@gvanrossum
Copy link
Member

OK added python/mypy#3329.

@srittau srittau added the project: policy Organization of the typeshed project label Oct 28, 2018
@hauntsaninja
Copy link
Collaborator

This issue is similar to #4179. Most of the discussion here centres around stubtest (which has recently received a rewrite, see python/mypy#8325 and others, and is now integrated into typeshed CI), so closing in favour of the newer issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project: policy Organization of the typeshed project
Projects
None yet
Development

No branches or pull requests

6 participants