Skip to content
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

Supports debian_version file content for version(best=True) calls #333

Merged
merged 1 commit into from
Jun 6, 2022

Conversation

HorlogeSkynet
Copy link
Member

Dear @python-distro/maintainers,


From ansible/ansible#77928 and #332, it appeared that Debian >= 9 do not ship anymore the MINOR SemVer segment in lsb_release "distribution release" output.
This means that setting best=True cannot be used to retrieve it, and thus version(best=True) behaves differently across Debian < 10 and Debian >= 10.

This patch implements /etc/debian_version file parsing to workaround this issue, on "Debian-like" distributions.


Many thanks, bye 👋

From ansible/ansible#77928 and #332, it appeared that Debian >= 9 do not
ship anymore the `MINOR` SemVer segment in `lsb_release`
"distribution release" output.
This means that setting `best=True` cannot be used to retrieve it, and
thus behaves differently across Debian < 10 and Debian >= 10.

This patch implements `/etc/debian_version` file parsing to workaround
this issue, on "Debian-like" distributions.
Copy link
Contributor

@hartwork hartwork left a comment

Choose a reason for hiding this comment

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

Hi @HorlogeSkynet I like the general direction 👍, please see two comments on details below:

tests/test_distro.py Show resolved Hide resolved
src/distro/distro.py Show resolved Hide resolved
@HorlogeSkynet
Copy link
Member Author

Hi @HorlogeSkynet I like the general direction +1, please see two comments on details below:

Hey @hartwork ! Thanks for your quick feedback, see my replies to your comments 😉

tests/test_distro.py Show resolved Hide resolved
@HorlogeSkynet HorlogeSkynet merged commit 6d44662 into master Jun 6, 2022
@HorlogeSkynet HorlogeSkynet deleted the feat/debian_version branch June 6, 2022 09:57
HorlogeSkynet added a commit that referenced this pull request Oct 10, 2022
This patch is a follow-up for 6d44662 (#333), introducing caching of `/etc/debian_version` file content, to prevent opening and reading operations for each `distro.version()` call.
@hartwork hartwork added this to the 1.8.0 milestone Oct 10, 2022
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.

Minor version missing for Debian >= 10
2 participants