update distro version to 1.9.0 (#83540)

pull/83578/head
Dhanesh R 5 months ago committed by GitHub
parent 4f6a4534a7
commit 9472005dee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
bugfixes:
- disro package - update the distro package version from 1.8.0 to 1.9.0 (https://github.com/ansible/ansible/issues/82935)

@ -22,7 +22,7 @@ Compat distro library.
from __future__ import annotations from __future__ import annotations
# The following makes it easier for us to script updates of the bundled code # The following makes it easier for us to script updates of the bundled code
_BUNDLED_METADATA = {"pypi_name": "distro", "version": "1.8.0"} _BUNDLED_METADATA = {"pypi_name": "distro", "version": "1.9.0"}
# The following additional changes have been made: # The following additional changes have been made:
# * Remove optparse since it is not needed for our use. # * Remove optparse since it is not needed for our use.

@ -1,4 +1,4 @@
# Copyright 2015,2016,2017 Nir Cohen # Copyright 2015-2021 Nir Cohen
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -59,7 +59,7 @@ except ImportError:
# Python 3.7 # Python 3.7
TypedDict = dict TypedDict = dict
__version__ = "1.8.0" __version__ = "1.9.0"
class VersionDict(TypedDict): class VersionDict(TypedDict):
@ -129,6 +129,7 @@ _DISTRO_RELEASE_BASENAME_PATTERN = re.compile(r"(\w+)[-_](release|version)$")
# Base file names to be looked up for if _UNIXCONFDIR is not readable. # Base file names to be looked up for if _UNIXCONFDIR is not readable.
_DISTRO_RELEASE_BASENAMES = [ _DISTRO_RELEASE_BASENAMES = [
"SuSE-release", "SuSE-release",
"altlinux-release",
"arch-release", "arch-release",
"base-release", "base-release",
"centos-release", "centos-release",
@ -155,6 +156,8 @@ _DISTRO_RELEASE_IGNORE_BASENAMES = (
"system-release", "system-release",
"plesk-release", "plesk-release",
"iredmail-release", "iredmail-release",
"board-release",
"ec2_version",
) )
@ -247,6 +250,7 @@ def id() -> str:
"rocky" Rocky Linux "rocky" Rocky Linux
"aix" AIX "aix" AIX
"guix" Guix System "guix" Guix System
"altlinux" ALT Linux
============== ========================================= ============== =========================================
If you have a need to get distros for reliable IDs added into this set, If you have a need to get distros for reliable IDs added into this set,
@ -995,10 +999,10 @@ class LinuxDistribution:
For details, see :func:`distro.info`. For details, see :func:`distro.info`.
""" """
return dict( return InfoDict(
id=self.id(), id=self.id(),
version=self.version(pretty, best), version=self.version(pretty, best),
version_parts=dict( version_parts=VersionDict(
major=self.major_version(best), major=self.major_version(best),
minor=self.minor_version(best), minor=self.minor_version(best),
build_number=self.build_number(best), build_number=self.build_number(best),

Loading…
Cancel
Save