Skip to content

Use modern distro API for platform info #15954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

emmanuel-ferdman
Copy link

@emmanuel-ferdman emmanuel-ferdman commented Apr 19, 2025

SUMMARY

This small PR fixes the deprecation warnings coming from distro that can also be seen in the CI logs:

awx/main/tests/functional/analytics/test_core.py::test_gather
  /awx_devel/awx/main/analytics/collectors.py:145: DeprecationWarning: distro.linux_distribution() is deprecated. It should only be used as a compatibility shim with Python's platform.linux_distribution(). Please use distro.id(), distro.version() and distro.name() instead.
    'dist': distro.linux_distribution(),

See the following example in Python3.13:

>>> import distro
>>> distro.linux_distribution()
<python-input-1>:1: DeprecationWarning: distro.linux_distribution() is deprecated. It should only be used as a compatibility shim with Python's platform.linux_distribution(). Please use distro.id(), distro.version() and distro.name() instead.
('Debian GNU/Linux', '12', 'bookworm')
>>> (distro.name(), distro.version(), distro.codename())
('Debian GNU/Linux', '12', 'bookworm')
ISSUE TYPE
  • Bug
COMPONENT NAME
  • Collection
AWX VERSION

ADDITIONAL INFORMATION

Copy link

codecov bot commented Apr 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.30%. Comparing base (db6e8b9) to head (200a4a2).

✅ All tests successful. No failed tests found.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant