From 69e21be288f53f641a964dd9c3cbc5b5b7657fd2 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 21 Dec 2023 13:09:29 +0000 Subject: [PATCH] Remove six Change-Id: I1d6e583f41f95be7c2af232a2f22ee20fa83c4be Signed-off-by: Stephen Finucane --- detail.py | 4 ++-- openstack_requirements/cmds/update.py | 5 ++--- openstack_requirements/project.py | 3 +-- openstack_requirements/tests/test_update.py | 8 ++++---- requirements.txt | 4 ---- tools/check-install.py | 3 +-- tools/what-broke.py | 2 +- 7 files changed, 11 insertions(+), 18 deletions(-) diff --git a/detail.py b/detail.py index 8a468c57a5..b48d4c44fd 100644 --- a/detail.py +++ b/detail.py @@ -15,10 +15,10 @@ import contextlib import json import os -import six.moves.urllib.parse as urlparse -import six.moves.urllib.request as urlreq import sys import traceback +import urllib.parse as urlparse +import urllib.request as urlreq import pkg_resources diff --git a/openstack_requirements/cmds/update.py b/openstack_requirements/cmds/update.py index e78848b7a2..5602c207d8 100644 --- a/openstack_requirements/cmds/update.py +++ b/openstack_requirements/cmds/update.py @@ -26,13 +26,12 @@ updated to match the global requirements. Requirements not in the global files will be dropped. """ +import itertools import optparse import os import os.path import sys -import six - from openstack_requirements import project from openstack_requirements import requirement @@ -129,7 +128,7 @@ def _sync_requirements_file( reference = source_reqs.get(req.package.lower()) if reference: actual = dest_reqs.get(req.package.lower()) - for req, ref in six.moves.zip_longest(actual, reference): + for req, ref in itertools.zip_longest(actual, reference): if not req: # More in globals changes.append(Change(ref[0].package, '', ref[1])) diff --git a/openstack_requirements/project.py b/openstack_requirements/project.py index f49dd32e42..f3ac9f5104 100644 --- a/openstack_requirements/project.py +++ b/openstack_requirements/project.py @@ -16,12 +16,11 @@ """The project abstraction.""" import collections +import configparser import errno import io import os -from six.moves import configparser - from parsley import makeGrammar from openstack_requirements import requirement diff --git a/openstack_requirements/tests/test_update.py b/openstack_requirements/tests/test_update.py index b3e95a9e1c..d9dc075437 100644 --- a/openstack_requirements/tests/test_update.py +++ b/openstack_requirements/tests/test_update.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -import six +import io import sys import textwrap from unittest import mock @@ -40,7 +40,7 @@ class SmokeTest(testtools.TestCase): self.assertIn("jsonschema!=1.4.0,<2,>=1.0.0", global_reqs) # And test the end to end call of update.py, UI and all. self.project = self.useFixture(common.project_fixture) - capture = six.StringIO() + capture = io.StringIO() update.main(['--source', global_env.root, self.project.root], capture) reqs = common._file_to_list(self.project.req_file) # ensure various updates take @@ -155,7 +155,7 @@ class UpdateTest(testtools.TestCase): actions = update._process_project( common.project_project, common.global_reqs, None, None, None, False) - capture = six.StringIO() + capture = io.StringIO() project.write( common.project_project, actions, capture, False, True) expected = ('Version change for: greenlet, SQLAlchemy, eventlet, PasteDeploy, routes, WebOb, wsgiref, boto, kombu, python-swiftclient, lxml, jsonschema, python-keystoneclient\n' # noqa @@ -186,7 +186,7 @@ Updated %(project)s/test-requirements.txt: actions = update._process_project( common.project_project, common.global_reqs, None, None, None, False) - capture = six.StringIO() + capture = io.StringIO() project.write( common.project_project, actions, capture, True, True) expected = ("""Syncing %(project)s/requirements.txt diff --git a/requirements.txt b/requirements.txt index 09646c7da7..f6adfbf0e5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,5 @@ -# The order of packages is significant, because pip processes them in the order -# of appearance. Changing the order has an impact on the overall integration -# process, which may cause wedges in the gate later. fixtures>=3.0.0 # Apache-2.0/BSD Parsley>=1.2 # MIT -six>=1.10.0 # MIT packaging!=20.5,!=20.6,!=20.7,>=16.5 # Apache-2.0 requests>=2.14.2 # Apache-2.0 PyYAML>=3.12 # MIT diff --git a/tools/check-install.py b/tools/check-install.py index ad29b7b8fb..1ecf4e19b9 100644 --- a/tools/check-install.py +++ b/tools/check-install.py @@ -1,11 +1,10 @@ #!/usr/bin/env python +import configparser import importlib import re import sys -import six.moves.configparser as configparser - def main(): errors = 0 diff --git a/tools/what-broke.py b/tools/what-broke.py index 32f94b0ae8..01194341f5 100755 --- a/tools/what-broke.py +++ b/tools/what-broke.py @@ -35,8 +35,8 @@ checked. import argparse import datetime import json -import six.moves.urllib.request as urlreq import sys +import urllib.request as urlreq import pkg_resources