typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

Typing issues for `jaraco/skeleton` based projects

Open Avasam opened this issue 1 year ago • 0 comments

I'm currently going through all mypy failures in https://github.com/jaraco/skeleton/issues/143 Some of those are caused by typeshed stubs that could be improved, I'll be using this issue as an aggregated checklist of everything I find. CC @jaraco if you find anything else feel free to let me know or comment here.

pywin32:

from win32wnet import NETRESOURCE, WNetAddConnection2
res = WNetAddConnection2(...)  # WNetAddConnection2" does not return a value (it only ever returns None)  [func-returns-value]
import isapi.install  # Skipping analyzing "isapi.install": module is installed, but missing library stubs or py.typed marker  [import-untyped]

docutils:

def return_parts(source: str) -> str:
    return docutils.core.publish_parts(source)  # Returning Any from function declared to return "str"  [no-any-return]

setuptools:

from setuptools import setup
setup(script_args=('py2exe',))  # Argument "script_args" to "setup" has incompatible type "tuple[str]"; expected "list[str]"

https://github.com/pypa/setuptools/pull/4604#discussion_r1777834900 (validate whether using None as a default_section is valid usage)

from configparser import ConfigParser
parser = ConfigParser(default_section=None, delimiters=("=",)) # No overload variant of "ConfigParser" matches argument types "None", "tuple[str]" [call-overload]

stdlib:

import ctypes
ctypes.wintypes.DWORD() # "wintypes" is not a known attribute of module "ctypes" (reportAttributeAccessIssue)

Avasam avatar Aug 26 '24 18:08 Avasam