From e887eca2ff3b1a55f9db58cdf247e43d8486f170 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 4 Oct 2024 01:35:58 +0900 Subject: [PATCH] Remove Python 3.8 support Python 3.8 is no longer be part of tested runtimes since 2024.2 and is reaching its EOL soon. Bump the minimum supported python version to clean up the logic for Python 3.8 compatibility. Also declare Python 3.12 support because now it's part of the tested runtimes. Change-Id: Iec518ada66b5891a50834b574a5ccbe0965e3933 --- releasenotes/notes/remove-py38-6eebcd268c6f8e37.yaml | 5 +++++ requirements.txt | 1 - setup.cfg | 4 ++-- sushy/main.py | 9 +-------- sushy/resources/base.py | 8 +------- 5 files changed, 9 insertions(+), 18 deletions(-) create mode 100644 releasenotes/notes/remove-py38-6eebcd268c6f8e37.yaml diff --git a/releasenotes/notes/remove-py38-6eebcd268c6f8e37.yaml b/releasenotes/notes/remove-py38-6eebcd268c6f8e37.yaml new file mode 100644 index 00000000..04031636 --- /dev/null +++ b/releasenotes/notes/remove-py38-6eebcd268c6f8e37.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + Support for Python 3.8 has been removed. Now the minimum python version + supported is 3.9 . diff --git a/requirements.txt b/requirements.txt index cabb2922..9f2e385e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,4 +10,3 @@ pbr!=2.1.0,>=2.0.0 # Apache-2.0 requests>=2.14.2 # Apache-2.0 python-dateutil>=2.7.0 # BSD stevedore>=1.29.0 # Apache-2.0 -importlib_resources>=1.3; python_version<'3.9' # Apache-2.0 diff --git a/setup.cfg b/setup.cfg index 7de8f402..a05e902a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,7 +6,7 @@ description_file = author = OpenStack author_email = openstack-discuss@lists.openstack.org home_page = https://docs.openstack.org/sushy/latest/ -python_requires = >=3.8 +python_requires = >=3.9 classifier = Environment :: OpenStack Intended Audience :: Information Technology @@ -17,10 +17,10 @@ classifier = Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 [files] packages = diff --git a/sushy/main.py b/sushy/main.py index a4d5ba4d..249a9a96 100644 --- a/sushy/main.py +++ b/sushy/main.py @@ -13,17 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. import collections +from importlib import resources import logging import os -try: - from importlib import resources - - if not hasattr(resources, "files"): - import importlib_resources as resources -except ImportError: - import importlib_resources as resources - import requests from sushy import auth as sushy_auth diff --git a/sushy/resources/base.py b/sushy/resources/base.py index 1d299233..52a5c131 100644 --- a/sushy/resources/base.py +++ b/sushy/resources/base.py @@ -17,18 +17,12 @@ import abc import collections import copy import enum +from importlib import resources import io import json import logging import zipfile -try: - from importlib import resources - if not hasattr(resources, 'files'): - import importlib_resources as resources -except ImportError: - import importlib_resources as resources - from sushy import exceptions from sushy.resources import constants from sushy.resources import oem