python / typing_extensions

Backported and experimental type hints for Python
Other
445 stars 109 forks source link

4.12.2 creates an import bug #427

Closed vroulet closed 5 months ago

vroulet commented 5 months ago

Hello,

The recent bump in version to 4.12.2 created an import bug in our tests. Namely, we get

File "/home/runner/work/optax/optax/_testing/optax-env.ENPG9VuJ/lib/python3.11/site-packages/IPython/core/guarded_eval.py", line 40, in <module>
    from typing_extensions import TypeAliasType
ImportError: cannot import name 'TypeAliasType' from 'typing_extensions' (/home/runner/work/optax/optax/_testing/optax-env.ENPG9VuJ/lib/python3.11/site-packages/typing_extensions.py)

in our usual github actions when running sphynx. See e.g https://github.com/google-deepmind/optax/actions/runs/9453768741/job/26039814800 for a detailed example appearing only recently (approximately on June 8th).

Forcing an earlier version of typing_extensions (see https://github.com/google-deepmind/optax/pull/985) solves the issue.

I am not able to reproduce the bug locally and I don't understand how the import bug appeared unfortunately, but the fix (https://github.com/google-deepmind/optax/pull/985) clearly points out to a bug in the 4.12.2 version of typing_extensions.

vroulet commented 5 months ago

Scratch that, it seems that the problem comes from other packages enforcing an old version of typing_extensions. Sorry for that.

AlexWaygood commented 5 months ago

Sorry for that.

You gave me five minutes' worth of "What?! How??! What did I do???", but no harm done other than that đŸ˜†