roots / trellis

WordPress LEMP stack with PHP 8.2, Composer, WP-CLI and more
https://roots.io/trellis/
MIT License
2.49k stars 608 forks source link

Can't install galaxy dependencies on Python 3.12 #1510

Closed codepuncher closed 8 months ago

codepuncher commented 10 months ago

Version

725402ec1c9c668fd8e74582ffa8c1569b28cf51

What did you expect to happen?

When running ansible-galaxy install -r galaxy.yml to successfully download dependencies

What actually happens?

It fails

Steps to reproduce

Use Python 3.12

I replicate via GitHub Actions: https://github.com/roots/trellis/blob/ff74ca205e235382ca7b8fdf2f84ed18a5bf9e8b/.github/workflows/ci.yml The current Matrix should produce the error if you re-run the action.

Python 3.11 works fine.

System info

Python 3.12 Ubuntu 22.04.3

Log output

$ ansible-galaxy install -r galaxy.yml
ERROR! Unexpected Exception, this is probably a bug: '_AnsiblePathHookFinder' object has no attribute 'find_spec'
the full traceback was:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.0/x64/bin/ansible-galaxy", line 9[7](https://github.com/ItinerisLtd/REDACTED-trellis/actions/runs/6931188465/job/18852399137?pr=12#step:6:8), in <module>
    mycli = getattr(__import__("ansible.cli.%s" % sub, fromlist=[myclass]), myclass)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/ansible/cli/__init__.py", line 21, in <module>
    from ansible.inventory.manager import InventoryManager
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/ansible/inventory/manager.py", line 39, in <module>
    from ansible.utils.helpers import deduplicate_list
  File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1316, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1256, in _find_spec
  File "<frozen importlib._bootstrap_external>", line 1524, in find_spec
  File "<frozen importlib._bootstrap_external>", line 149[8](https://github.com/ItinerisLtd/REDACTED-trellis/actions/runs/6931188465/job/18852399137?pr=12#step:6:9), in _get_spec
AttributeError: '_AnsiblePathHookFinder' object has no attribute 'find_spec'

Please confirm this isn't a support request.

Yes

swalkinshaw commented 9 months ago

CI seems to work fine on this repo with 3.12. Here's an example: https://github.com/roots/trellis/actions/runs/6884729320/job/18727758686

image

I can't find any other references to an error similar to this via searches either.