tensorflow / probability

Probabilistic reasoning and statistical analysis in TensorFlow
https://www.tensorflow.org/probability/
Apache License 2.0
4.25k stars 1.1k forks source link

Pinning typing-extensions is broken on Python 3.12, Jax 0.4.18 #1759

Closed NeilGirdhar closed 11 months ago

NeilGirdhar commented 11 months ago

Pinning typing-extensions below 4.6 (https://github.com/tensorflow/probability/blob/main/required_packages.py) is totally broken as per this traceback

    from jax import enable_custom_prng
../../.cache/pypoetry/virtualenvs/efax-ZssyUsLU-py3.12/lib/python3.12/site-packages/jax/__init__.py:83: in <module>
    from jax._src.api import effects_barrier as effects_barrier
../../.cache/pypoetry/virtualenvs/efax-ZssyUsLU-py3.12/lib/python3.12/site-packages/jax/_src/api.py:40: in <module>
    from jax._src import stages
../../.cache/pypoetry/virtualenvs/efax-ZssyUsLU-py3.12/lib/python3.12/site-packages/jax/_src/stages.py:44: in <module>
    from jax._src.interpreters import mlir
../../.cache/pypoetry/virtualenvs/efax-ZssyUsLU-py3.12/lib/python3.12/site-packages/jax/_src/interpreters/mlir.py:36: in <module>
    from jax._src import pickle_util
../../.cache/pypoetry/virtualenvs/efax-ZssyUsLU-py3.12/lib/python3.12/site-packages/jax/_src/pickle_util.py:21: in <module>
    import cloudpickle  # type: ignore[import]
../../.cache/pypoetry/virtualenvs/efax-ZssyUsLU-py3.12/lib/python3.12/site-packages/cloudpickle/__init__.py:1: in <module>
    from cloudpickle.cloudpickle import *  # noqa
../../.cache/pypoetry/virtualenvs/efax-ZssyUsLU-py3.12/lib/python3.12/site-packages/cloudpickle/cloudpickle.py:63: in <module>
    import typing_extensions as _typing_extensions
../../.cache/pypoetry/virtualenvs/efax-ZssyUsLU-py3.12/lib/python3.12/site-packages/typing_extensions.py:1174: in <module>
    class TypeVar(typing.TypeVar, _DefaultMixin, _root=True):
E   TypeError: type 'typing.TypeVar' is not an acceptable base type

Python 3.12, Jax 0.4.18

NeilGirdhar commented 11 months ago

@ColCarroll

ColCarroll commented 11 months ago

Closing as dupe with #1753 -- I'm not positive that relaxing the typing_extensions version will fix this, but it seems likely to! Feel free to reopen if you disagree.