Skip to content

[azure-core] Failing to import in Python 3.11.0b3 #24928

@major

Description

@major
  • Package Name: azure-core
  • Package Version: 1.23.1
  • Operating System: Fedora 37
  • Python Version: 3.11.0b3

Describe the bug
Fedora 37 has just updated to Python 3.11.0b3 to prepare for the Python 3.11 final release. However, this has caused issues in azure.core with typed variables:

>>> import azure.core
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.11/site-packages/azure/core/__init__.py", line 30, in <module>
    from ._pipeline_client import PipelineClient
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/azure/core/_pipeline_client.py", line 30, in <module>
    from .pipeline import Pipeline
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/azure/core/pipeline/__init__.py", line 178, in <module>
    from ._base import Pipeline  # pylint: disable=wrong-import-position
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/azure/core/pipeline/_base.py", line 46, in <module>
    class _SansIOHTTPPolicyRunner(HTTPPolicy, Generic[HTTPRequestType, HTTPResponseType]):
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen abc>", line 106, in __new__
  File "/usr/local/lib/python3.11/typing.py", line 1869, in __init_subclass__
    raise TypeError(f"Some type variables ({s_vars}) are"
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Some type variables (~HTTPRequestType, ~HTTPResponseType) are not listed in Generic[~HTTPRequestType, ~HTTPResponseType]

To Reproduce
Steps to reproduce the behavior:

  1. podman run --rm -it --pull always docker.io/library/python:3.11.0b3 bash
  2. In the container, run pip install azure-core
  3. In the container, run python and type import azure.core
  4. The traceback appears

Expected behavior
I would expect the import of azure.core to work properly as it does under Python 3.10.

Metadata

Metadata

Assignees

Labels

Azure.CoreClientThis issue points to a problem in the data-plane of the library.bugThis issue requires a change to an existing behavior in the product in order to be resolved.issue-addressedWorkflow: The Azure SDK team believes it to be addressed and ready to close.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions