datasette
datasette copied to clipboard
Test fail against Python 3.13-dev with a Pint error
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
https://devguide.python.org/versions/ says that Python 3.13 is scheduled for release in October 2024.
Got that same Pint error in CI: https://github.com/simonw/datasette/actions/runs/8681173571/job/23803398510?pr=2321
/opt/hostedtoolcache/Python/3.13.0-alpha.6/x64/lib/python3.13/site-packages/pint/delegates/txt_defparser/common.py:21: in <module>
@dataclass(frozen=True)
/opt/hostedtoolcache/Python/3.13.0-alpha.6/x64/lib/python3.13/dataclasses.py:1289: in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash,
/opt/hostedtoolcache/Python/3.13.0-alpha.6/x64/lib/python3.13/dataclasses.py:1044: in _process_class
raise TypeError('cannot inherit frozen dataclass from a '
E TypeError: cannot inherit frozen dataclass from a non-frozen one
We currently pin to: https://github.com/simonw/datasette/blob/7d6d471dc5559e174507c8e85a38a00ea8009123/setup.py#L53
The most recent version is 0.23 from December 2023: https://github.com/hgrecco/pint/releases/tag/0.23
The only open issue I can find in Pint that relates to dataclasses is this one:
- https://github.com/hgrecco/pint/issues/1766
Which links to this:
- https://github.com/python/cpython/issues/99856
Unclear if either of those relate to the error I am seeing though.
Opened an issue against Pint here:
- https://github.com/hgrecco/pint/issues/1969