From the README
>>> import distro
>>> distro.linux_distribution(full_distribution_name=False)
('centos', '7.1.1503', 'Core')
Actual behavior
>>> import distro
>>> distro.linux_distribution(full_distribution_name=False)
('centos', '7', 'Core')
The same goes for CentOS 8:
>>> import distro
>>> distro.linux_distribution(full_distribution_name=False)
('centos', '8', 'Core')
Possible solutions
- Use
best=True when getting the version in linux_distribution()
- Add a
best_version argument to linux_distribution() to allow this to be passed through.
I do think that adding a best_version argument would be a good idea. However, I'm not sure defaulting to best=True helps, since it adds the maintenance releases to Ubuntu LTS releases.
So, perhaps this current behavior is best, since it makes the behavior of linux_distribution more congruent with other Linux distros. If that is indeed the position of the project maintainers, and no changes need to be made to the code, I can open a PR to update the README.
From the README
Actual behavior
The same goes for CentOS 8:
Possible solutions
best=Truewhen getting the version inlinux_distribution()best_versionargument tolinux_distribution()to allow this to be passed through.I do think that adding a
best_versionargument would be a good idea. However, I'm not sure defaulting tobest=Truehelps, since it adds the maintenance releases to Ubuntu LTS releases.So, perhaps this current behavior is best, since it makes the behavior of
linux_distributionmore congruent with other Linux distros. If that is indeed the position of the project maintainers, and no changes need to be made to the code, I can open a PR to update the README.