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

tmt does not install well on Fedora 41 #3168

Closed
happz opened this issue Aug 27, 2024 · 9 comments
Closed

tmt does not install well on Fedora 41 #3168

happz opened this issue Aug 27, 2024 · 9 comments
Labels
packaging Changes related to the rpm packaging

Comments

@happz
Copy link
Collaborator

happz commented Aug 27, 2024

See https://artifacts.dev.testing-farm.io/a1bfe9fa-f80e-441b-9883-25826ac78ec1/:

      gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fcf-protection -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions -O3 -fPIC "-DPSYCOPG_VERSION=2.9.9 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=160004 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/tmp/venv/include -I/usr/include/python3.13 -I. -I/usr/include -I/usr/include/pgsql/server -c psycopg/utils.c -o build/temp.linux-x86_64-cpython-313/psycopg/utils.o -Wdeclaration-after-statement
      psycopg/utils.c: In function ‘psyco_is_main_interp’:
      psycopg/utils.c:397:12: error: implicit declaration of function ‘_PyInterpreterState_Get’; did you mean ‘PyInterpreterState_Get’? [-Wimplicit-function-declaration]
        397 |     return _PyInterpreterState_Get() == PyInterpreterState_Main();
            |            ^~~~~~~~~~~~~~~~~~~~~~~
            |            PyInterpreterState_Get
      psycopg/utils.c:397:38: warning: comparison between pointer and integer
        397 |     return _PyInterpreterState_Get() == PyInterpreterState_Main();
            |                                      ^~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for psycopg2
Installing collected packages: appdirs, urllib3, typing-extensions, ruamel-yaml, rpds-py, pygments, packaging, MarkupSafe, idna, filelock, docutils, click, charset-normalizer, certifi, attrs, requests, referencing, jinja2, flexparser, flexcache, pint, jsonschema-specifications, jsonschema, fmf, tmt
Successfully installed MarkupSafe-2.1.5 appdirs-1.4.4 attrs-24.2.0 certifi-2024.7.4 charset-normalizer-3.3.2 click-8.1.7 docutils-0.21.2 filelock-3.15.4 flexcache-0.3 flexparser-0.3.1 fmf-1.4.1 idna-3.8 jinja2-3.1.4 jsonschema-4.23.0 jsonschema-specifications-2023.12.1 packaging-24.1 pint-0.24.3 pygments-2.18.0 referencing-0.35.1 requests-2.32.3 rpds-py-0.20.0 ruamel-yaml-0.18.6 tmt-0.0.1.dev0 typing-extensions-4.12.2 urllib3-2.2.2
Traceback (most recent call last):
  File "/tmp/venv/bin/tmt", line 5, in <module>
    from tmt.__main__ import run_cli
  File "/tmp/venv/lib64/python3.13/site-packages/tmt/__init__.py", line 20, in <module>
    from tmt.base import Clean, Plan, Run, Status, Story, Test, Tree
  File "/tmp/venv/lib64/python3.13/site-packages/tmt/base.py", line 38, in <module>
    import tmt.checks
  File "/tmp/venv/lib64/python3.13/site-packages/tmt/checks/__init__.py", line 7, in <module>
    import tmt.steps.provision
  File "/tmp/venv/lib64/python3.13/site-packages/tmt/steps/provision/__init__.py", line 35, in <module>
    import tmt.hardware
  File "/tmp/venv/lib64/python3.13/site-packages/tmt/hardware.py", line 48, in <module>
    import pint
  File "/tmp/venv/lib64/python3.13/site-packages/pint/__init__.py", line 18, in <module>
    from .delegates.formatter._format_helpers import formatter
  File "/tmp/venv/lib64/python3.13/site-packages/pint/delegates/__init__.py", line 12, in <module>
    from . import txt_defparser
  File "/tmp/venv/lib64/python3.13/site-packages/pint/delegates/txt_defparser/__init__.py", line 12, in <module>
    from .defparser import DefParser
  File "/tmp/venv/lib64/python3.13/site-packages/pint/delegates/txt_defparser/defparser.py", line 10, in <module>
    from . import block, common, context, defaults, group, plain, system
  File "/tmp/venv/lib64/python3.13/site-packages/pint/delegates/txt_defparser/common.py", line 23, in <module>
    @dataclass(frozen=True)
     ~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/lib64/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 "/usr/lib64/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
