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

Import error with Python 3.13 #97

Open
jsbrittain opened this issue Oct 10, 2024 · 1 comment · May be fixed by #99
Open

Import error with Python 3.13 #97

jsbrittain opened this issue Oct 10, 2024 · 1 comment · May be fixed by #99
Labels
bug Something isn't working

Comments

@jsbrittain
Copy link

adtl does not import under Python 3.13 (latest release version). This appears to be due to the new stricter frozen dataclass hierarchies. In particular, the issue seems to relate to pint, and if you import pint you get a very similar error to the one seen below (see https://github.com/hgrecco/pint/issues/ 1969; note that the pint issue was raised in April).

Python 3.13.0 (v3.13.0:60403a5409f, Oct  7 2024, 00:37:40) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import adtl
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    import adtl
  File "/Users/jsb/Desktop/ddd/venv/lib/python3.13/site-packages/adtl/__init__.py", line 18, in <module>
    import pint
  File "/Users/jsb/Desktop/ddd/venv/lib/python3.13/site-packages/pint/__init__.py", line 18, in <module>
    from .delegates.formatter._format_helpers import formatter
  File "/Users/jsb/Desktop/ddd/venv/lib/python3.13/site-packages/pint/delegates/__init__.py", line 12, in <module>
    from . import txt_defparser
  File "/Users/jsb/Desktop/ddd/venv/lib/python3.13/site-packages/pint/delegates/txt_defparser/__init__.py", line 12, in <module>
    from .defparser import DefParser
  File "/Users/jsb/Desktop/ddd/venv/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/jsb/Desktop/ddd/venv/lib/python3.13/site-packages/pint/delegates/txt_defparser/common.py", line 23, in <module>
    @dataclass(frozen=True)
     ~~~~~~~~~^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/dataclasses.py", line 1295, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
                          frozen, match_args, kw_only, slots,
                          weakref_slot)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/dataclasses.py", line 1043, in _process_class
    raise TypeError('cannot inherit frozen dataclass from a '
                    'non-frozen one')
TypeError: cannot inherit frozen dataclass from a non-frozen one
>>>
@pipliggins
Copy link
Collaborator

Thanks for raising this @jsbrittain - seems like supporting 3.13 will be blocked until the Pint issue is resolved. I'll mirror what you have done for InsightBoard and add a label to the docs indicating 3.13 is not currently supported.

@pipliggins pipliggins linked a pull request Oct 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants