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

types-setuptools 71.1.0.20240726 fails to typecheck with pyright #12436

Closed
doy-materialize opened this issue Jul 26, 2024 · 3 comments
Closed

Comments

@doy-materialize
Copy link

doy-materialize commented Jul 26, 2024

after upgrading, i get:

error: Type of "setup" is partially unknown
    Type of "setup" is "(*, name: str = ..., version: str = ..., description: str = ..., long_description: str = ..., long_description_content_type: str = ..., author: str = ..., author_email: str = ..., maintainer: str = ..., maintainer_email: str = ..., url: str = ..., download_url: str = ..., packages: list[str] = ..., py_modules: list[str] = ..., scripts: list[str] = ..., ext_modules: Sequence[Extension] = ..., classifiers: list[str] = ..., distclass: type[Distribution] = ..., script_name: str = ..., script_args: list[str] = ..., options: Mapping[str, Any] = ..., license: str = ..., keywords: list[str] | str = ..., platforms: list[str] | str = ..., cmdclass: Mapping[str, type[Command]] = ..., data_files: list[tuple[str, list[str]]] = ..., package_dir: Mapping[str, str] = ..., obsoletes: list[str] = ..., provides: list[str] = ..., requires: list[str] = ..., command_packages: list[str] = ..., command_options: Mapping[str, Mapping[str, tuple[Any, Any]]] = ..., package_data: Mapping[str, list[str]] = ..., include_package_data: bool = ..., libraries: list[str] = ..., headers: list[str] = ..., ext_package: str = ..., include_dirs: list[str] = ..., password: str = ..., fullname: str = ..., **attrs: Unknown) -> Distribution" (reportUnknownVariableType)

this appears to be due to #12406, which removed the Any annotation from **attrs with no replacement, which pyright interprets as Unknown.

@JelleZijlstra
Copy link
Member

This seems to behave as expected. You are using very strict settings that warn you if you are using stubs with incomplete annotations. Using those settings will mean that you have to deal with occasional issues like this; you can fix them by either ignoring the error in your code with the appropriate comment, or contributing improved stubs.

@srittau srittau closed this as not planned Won't fix, can't repro, duplicate, stale Jul 26, 2024
@doy-materialize
Copy link
Author

i don't really understand why this issue was closed. i understand that the solution here is that improved stubs are needed, but... that's why i opened the issue - the stubs in this repository don't work and need to be fixed, as far as i can tell? or is there somewhere else this should be reported?

@JelleZijlstra
Copy link
Member

The stubs work fine, but pyright is warning you that they are incomplete, like many other stubs in typeshed. We don't consider that a bug, but we accept PRs adding annotations to unannotated functions.

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

No branches or pull requests

3 participants