Shared connection to 18.221.239.160 closed.
@happz happz added the packaging Changes related to the rpm packaging label Aug 27, 2024
@teemtee teemtee deleted a comment Aug 27, 2024
@teemtee teemtee deleted a comment Aug 27, 2024
@teemtee teemtee deleted a comment Aug 27, 2024
@teemtee teemtee deleted a comment Aug 27, 2024
@teemtee teemtee deleted a comment Aug 27, 2024
@teemtee teemtee deleted a comment Aug 27, 2024
@teemtee teemtee deleted a comment Aug 27, 2024
@teemtee teemtee deleted a comment Aug 27, 2024
@teemtee teemtee deleted a comment Aug 27, 2024
@teemtee teemtee deleted a comment Aug 27, 2024
@martinhoyer
Copy link
Collaborator

Pint:
hgrecco/pint#2037
hgrecco/pint#1969

@martinhoyer
Copy link
Collaborator

psycopg being used by python-nitrate (test-convert plugin).
Trying to move to psycopg3 there: psss/python-nitrate#49

@martinhoyer
Copy link
Collaborator

hmm, I think that if we can merge the python-nitrate patch, we can just extend the pip install test xfail to f41 as well, until pint is fixed in upstream, but F41 could be fine otherwise.

@guoguojenna
Copy link
Contributor

Running into this issue.

https://gitlab.com/rh-kernel-stqe/sts/-/jobs/8058048363

tmt lint.................................................................Failed
- hook id: tmt-lint
- exit code: 1
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 112, in _get_module_details
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/tmt/__init__.py", line 20, in <module>
    from tmt.base import Clean, Plan, Run, Status, Story, Test, Tree
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/tmt/base.py", line 38, in <module>
    import tmt.checks
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/tmt/checks/__init__.py", line 7, in <module>
    import tmt.steps.provision
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/tmt/steps/provision/__init__.py", line 35, in <module>
    import tmt.hardware
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/tmt/hardware.py", line 48, in <module>
    import pint
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/pint/__init__.py", line 18, in <module>
    from .delegates.formatter._format_helpers import formatter
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/pint/delegates/__init__.py", line 12, in <module>
    from . import txt_defparser
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/pint/delegates/txt_defparser/__init__.py", line 12, in <module>
    from .defparser import DefParser
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/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 "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/pint/delegates/txt_defparser/common.py", line 23, in <module>
    @dataclass(frozen=True)
     ~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/local/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 "/usr/local/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
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 112, in _get_module_details
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/tmt/__init__.py", line 20, in <module>
    from tmt.base import Clean, Plan, Run, Status, Story, Test, Tree
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/tmt/base.py", line 38, in <module>
    import tmt.checks
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/tmt/checks/__init__.py", line 7, in <module>
    import tmt.steps.provision
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/tmt/steps/provision/__init__.py", line 35, in <module>
    import tmt.hardware
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/tmt/hardware.py", line 48, in <module>
    import pint
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/pint/__init__.py", line 18, in <module>
    from .delegates.formatter._format_helpers import formatter
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/pint/delegates/__init__.py", line 12, in <module>
    from . import txt_defparser
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/pint/delegates/txt_defparser/__init__.py", line 12, in <module>
    from .defparser import DefParser
  File "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/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 "/root/.cache/pre-commit/repo_imw5e8g/py_env-python3/lib/python3.13/site-packages/pint/delegates/txt_defparser/common.py", line 23, in <module>
    @dataclass(frozen=True)
     ~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/local/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 "/usr/local/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
