Skip to content
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

Typing issues for jaraco/skeleton based projects #12595

Closed
Avasam opened this issue Aug 26, 2024 · 2 comments
Closed

Typing issues for jaraco/skeleton based projects #12595

Avasam opened this issue Aug 26, 2024 · 2 comments
Labels
stubs: false positive Type checkers report false errors stubs: incomplete Annotations or sub-modules missing from an existing package or module

Comments

@Avasam
Copy link
Collaborator

Avasam commented Aug 26, 2024

I'm currently going through all mypy failures in jaraco/skeleton#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: https://github.com/jaraco/jaraco.windows/pull/28/files#r1857488881 & #13119

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: #13118

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

setuptools: pypa/distutils#320

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

pypa/setuptools#4604 (comment) (validate whether using None as a default_section is valid usage) split off to #12700

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

stdlib: #12595 (comment)

import ctypes
ctypes.wintypes.DWORD() # "wintypes" is not a known attribute of module "ctypes" (reportAttributeAccessIssue)
@python python deleted a comment Aug 26, 2024
@Avasam Avasam changed the title Typing issues for pypa/skeleton based projects Typing issues for jaraco/skeleton based projects Aug 26, 2024
@Avasam Avasam added the stubs: false positive Type checkers report false errors label Aug 26, 2024
@Avasam Avasam added the stubs: incomplete Annotations or sub-modules missing from an existing package or module label Aug 27, 2024
@Avasam
Copy link
Collaborator Author

Avasam commented Nov 25, 2024

import ctypes
ctypes.wintypes.DWORD()

For me this fails on Python 3.11 but fails on 3.13 and I don't see any direct imports in any of the ctypes module. So I think that whenever that snippet works its an accidental implementation detail and shouldn't be relied on.

@Avasam
Copy link
Collaborator Author

Avasam commented Nov 26, 2024

All appropriate PRs have been open and comments made on stuff that doesn't need changes. Closing as this was only meant as a TODO list, all references have been updated.

@Avasam Avasam closed this as completed Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stubs: false positive Type checkers report false errors stubs: incomplete Annotations or sub-modules missing from an existing package or module
Projects
None yet
Development

No branches or pull requests

2 participants
@Avasam and others