Skip to content

Adjust the awx-manage script to make use of importlib#15015

Merged
TheRealHaoLiu merged 2 commits into
ansible:develfrom
jbradberry:pkgresources-deprecation-fix
Apr 2, 2024
Merged

Adjust the awx-manage script to make use of importlib#15015
TheRealHaoLiu merged 2 commits into
ansible:develfrom
jbradberry:pkgresources-deprecation-fix

Conversation

@jbradberry

@jbradberry jbradberry commented Mar 20, 2024

Copy link
Copy Markdown
Contributor
SUMMARY

removing the deprecation warning.

pkg_resources is now deprecated, so it has been throwing a DeprecationWarning since we've upgraded to Python 3.11. It's recommended to use importlib instead, which has a couple of functions in importlib.metadata that could be used for this purpose (distribution or entry_points).

The annoying part of this PR was discovering that .egg-link files were not a standardized part of Python, and were only supported by setuptools. .pth files seem to work, though, so I've changed the editable dev environment reference to make use of that instead.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API

@jbradberry jbradberry self-assigned this Mar 20, 2024
@jbradberry jbradberry requested a review from AlanCoding April 1, 2024 16:37
No longer need to rebuild docker-compose devel image to load change for `tools/docker-compose/awx-manage` in development environment

@TheRealHaoLiu TheRealHaoLiu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested, worked like a charm. Added some change so that change to tools/docker-compose/awx-manage no longer require image rebuild

@TheRealHaoLiu TheRealHaoLiu merged commit 3edaaeb into ansible:devel Apr 2, 2024
@jbradberry jbradberry deleted the pkgresources-deprecation-fix branch June 12, 2024 16:03
djyasin pushed a commit to djyasin/awx that referenced this pull request Sep 16, 2024
* Adjust the awx-manage script to make use of importlib

removing the deprecation warning.

* Synlink awx-manage in docker-compose

No longer need to rebuild docker-compose devel image to load change for `tools/docker-compose/awx-manage` in development environment

---------

Co-authored-by: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com>
djyasin pushed a commit to djyasin/awx that referenced this pull request Nov 11, 2024
* Adjust the awx-manage script to make use of importlib

removing the deprecation warning.

* Synlink awx-manage in docker-compose

No longer need to rebuild docker-compose devel image to load change for `tools/docker-compose/awx-manage` in development environment

---------

Co-authored-by: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com>
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 this pull request may close these issues.

2 participants