Cleaning up project directory and file based variables

@martinhoyer
Copy link
Collaborator

Thanks, I thought about setting python version in pre-commit-hook config, but there can only be one version, so it would probably do more harm than good.

@pholica
Copy link
Contributor

pholica commented Nov 7, 2024

Hello, I'm hitting this issue as well when using pre-commit hook and I have python-3.12:

$ pre-commit run -a
[INFO] Initializing environment for https://github.com/teemtee/tmt.git.
[INFO] Installing environment for https://github.com/teemtee/tmt.git.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Tmt Linter...............................................................Failed
- hook id: tmt-lint
- exit code: 1

Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 112, in _get_module_details
  File "/home/pholica/.cache/pre-commit/repo4b2dxop9/py_env-python3/lib/python3.12/site-packages/tmt/__init__.py", line 20, in <module>
    from tmt.base import Clean, Plan, Run, Status, Story, Test, Tree
  File "/home/pholica/.cache/pre-commit/repo4b2dxop9/py_env-python3/lib/python3.12/site-packages/tmt/base.py", line 38, in <module>
    import tmt.checks
  File "/home/pholica/.cache/pre-commit/repo4b2dxop9/py_env-python3/lib/python3.12/site-packages/tmt/checks/__init__.py", line 7, in <module>
    import tmt.steps.provision
  File "/home/pholica/.cache/pre-commit/repo4b2dxop9/py_env-python3/lib/python3.12/site-packages/tmt/steps/provision/__init__.py", line 35, in <module>
    import tmt.hardware
  File "/home/pholica/.cache/pre-commit/repo4b2dxop9/py_env-python3/lib/python3.12/site-packages/tmt/hardware.py", line 48, in <module>
    import pint
  File "/home/pholica/.cache/pre-commit/repo4b2dxop9/py_env-python3/lib/python3.12/site-packages/pint/__init__.py", line 18, in <module>
    from .delegates.formatter._format_helpers import formatter
  File "/home/pholica/.cache/pre-commit/repo4b2dxop9/py_env-python3/lib/python3.12/site-packages/pint/delegates/__init__.py", line 12, in <module>
    from . import txt_defparser
  File "/home/pholica/.cache/pre-commit/repo4b2dxop9/py_env-python3/lib/python3.12/site-packages/pint/delegates/txt_defparser/__init__.py", line 12, in <module>
    from .defparser import DefParser
  File "/home/pholica/.cache/pre-commit/repo4b2dxop9/py_env-python3/lib/python3.12/site-packages/pint/delegates/txt_defparser/defparser.py", line 10, in <module>
    from . import block, common, context, defaults, group, plain, system
  File "/home/pholica/.cache/pre-commit/repo4b2dxop9/py_env-python3/lib/python3.12/site-packages/pint/delegates/txt_defparser/common.py", line 23, in <module>
    @dataclass(frozen=True)
     ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/dataclasses.py", line 1265, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/dataclasses.py", line 1029, in _process_class
    raise TypeError('cannot inherit frozen dataclass from a '
TypeError: cannot inherit frozen dataclass from a non-frozen one

@guoguojenna
Copy link
Contributor

Hit this issue on 3.12 just now. No this issue yesterday.

  File "/usr/local/lib/python3.12/dataclasses.py", line 1265, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dataclasses.py", line 1029, in _process_class
    raise TypeError('cannot inherit frozen dataclass from a '
TypeError: cannot inherit frozen dataclass from a non-frozen one

@LecrisUT
Copy link
Contributor

This issue should be resolved now.

@psss
Copy link
Collaborator

psss commented Nov 19, 2024

Yes, #3347 was dropped as it is no more needed.

@psss psss closed this as completed Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging Changes related to the rpm packaging
Projects
None yet
Development

No branches or pull requests

6 participants