awx icon indicating copy to clipboard operation
awx copied to clipboard

Use absolute instead of relative imports

Open wilfriedroset opened this issue 9 months ago • 2 comments

SUMMARY

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

ISSUE TYPE
  • Bug, Docs Fix or other nominal change

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
  • Collection
AWX VERSION
awx: 24.3.1.dev11+g207ab32994
ADDITIONAL INFORMATION

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

wilfriedroset avatar Apr 29 '24 10:04 wilfriedroset

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

AlanCoding avatar May 03 '24 00:05 AlanCoding

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

wilfriedroset avatar May 03 '24 16:05 wilfriedroset

awx.awx becomes ansible.controller on automation hub

fosterseth avatar May 15 '24 19:05 fosterseth

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.

wilfriedroset avatar May 15 '24 19:05 wilfriedroset