incomplete type stubs in 1.11 release

Bug #2068777 reported by David Hotham
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pkginfo
Fix Released
Undecided
Tres Seaver

Bug Description

> Module "pkginfo.distribution" has no attribute "NewMetadataVersion"

... says mypy.

not sure whether you are writing the stubs by hand or generating them or what, but it looks as though things added in the 1.11.0 release didn't make it through

description: updated
Revision history for this message
Tres Seaver (tseaver) wrote :

Thanks for the report! I'm not sure how to repro: running 'mypy --strict' reports no errors for me.

Revision history for this message
Tres Seaver (tseaver) wrote :

OK, the check should be 'stubcheck pkginfo.distribution'. I'll need to work out automating the check under 'tox'.

Changed in pkginfo:
assignee: nobody → Tres Seaver (tseaver)
status: New → Confirmed
Revision history for this message
Tres Seaver (tseaver) wrote :
Changed in pkginfo:
status: Confirmed → Fix Released
Revision history for this message
David Hotham (absence-the-absence) wrote :

thanks! I probably could have made clearer that I was seeing mypy report errors on a project that uses pkginfo, rather than on pkginfo directly.

I think it is rather unusual to have separate stub files, most projects that I see annotate the code directly. I am mildly curious about whether you have reasons for preferring this approach - or perhaps it just happened to turn out that way.

Anyway, can confirm that mypy is happy again with pkginfo 1.11.1

Revision history for this message
Tres Seaver (tseaver) wrote :

> I think it is rather unusual to have separate stub files, most projects that I see annotate the code
> directly. I am mildly curious about whether you have reasons for preferring this approach
> - or perhaps it just happened to turn out that way.

I find that inlining the type declarations detracts quite a bit from the readability of the code: I've worked in large codebases using them, and much prefer to have them out-of-line.

Because 'mypy' was happy running against the out-of-date stubs when run inside the 'pkginfo' project,
I hadn't noticed the stubs were stale. The change I added to 'tox.ini' should keep me from letting
them drift again in the future.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.