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

Vendored typing-extensions is incompatible with Python 3.12 #12053

Closed
1 task done
blink1073 opened this issue May 25, 2023 · 1 comment · Fixed by #12056
Closed
1 task done

Vendored typing-extensions is incompatible with Python 3.12 #12053

blink1073 opened this issue May 25, 2023 · 1 comment · Fixed by #12056
Labels
project: vendored dependency Related to a vendored dependency type: bug A confirmed bug or unintended behavior

Comments

@blink1073
Copy link
Contributor

blink1073 commented May 25, 2023

Description

We tried testing against the new Python 3.12 beta-1 release in Jupyter Server, and ran into the following bug when running pip debug:

ERROR: Exception:
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 169, in exc_logging_wrapper
    status = run_func(*args)
             ^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/commands/debug.py", line 195, in run
    show_vendor_versions()
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/commands/debug.py", line 101, in show_vendor_versions
    show_actual_vendor_versions(vendor_txt_versions)
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/commands/debug.py", line 81, in show_actual_vendor_versions
    actual_version = get_vendor_version_from_module(module_name)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/commands/debug.py", line 61, in get_vendor_version_from_module
    module = get_module_from_module_name(module_name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/commands/debug.py", line 56, in get_module_from_module_name
    __import__(f"pip._vendor.{module_name}", globals(), locals(), level=0)
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_vendor/typing_extensions.py", line 1174, in <module>
    class TypeVar(typing.TypeVar, _DefaultMixin, _root=True):
TypeError: type 'typing.TypeVar' is not an acceptable base type

It looks like the vendored typing_extensions needs to be updated to 4.6.0 to pick up python/typing_extensions#162

Expected behavior

pip debug works on Python 3.12 beta-1

pip version

23.1.2

Python version

3.12.0b1

OS

Ubuntu 22.04.2

How to Reproduce

  1. Install packages using pip 23.1.2 on Python 3.12.0b1
  2. Run pip list

Output

$ pip debug
WARNING: This command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without notice.
pip version: pip 23.1.2 from /opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip (python 3.12)
sys.version: 3.12.0b1 (main, May 25 2023, 06:32:07) [GCC 11.3.0]
sys.executable: /opt/hostedtoolcache/Python/3.12.0-beta.1/x64/bin/python
sys.getdefaultencoding: utf-8
sys.getfilesystemencoding: utf-8
locale.getpreferredencoding: [UTF-8](https://jira.mongodb.org/browse/UTF-8)
sys.platform: linux
sys.implementation:
  name: cpython
'cert' config value: global
REQUESTS_CA_BUNDLE: None
CURL_CA_BUNDLE: None
pip._vendor.certifi.where(): /opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_vendor/certifi/cacert.pem
pip._vendor.DEBUNDLED: False
vendored library versions:
  CacheControl==0.12.11
  colorama==0.4.6
  distlib==0.3.6
  distro==1.8.0
  msgpack==1.0.5
  packaging==21.3
  platformdirs==3.2.0
  pyparsing==3.0.9
  pyproject-hooks==1.0.0
  requests==2.28.2
  certifi==2022.12.07
  chardet==5.1.0
  idna==3.4
  urllib3==1.26.15
  rich==13.3.3 (Unable to locate actual module version, using vendor.txt specified version)
  pygments==2.14.0
ERROR: Exception:
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 169, in exc_logging_wrapper
    status = run_func(*args)
             ^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/commands/debug.py", line 195, in run
    show_vendor_versions()
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/commands/debug.py", line 101, in show_vendor_versions
    show_actual_vendor_versions(vendor_txt_versions)
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/commands/debug.py", line 81, in show_actual_vendor_versions
    actual_version = get_vendor_version_from_module(module_name)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/commands/debug.py", line 61, in get_vendor_version_from_module
    module = get_module_from_module_name(module_name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/commands/debug.py", line 56, in get_module_from_module_name
    __import__(f"pip._vendor.{module_name}", globals(), locals(), level=0)
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_vendor/typing_extensions.py", line 1174, in <module>
    class TypeVar(typing.TypeVar, _DefaultMixin, _root=True):
TypeError: type 'typing.TypeVar' is not an acceptable base type

Code of Conduct

@blink1073 blink1073 added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels May 25, 2023
@blink1073 blink1073 changed the title Support for Python 3.12 Support for Python 3.12 with the List Command May 25, 2023
@blink1073 blink1073 changed the title Support for Python 3.12 with the List Command Support for Python 3.12 with the Debug Command May 25, 2023
@uranusjr uranusjr changed the title Support for Python 3.12 with the Debug Command Vendored typing-extensions is incompatible with Python 3.12 May 26, 2023
@uranusjr
Copy link
Member

A pull request to update the vendored package would be welcomed. Instructions can be found in the documentation.

@uranusjr uranusjr added project: vendored dependency Related to a vendored dependency and removed S: needs triage Issues/PRs that need to be triaged labels May 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
project: vendored dependency Related to a vendored dependency type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants