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

Error using python=3.11 in tests GitHub action #58

Closed
northwestwitch opened this issue Dec 6, 2023 · 1 comment · Fixed by #59
Closed

Error using python=3.11 in tests GitHub action #58

northwestwitch opened this issue Dec 6, 2023 · 1 comment · Fixed by #59

Comments

@northwestwitch
Copy link
Member

northwestwitch commented Dec 6, 2023

If we set the python version to 3.11 this error occurs. It has to do with the version of Pytest installed when testing I think

Run poetry run pytest
  poetry run pytest
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.11.6/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.6/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.6/x64
    Python[2](https://github.com/Clinical-Genomics/schug/actions/runs/7111214244/job/19358917707#step:6:2)_ROOT_DIR: /opt/hostedtoolcache/Python/[3](https://github.com/Clinical-Genomics/schug/actions/runs/7111214244/job/19358917707#step:6:3).11.6/x6[4](https://github.com/Clinical-Genomics/schug/actions/runs/7111214244/job/19358917707#step:6:4)
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.6/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.6/x64/lib
Traceback (most recent call last):
  File "/home/runner/.cache/pypoetry/virtualenvs/schug-iJzzcRP2-py3.11/bin/pytest", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/runner/.cache/pypoetry/virtualenvs/schug-iJzzcRP2-py3.11/lib/python3.11/site-packages/_pytest/config/__init__.py", line 10[5](https://github.com/Clinical-Genomics/schug/actions/runs/7111214244/job/19358917707#step:6:5), in main
    config = _prepareconfig(args, plugins)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pypoetry/virtualenvs/schug-iJzzcRP2-py3.11/lib/python3.11/site-packages/_pytest/config/__init__.py", line 257, in _prepareconfig
    return pluginmanager.hook.pytest_cmdline_parse(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pypoetry/virtualenvs/schug-iJzzcRP2-py3.11/lib/python3.11/site-packages/pluggy/hooks.py", line 28[6](https://github.com/Clinical-Genomics/schug/actions/runs/7111214244/job/19358917707#step:6:6), in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pypoetry/virtualenvs/schug-iJzzcRP2-py3.11/lib/python3.11/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pypoetry/virtualenvs/schug-iJzzcRP2-py3.11/lib/python3.11/site-packages/pluggy/manager.py", line 84, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
                                                         ^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pypoetry/virtualenvs/schug-iJzzcRP2-py3.11/lib/python3.11/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/home/runner/.cache/pypoetry/virtualenvs/schug-iJzzcRP2-py3.11/lib/python3.11/site-packages/_pytest/helpconfig.py", line 90, in pytest_cmdline_parse
    config = outcome.get_result()
             ^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pypoetry/virtualenvs/schug-iJzzcRP2-py3.11/lib/python3.11/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/runner/.cache/pypoetry/virtualenvs/schug-iJzzcRP2-py3.11/lib/python3.11/site-packages/pluggy/callers.py", line 18[7](https://github.com/Clinical-Genomics/schug/actions/runs/7111214244/job/19358917707#step:6:7), in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pypoetry/virtualenvs/schug-iJzzcRP2-py3.11/lib/python3.11/site-packages/_pytest/config/__init__.py", line [8](https://github.com/Clinical-Genomics/schug/actions/runs/7111214244/job/19358917707#step:6:8)36, in pytest_cmdline_parse
    self.parse(args)
  File "/home/runner/.cache/pypoetry/virtualenvs/schug-iJzzcRP2-py3.11/lib/python3.11/site-packages/_pytest/config/__init__.py", line 1044, in parse
    self._preparse(args, addopts=addopts)
  File "/home/runner/.cache/pypoetry/virtualenvs/schug-iJzzcRP2-py3.11/lib/python3.11/site-packages/_pytest/config/__init__.py", line [9](https://github.com/Clinical-Genomics/schug/actions/runs/7111214244/job/19358917707#step:6:9)92, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest[11](https://github.com/Clinical-Genomics/schug/actions/runs/7111214244/job/19358917707#step:6:12)")
  File "/home/runner/.cache/pypoetry/virtualenvs/schug-iJzzcRP2-py3.11/lib/python3.11/site-packages/pluggy/manager.py", line 299, in load_setuptools_entrypoints
    plugin = ep.load()
             ^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/importlib/__init__.py", line [12](https://github.com/Clinical-Genomics/schug/actions/runs/7111214244/job/19358917707#step:6:13)6, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1[14](https://github.com/Clinical-Genomics/schug/actions/runs/7111214244/job/19358917707#step:6:15)7, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "/home/runner/.cache/pypoetry/virtualenvs/schug-iJzzcRP2-py3.11/lib/python3.11/site-packages/_pytest/assertion/rewrite.py", line 143, in exec_module
    source_stat, co = _rewrite_test(fn, self.config)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pypoetry/virtualenvs/schug-iJzzcRP2-py3.11/lib/python3.11/site-packages/_pytest/assertion/rewrite.py", line 3[30](https://github.com/Clinical-Genomics/schug/actions/runs/7111214244/job/19358917707#step:6:31), in _rewrite_test
    co = compile(tree, fn, "exec", dont_inherit=True)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: required field "lineno" missing from alias
Error: Process completed with exit code 1.
@northwestwitch
Copy link
Member Author

It's this error: pytest-dev/pytest#8539 Should be fixable by upgrading the version of pytest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant