Refactor: Update to using configparser 06/72506/3
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Mon, 8 Jan 2024 21:08:21 +0000 (13:08 -0800)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Mon, 8 Jan 2024 21:27:15 +0000 (13:27 -0800)
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 <agrimberg@linuxfoundation.org>
lftools/jenkins/__init__.py
releasenotes/notes/remove_six-b89d618c51c3021a.yaml [new file with mode: 0644]

index 4ae4a78..6930c57 100644 (file)
@@ -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 (file)
index 0000000..4fad7af
--- /dev/null
@@ -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.