Skip to content

Conversation

@HorlogeSkynet
Copy link
Member

@HorlogeSkynet HorlogeSkynet commented Aug 22, 2024

(see #322 for context)

distro as well as LinuxDistribution uname_attr and uname_info public methods are based on _parse_uname_content function which purposely ignores release information part from uname -rs command output on Linux platforms. This makes it specially designed for distro internals, and shouldn't be publicly available as stable API.

We'll deprecate these methods in v1.10.0, in order to allow API removals in the future (e.g. distro v2).

@HorlogeSkynet
Copy link
Member Author

Up @python-distro/maintainers 🙏

@HorlogeSkynet HorlogeSkynet mentioned this pull request Oct 26, 2024
3 tasks
@HorlogeSkynet HorlogeSkynet force-pushed the deprecate/direct_uname_info branch from 1fec59b to 8eb720f Compare November 1, 2025 17:06
@HorlogeSkynet HorlogeSkynet force-pushed the deprecate/direct_uname_info branch from 8eb720f to 3859e22 Compare November 1, 2025 17:08
Copy link
Contributor

@adamjstewart adamjstewart left a comment

Choose a reason for hiding this comment

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

Not sure about whether or not we should deprecate these, as I don't think I've used them before.

As for how to deprecate, we should at least provide suggested replacements or migration strategies for people who were previously using these.

@HorlogeSkynet
Copy link
Member Author

Not sure about whether or not we should deprecate these, as I don't think I've used them before.

Yes, see #322 for full context. Long story short : these methods should have never been public in the first place as distro ignores actual data for internal uses.

As for how to deprecate, we should at least provide suggested replacements or migration strategies for people who were previously using these.

Indeed, os.uname ? platform.uname ?

@adamjstewart
Copy link
Contributor

Sounds good to me.

@HorlogeSkynet HorlogeSkynet force-pushed the deprecate/direct_uname_info branch from 3859e22 to 996fe9b Compare November 2, 2025 13:31
@HorlogeSkynet
Copy link
Member Author

Sounds good to me.

Thanks for your feedback !
Amended and added pytest configuration to ignore our own deprecation warnings not to pollute tests execution logs.

@HorlogeSkynet HorlogeSkynet force-pushed the deprecate/direct_uname_info branch from 996fe9b to 9daf557 Compare November 2, 2025 21:35
distro as well as LinuxDistribution `uname_attr` and `uname_info` public
methods are based on `_parse_uname_content` function which purposely
ignores release information part from `uname -rs` command output on
Linux platforms. This makes it specially designed for distro internals,
and shouldn't be publicly available as stable API.

We'll deprecate these methods in v1.10.0, in order to allow API removals
in the future (e.g. distro v2).

Developers are notified to rather use `os.uname` or `platform.uname` API
from Python standard library.

> closes #322
@HorlogeSkynet HorlogeSkynet force-pushed the deprecate/direct_uname_info branch from 9daf557 to 7f0c2f9 Compare November 2, 2025 21:37
Copy link
Contributor

@adamjstewart adamjstewart left a comment

Choose a reason for hiding this comment

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

Could also remove it from the documentation. I don't know much about these tools but trust you to make the decision of whether or not to deprecate. I'm just approving the implementation.

@HorlogeSkynet
Copy link
Member Author

Could also remove it from the documentation.

Let's not while they actually exist (mostly because one might use them on the v1 branch).

I don't know much about these tools but trust you to make the decision of whether or not to deprecate. I'm just approving the implementation.

Thanks ! These API are misleading users, as brought up by @braindevices in #322. I'm merging this to move on towards v1.10.

@HorlogeSkynet HorlogeSkynet merged commit d9ae439 into master Nov 8, 2025
20 checks passed
@HorlogeSkynet HorlogeSkynet deleted the deprecate/direct_uname_info branch November 8, 2025 19:47
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.

3 participants