-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Remove setuptools/pkg_resources
#13369
Conversation
This comment has been minimized.
This comment has been minimized.
…Avasam/typeshed into remove-setuptools-pkg_resources
This comment has been minimized.
This comment has been minimized.
""" | ||
requires = ["setuptools"] # For pkg_resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, a stub can't depend on the library it stubs >.<
Since this restriction is in place for security reasons, would it make sense to allow types-Foo
to require Foo
?
stub_uploader.metadata.InvalidRequires: Expected dependency setuptools to be listed in setuptools's requires_dist or the sdist's *.egg-info/requires.txt
This comment has been minimized.
This comment has been minimized.
Diff from mypy_primer, showing the effect of this PR on open source code: scipy (https://github.com/scipy/scipy)
- scipy/_build_utils/_generate_blas_wrapper.py:31: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
+ scipy/_build_utils/tempita/_tempita.py:1041: error: Library stubs not installed for "pkg_resources" [import-untyped]
+ scipy/_build_utils/tempita/_tempita.py:1041: note: Hint: "python3 -m pip install types-setuptools"
+ scipy/_build_utils/tempita/_tempita.py:1041: note: (or run "mypy --install-types" to install all missing stub packages)
+ scipy/_build_utils/tempita/_tempita.py:1041: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
+ scipy/_lib/unuran/get_and_clean_unuran.py:8: error: Library stubs not installed for "pkg_resources" [import-untyped]
pwndbg (https://github.com/pwndbg/pwndbg)
+ pwndbg/exception.py:51: error: Library stubs not installed for "pkg_resources" [import-untyped]
+ pwndbg/exception.py:51: note: Hint: "python3 -m pip install types-setuptools"
+ pwndbg/exception.py:51: note: (or run "mypy --install-types" to install all missing stub packages)
|
The primer hits should be fixed by hauntsaninja/mypy_primer#131 (CC @hauntsaninja ) stub_uploader support is added in typeshed-internal/stub_uploader#159 |
If using `setuptools >= 71.1` *only* for `pkg_resources`, | ||
you don't need `types-setuptools` since `pkg_resources` is now typed.\ | ||
Given that `pkg_resources` is typed since `setuptools >= 71.1`, \ | ||
it is no longer included with `types-setuptools`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative:
it is no longer included with `types-setuptools`. | |
`pkg_resources-stubs` is no longer included with `types-setuptools`. |
Version 75.8.2.20250305 (2025-03-05) removed setuptools/pkg_resources: python/typeshed#13369 Since we still require to support Python 3.7 from Debian Buster, we need to keep using pkg_resources. Cap types-setuptools version to the versions before pkg_resources types got removed. Change-Id: Ic9c26144337687bd5db2010eab32d4554afb9d02
Closes #12398