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

Pint should define a min version for typing_extensions #1802

Closed
beenje opened this issue Jun 12, 2023 · 1 comment · Fixed by #1996
Closed

Pint should define a min version for typing_extensions #1802

beenje opened this issue Jun 12, 2023 · 1 comment · Fixed by #1996
Labels
Milestone

Comments

@beenje
Copy link

beenje commented Jun 12, 2023

We found an issue with pint 0.22 due to an old version of typing_extensions installed.

____________________ ERROR collecting cli/test/test_alt.py _____________________
ImportError while importing test module '/usr/local/lib/python3.9/dist-packages/taurus/cli/test/test_alt.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
/usr/local/lib/python3.9/dist-packages/taurus/cli/test/test_alt.py:25: in <module>
    from taurus.core.util.test.test_plugin import mock_entry_point
/usr/local/lib/python3.9/dist-packages/taurus/core/__init__.py:87: in <module>
    from .taurusattribute import *  # noqa: F403,F401
/usr/local/lib/python3.9/dist-packages/taurus/core/taurusattribute.py:39: in <module>
    from taurus.core.units import Quantity
/usr/local/lib/python3.9/dist-packages/taurus/core/units.py:34: in <module>
    from pint import UnitRegistry, __version__
/usr/local/lib/python3.9/dist-packages/pint/__init__.py:28: in <module>
    from .formatting import formatter, register_unit_format
/usr/local/lib/python3.9/dist-packages/pint/formatting.py:20: in <module>
    from .babel_names import _babel_lengths, _babel_units
/usr/local/lib/python3.9/dist-packages/pint/babel_names.py:11: in <module>
    from .compat import HAS_BABEL
/usr/local/lib/python3.9/dist-packages/pint/compat.py:34: in <module>
    from typing_extensions import Self  # noqa
E   ImportError: cannot import name 'Self' from 'typing_extensions' (/usr/lib/python3/dist-packages/typing_extensions.py)

typing_extensions 3.7.4 is installed but typing_extensions.Self was only added in 4.0.0

pint should require at least typing_extensions >= 4.0.0. Not sure if even a newer version is needed or not.

@hgrecco hgrecco added the bug label Jun 12, 2023
@hgrecco hgrecco added this to the 0.23 milestone Jun 12, 2023
@dcamron
Copy link

dcamron commented Oct 27, 2023

Hit this on a recent MetPy stackoverflow question and successfully recreated with

pint                      0.22
python                    3.10.13
typing_extensions         3.10.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants