From 64d5714a15815a607df9a23d25501ec222416d6b Mon Sep 17 00:00:00 2001 From: Andrew Grimberg Date: Mon, 8 Jan 2024 13:08:21 -0800 Subject: [PATCH] Refactor: Update to using configparser Since we've effectively dropped Python2 support there is no reason to keep using six for backwards compatibility. This is the first of many small changes to remove six from use. This one is first as newer mypy seems to be having issues with the configparser transition! Issue: RELENG-5063 Change-Id: If9cd83933d0cd6e0b7ac69afaa1bb94a9dab8202 Signed-off-by: Andrew Grimberg --- lftools/jenkins/__init__.py | 4 ++-- releasenotes/notes/remove_six-b89d618c51c3021a.yaml | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/remove_six-b89d618c51c3021a.yaml diff --git a/lftools/jenkins/__init__.py b/lftools/jenkins/__init__.py index 4ae4a784..6930c573 100644 --- a/lftools/jenkins/__init__.py +++ b/lftools/jenkins/__init__.py @@ -12,12 +12,12 @@ from __future__ import annotations __author__ = "Thanh Ha" +import configparser import logging import os from typing import Optional import jenkins -from six.moves import configparser log: logging.Logger = logging.getLogger(__name__) @@ -56,7 +56,7 @@ class Jenkins: if "://" not in server: if self.config_file: log.debug("Using config from {}".format(self.config_file)) - config: configparser.SafeConfigParser = configparser.SafeConfigParser() + config: configparser.ConfigParser = configparser.ConfigParser() config.read(self.config_file) if config.has_section(server): user = config.get(server, "user") diff --git a/releasenotes/notes/remove_six-b89d618c51c3021a.yaml b/releasenotes/notes/remove_six-b89d618c51c3021a.yaml new file mode 100644 index 00000000..4fad7af3 --- /dev/null +++ b/releasenotes/notes/remove_six-b89d618c51c3021a.yaml @@ -0,0 +1,7 @@ +--- +deprecations: + - | + The six module is being phased out of use as Python 2 support has been + dropped. This release is the first in which one (or more) transitions have + happened. There should be no issues related to this transition but bugs may + creep in. -- 2.16.6