actions / setup-python

Set up your GitHub Actions workflow with a specific version of Python
MIT License
1.59k stars 505 forks source link

3.10.14-9004012336/python-3.10.14-linux-22.04-x64.tar.gz issue #867

Open avy-dunamu opened 1 month ago

avy-dunamu commented 1 month ago

Description: There were no issues when using the python setup action for this version "https://github.com/actions/python-versions/releases/download/3.10.14-8361245787/python-3.10.14-linux-22.04-x64.tar.gz", but after switching to this version "https://github.com/actions/python-versions/releases/download/3.10.14-9004012336/python-3.10.14-linux-22.04-x64.tar.gz", the following error is occurring: "ModuleNotFoundError: No module named 'six'"

Action version: 3.10.14-9004012336/python-3.10.14-linux-22.04-x64.tar.gz

Platform:

Runner type:

Tools version:

3.10

      - name: Set up Python 3.10
        uses: actions/setup-python@v5
        with:
          python-version: '3.10'

Repro steps:

      - name: Run tests
        run: python -m pytest --junitxml=pytest.xml --cov-report=xml:coverage.xml --cov-report=term-missing --cov=. tests/

Expected behavior: pass the test Actual behavior: fail the test with below error

Run python -m pytest --junitxml=pytest.xml --cov-report=xml:coverage.xml --cov-report=term-missing --cov=. tests/
/home/runner/.local/lib/python3.10/site-packages/_pytest/config/__init__.py:331: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
ModuleNotFoundError: No module named 'six'
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/runner/.local/lib/python3.10/site-packages/pytest/__main__.py", line 5, in <module>
    raise SystemExit(pytest.console_main())
  File "/home/runner/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 192, in console_main
    code = main()
  File "/home/runner/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 150, in main
    config = _prepareconfig(args, plugins)
  File "/home/runner/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 331, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
  File "/home/runner/.local/lib/python3.10/site-packages/pluggy/_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  File "/home/runner/.local/lib/python3.10/site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/home/runner/.local/lib/python3.10/site-packages/pluggy/_callers.py", line 156, in _multicall
    teardown[0].send(outcome)
  File "/home/runner/.local/lib/python3.10/site-packages/_pytest/helpconfig.py", line 104, in pytest_cmdline_parse
    config: Config = outcome.get_result()
  File "/home/runner/.local/lib/python3.10/site-packages/pluggy/_result.py", line 100, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/home/runner/.local/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
  File "/home/runner/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1075, in pytest_cmdline_parse
    self.parse(args)
  File "/home/runner/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1425, in parse
    self._preparse(args, addopts=addopts)
  File "/home/runner/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1305, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/home/runner/.local/lib/python3.10/site-packages/pluggy/_manager.py", line 421, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "/home/runner/.local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 186, in exec_module
    exec(co, module.__dict__)
  File "/home/runner/.local/lib/python3.10/site-packages/ddtrace/__init__.py", line 22, in <module>
    from .settings import _config as config
  File "/home/runner/.local/lib/python3.10/site-packages/ddtrace/internal/module.py", line 224, in _exec_module
    self.loader.exec_module(module)
  File "/home/runner/.local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 186, in exec_module
    exec(co, module.__dict__)
  File "/home/runner/.local/lib/python3.10/site-packages/ddtrace/settings/__init__.py", line 2, in <module>
    from .config import Config
  File "/home/runner/.local/lib/python3.10/site-packages/ddtrace/internal/module.py", line 224, in _exec_module
    self.loader.exec_module(module)
  File "/home/runner/.local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 186, in exec_module
    exec(co, module.__dict__)
  File "/home/runner/.local/lib/python3.10/site-packages/ddtrace/settings/config.py", line 18, in <module>
    from ddtrace.vendor.debtcollector import deprecate
  File "/home/runner/.local/lib/python3.10/site-packages/ddtrace/internal/module.py", line 224, in _exec_module
    self.loader.exec_module(module)
  File "/home/runner/.local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 186, in exec_module
    exec(co, module.__dict__)
  File "/home/runner/.local/lib/python3.10/site-packages/ddtrace/vendor/debtcollector/__init__.py", line 15, in <module>
    from . import _utils, moves, removals, renames, updating
  File "/home/runner/.local/lib/python3.10/site-packages/ddtrace/internal/module.py", line 224, in _exec_module
    self.loader.exec_module(module)
  File "/home/runner/.local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 186, in exec_module
    exec(co, module.__dict__)
  File "/home/runner/.local/lib/python3.10/site-packages/ddtrace/vendor/debtcollector/_utils.py", line 22, in <module>
    import six
ModuleNotFoundError: No module named 'six'
aparnajyothi-y commented 1 month ago

Hello @avy-dunamu, Thank you for creating this issue and we will look into it :)

priyagupta108 commented 3 weeks ago

Hello @avy-dunamu👋, From the error message, it seems like the 'six' Python module is not being found during the test run. There could be a couple of reasons for this:

  1. The 'six' module is not installed in your Python environment.
  2. The Python environment where your tests are running might not be the same as the environment where 'six' is installed.

Here are a few things you can try:

Please review these aspects on your self-hosted runner. If the issue persists, could you please provide a link to a minimal repository that reproduces the problem? A specific example would greatly assist us in investigating this issue more effectively.
Looking forward to your response :)

avy-dunamu commented 1 week ago
스크린샷 2024-06-20 오전 11 29 32

@priyagupta108, thank you for your kind reply! I already tried installing 'six' before running the test, but the error occurred again. The issue seems to be with the 'ddtrace' library, which I need to use.

스크린샷 2024-06-20 오후 1 03 09

Interestingly, the same workflow succeeded in a Python 3.11 environment It also worked in a previous 3.10 environment, so I believe something might be broken in the 3.10.14-9004012336 version of Python.

priyagupta108 commented 23 hours ago

@avy-dunamu👋, Thank you for your response. I've tried to reproduce the issue but was unsuccessful. Everything appears to be functioning as expected with the new Python 3.10.14 package. As you've mentioned that the issue seems to be with the ddtrace library, it's possible that the problem lies within the ddtrace package. It appears to be trying to import 'six', which might be causing the problem. I would suggest trying to install/upgrade the ddtrace package, as this could potentially resolve the problem.

I hope this helps! If you continue to encounter issue, could you kindly share a link to a minimal repository that replicates the problem?