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

Remove setuptools/pkg_resources #13369

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented Jan 6, 2025

Closes #12398

@Avasam Avasam added the stubs: removal Pending removal of third-party distributions label Jan 6, 2025

This comment has been minimized.

This comment has been minimized.

"""
requires = ["setuptools"] # For pkg_resources
Copy link
Collaborator Author

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

Copy link
Contributor

github-actions bot commented Jan 6, 2025

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)

paroxython (https://github.com/laowantong/paroxython)
+ paroxython/__init__.py:20: error: Library stubs not installed for "pkg_resources"  [import-untyped]
+ paroxython/__init__.py:20: note: Hint: "python3 -m pip install types-setuptools"
+ paroxython/__init__.py:20: note: (or run "mypy --install-types" to install all missing stub packages)
+ paroxython/__init__.py:20: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stubs: removal Pending removal of third-party distributions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove pkg_resources package from types-setuptools, not before January 2025
1 participant