Skip to content

Drop six dependency#129

Open
m-aciek wants to merge 4 commits into
transifex:develfrom
m-aciek:copilot/drop-usages-of-six
Open

Drop six dependency#129
m-aciek wants to merge 4 commits into
transifex:develfrom
m-aciek:copilot/drop-usages-of-six

Conversation

@m-aciek
Copy link
Copy Markdown
Contributor

@m-aciek m-aciek commented May 28, 2026

six is a Python 2/3 compatibility shim that's no longer needed in a Python 3-only codebase. Closes #121.

Changes

  • apis.py: Replace six.with_metaclass(_JsonApiMetaclass, object) with native Python 3 metaclass syntax; drop from __future__ compat imports
  • utils.py: Replace six.string_types with str; drop from __future__ compat imports; import abc from collections
# Before
class JsonApi(six.with_metaclass(_JsonApiMetaclass, object)):
    ...

def is_list(value):
    return isinstance(value, abc.Sequence) and not isinstance(value, six.string_types)

# After
class JsonApi(metaclass=_JsonApiMetaclass):
    ...

def is_list(value):
    return isinstance(value, abc.Sequence) and not isinstance(value, str)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ModuleNotFoundError: No module named 'six'

2 participants