Closed nateprewitt closed 1 week ago
Good call out, it looks like there's actually a bunch of usage in the test directory. The grep expression I was using missed a number of these, I've updated it and will get those pushed up.
Nevermind, I see what was happened. This is only one of the two commits, they were split up to ensure tests still pass with the changes and not removing six from the test infrastructure. Should be good now.
This PR removes usage of six in the CLI v1 codebase and minimizes its presence to one import from Botocore. This is left in place for backwards compatibility but is considered deprecated and may be removed in a future version. Downstream distributors may choose to patch out this single import to remove the requirement on keeping
six
in their ecosystem.The primary changes here are in three classes:
six.*_type(s)
, six maintains references to things likebytes
,str
,basestr
,unicode
depending on the Python version being used. We're removing this for the direct call to eitherstr
forsix.text_type
orbytes
forsix.binary_type
. This also applies tosix.integer_types
andsix.string_types
which are used for type checking.six.moves.*
, these changes are placeholders that map between changed references to the same class. This was to account for modules that got renamed in Python 3. These are no longer needed so they've been moved to their Python 3 equivalent, you can find the full mapping table here.six.b() six.u(), six.BytesIO(), six.StringIO()
, these are used for bringing StringIO/BytesIO back to Python 2 and dealing with the differences of bytes/unicode between the two major versions. StringIO and BytesIO are already present in the standard libraryio
module, so we no longer needsix
for these. Forsix.b
andsix.u
, these are just syntax sugar aroundvalue.encode('latin-1')
and a literal no-op forsix.u
in Python 3. There's some discussion to be had on whether this should really bevalue.encode('utf-8')
where we're usingsix.b
but I've left it exactly as it was withsix
to make sure we're not breaking anything.If you have more questions, you can read the full six docs here.