Skip to content

Test fail against Python 3.13-dev with a Pint error #2320

@simonw

Description

@simonw

I think there may be an issue with Pint - I just hit this error with Python 3.13 on my local machine:

Traceback (most recent call last):
  File "/Users/simon/.local/share/virtualenvs/ohno-fc4nBpYX/bin/datasette", line 5, in <module>
    from datasette.cli import cli
  File "/Users/simon/.local/share/virtualenvs/ohno-fc4nBpYX/lib/python3.13/site-packages/datasette/cli.py", line 17, in <module>
    from .app import (
    ...<6 lines>...
    )
  File "/Users/simon/.local/share/virtualenvs/ohno-fc4nBpYX/lib/python3.13/site-packages/datasette/app.py", line 29, in <module>
    from .views.base import ureg
  File "/Users/simon/.local/share/virtualenvs/ohno-fc4nBpYX/lib/python3.13/site-packages/datasette/views/base.py", line 37, in <module>
    ureg = pint.UnitRegistry()
           ~~~~~~~~~~~~~~~~~^^
  File "/Users/simon/.local/share/virtualenvs/ohno-fc4nBpYX/lib/python3.13/site-packages/pint/facets/plain/registry.py", line 157, in __call__
    obj = super().__call__(*args, **kwargs)
          ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/Users/simon/.local/share/virtualenvs/ohno-fc4nBpYX/lib/python3.13/site-packages/pint/registry.py", line 129, in __init__
    super().__init__(
    ~~~~~~~~~~~~~~~~^
        filename=filename,
        ^^^^^^^^^^^^^^^^^^
    ...<12 lines>...
        cache_folder=cache_folder,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/simon/.local/share/virtualenvs/ohno-fc4nBpYX/lib/python3.13/site-packages/pint/facets/system/registry.py", line 57, in __init__
    super().__init__(**kwargs)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Users/simon/.local/share/virtualenvs/ohno-fc4nBpYX/lib/python3.13/site-packages/pint/facets/group/registry.py", line 48, in __init__
    super().__init__(**kwargs)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Users/simon/.local/share/virtualenvs/ohno-fc4nBpYX/lib/python3.13/site-packages/pint/facets/context/registry.py", line 69, in __init__
    super().__init__(**kwargs)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Users/simon/.local/share/virtualenvs/ohno-fc4nBpYX/lib/python3.13/site-packages/pint/facets/nonmultiplicative/registry.py", line 50, in __init__
    super().__init__(**kwargs)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Users/simon/.local/share/virtualenvs/ohno-fc4nBpYX/lib/python3.13/site-packages/pint/facets/plain/registry.py", line 247, in __init__
    from ... import delegates  # TODO: change thiss
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/simon/.local/share/virtualenvs/ohno-fc4nBpYX/lib/python3.13/site-packages/pint/delegates/__init__.py", line 11, in <module>
    from . import txt_defparser
  File "/Users/simon/.local/share/virtualenvs/ohno-fc4nBpYX/lib/python3.13/site-packages/pint/delegates/txt_defparser/__init__.py", line 12, in <module>
    from .defparser import DefParser
  File "/Users/simon/.local/share/virtualenvs/ohno-fc4nBpYX/lib/python3.13/site-packages/pint/delegates/txt_defparser/defparser.py", line 10, in <module>
    from . import block, common, context, defaults, group, plain, system
  File "/Users/simon/.local/share/virtualenvs/ohno-fc4nBpYX/lib/python3.13/site-packages/pint/delegates/txt_defparser/common.py", line 21, in <module>
    @dataclass(frozen=True)
     ~~~~~~~~~^^^^^^^^^^^^^
  File "/Users/simon/.pyenv/versions/3.13-dev/lib/python3.13/dataclasses.py", line 1247, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                          frozen, match_args, kw_only, slots,
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                          weakref_slot)
                          ^^^^^^^^^^^^^
  File "/Users/simon/.pyenv/versions/3.13-dev/lib/python3.13/dataclasses.py", line 1015, in _process_class
    raise TypeError('cannot inherit frozen dataclass from a '
                    'non-frozen one')
TypeError: cannot inherit frozen dataclass from a non-frozen one

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions