ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
13.5k stars 3.34k forks source link

Use absolute instead of relative imports #15154

Open wilfriedroset opened 2 weeks ago

wilfriedroset commented 2 weeks ago
SUMMARY

Although Ansible without mitogen works without this PR it is not possible to use it with Mitogen.

ISSUE TYPE

Without the fix Mitogen's users should expect the following error:

exception: "Traceback (most recent call last):\r\n  File \"/home/runner/.ansible/tmp/ansible_mitogen_runner_w8wene42/job_launch.py\", line 177, in <module>\r\n    from ..module_utils.controller_api import ControllerAPIModule\r\nImportError: attempted relative import with no known parent package\r\n"
COMPONENT NAME
AWX VERSION
awx: 24.3.1.dev11+g207ab32994
ADDITIONAL INFORMATION

This is similar to https://github.com/ansible-collections/amazon.aws/pull/809

AlanCoding commented 2 weeks ago

The problem is that this is re-packaged under another namespace.

wilfriedroset commented 2 weeks ago

Thank @AlanCoding for your feedbacks. Would you be able to point me in the right direction to adresse the repackaging issue?

fosterseth commented 3 days ago

awx.awx becomes ansible.controller on automation hub

wilfriedroset commented 3 days ago

Thank you for the hint @fosterseth. Now I'm confused because I believe thatawx.awx is the correct name when the collection is used by end users but after the repackaging it is named ansible.controller. So basically, if instead of doing absolute import with awx.awx I use ansible.controller the CI should be happy but what about the end users 🤔

Anyhow, I'm not familiar with the re-packaging and the CI of AWX. I will have to look at this closer maybe next week.