teemtee / tmt

Test Management Tool
MIT License
83 stars 124 forks source link

tmt does not install well on Fedora 41 #3168

Open happz opened 2 months ago

happz commented 2 months ago

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.
martinhoyer commented 2 months ago

Pint:
https://github.com/hgrecco/pint/pull/2037 https://github.com/hgrecco/pint/issues/1969

martinhoyer commented 2 months ago

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

martinhoyer commented 2 months ago

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 commented 2 weeks ago

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 commented 1 week ago

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.