diff --git a/lower-constraints.txt b/lower-constraints.txt index b883ff0..590c2fa 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -1,6 +1,5 @@ docutils==0.11 dulwich==0.15.0 PyYAML==3.10.0 -six==1.9.0 Sphinx==1.6.1 stestr==2.0.0 diff --git a/reno/_exts/show_reno_config.py b/reno/_exts/show_reno_config.py index 79dfa5f..c9d79af 100644 --- a/reno/_exts/show_reno_config.py +++ b/reno/_exts/show_reno_config.py @@ -13,7 +13,6 @@ from docutils import nodes from docutils.parsers import rst from docutils.statemachine import ViewList -import six from sphinx.util import logging from sphinx.util.nodes import nested_parse_with_titles @@ -37,7 +36,7 @@ def _format_option_help(options): for l in _multi_line_string(opt.help, ' '): yield l yield '' - if isinstance(opt.default, six.string_types) and '\n' in opt.default: + if isinstance(opt.default, str) and '\n' in opt.default: # Multi-line string yield ' Defaults to' yield '' diff --git a/reno/loader.py b/reno/loader.py index b0b2a03..ad571b2 100644 --- a/reno/loader.py +++ b/reno/loader.py @@ -14,7 +14,6 @@ import collections import logging import os.path -import six import yaml from reno import scanner @@ -107,7 +106,7 @@ class Loader(object): for section_name, section_content in content.items(): if section_name == self._config.prelude_section_name: - if not isinstance(section_content, six.string_types): + if not isinstance(section_content, str): LOG.warning( ('The %s section of %s ' 'does not parse as a single string. ' @@ -115,7 +114,7 @@ class Loader(object): (self._config.prelude_section_name, filename), ) else: - if isinstance(section_content, six.string_types): + if isinstance(section_content, str): # A single string is OK, but wrap it with a list # so the rest of the code can treat the data model # consistently. @@ -129,7 +128,7 @@ class Loader(object): ) else: for item in section_content: - if not isinstance(item, six.string_types): + if not isinstance(item, str): LOG.warning( ('The item %r in the %s section of %s ' 'parses as a %s instead of a string. ' diff --git a/reno/setup_command.py b/reno/setup_command.py index 102ab25..42fe909 100644 --- a/reno/setup_command.py +++ b/reno/setup_command.py @@ -24,7 +24,6 @@ from distutils import cmd from distutils import errors from distutils import log -import six from reno import cache from reno import config @@ -108,7 +107,7 @@ class BuildReno(cmd.Command): if val is None: setattr(self, option, default) return default - elif not isinstance(val, six.string_types): + elif not isinstance(val, str): raise errors.DistutilsOptionError("'%s' must be a %s (got `%s`)" % (option, what, val)) return val diff --git a/reno/tests/test_loader.py b/reno/tests/test_loader.py index 33b6d28..af78909 100644 --- a/reno/tests/test_loader.py +++ b/reno/tests/test_loader.py @@ -17,7 +17,6 @@ import textwrap import fixtures import mock -import six import yaml from reno import config @@ -73,7 +72,7 @@ class TestValidate(base.TestCase): This is a single string. ''')) print(type(note_bodies['issues'])) - self.assertIsInstance(note_bodies['issues'], six.string_types) + self.assertIsInstance(note_bodies['issues'], str) ldr = self._make_loader(note_bodies) parse_results = ldr.parse_note_file('note1', None) self.assertIsInstance(parse_results['issues'], list) diff --git a/reno/tests/test_utils.py b/reno/tests/test_utils.py index cb76cc7..8b4bc48 100644 --- a/reno/tests/test_utils.py +++ b/reno/tests/test_utils.py @@ -13,7 +13,6 @@ # under the License. import mock -import six from reno.tests import base from reno import utils @@ -28,7 +27,7 @@ class TestGetRandomString(base.TestCase): randrange.return_value = ord('a') actual = utils.get_random_string() expected = '61' * 8 # hex for ord('a') - self.assertIsInstance(actual, six.text_type) + self.assertIsInstance(actual, str) self.assertEqual(expected, actual) @mock.patch('random.randrange') @@ -38,5 +37,5 @@ class TestGetRandomString(base.TestCase): randrange.return_value = ord('a') actual = utils.get_random_string() expected = '62' * 8 # hex for ord('b') - self.assertIsInstance(actual, six.text_type) + self.assertIsInstance(actual, str) self.assertEqual(expected, actual) diff --git a/reno/utils.py b/reno/utils.py index 88cd098..12aa327 100644 --- a/reno/utils.py +++ b/reno/utils.py @@ -23,11 +23,11 @@ LOG = logging.getLogger(__name__) def get_random_string(nbytes=8): """Return a fixed-length random string - :rtype: six.text_type + :rtype: str """ try: # NOTE(dhellmann): Not all systems support urandom(). - # hexlify returns six.binary_type, decode to convert to six.text_type. + # hexlify returns binary, decode to convert to str. val = binascii.hexlify(os.urandom(nbytes)).decode('utf-8') except Exception as e: print('ERROR, perhaps urandom is not supported: %s' % e) diff --git a/requirements.txt b/requirements.txt index 079e796..b97c1c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,4 @@ pbr PyYAML>=3.10 -six>=1.9.0 dulwich>=0.15.0 # Apache-2.0