Skip to content

Commit

Permalink
Remove six dependency in favor pip's vendored six
Browse files Browse the repository at this point in the history
Allows removing a dependency of pip-tools. The package is already
guaranteed to exist within pip, so might as well use it.

As more and more projects are dropping Python 2 support, they too are
dropping six as a dependency. As more projects drop six, this will
eventually remove the need for projects to pull in six as a transient
dependency.

When pip eventually drops Python 2 support, it will also drop six. When
that day comes, pip-tools can also drop Python 2 support, so the
eventual lack of six should not be an issue.
  • Loading branch information
jdufresne committed Nov 25, 2020
1 parent 521b48e commit a0c7653
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion piptools/_compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# flake8: noqa
from __future__ import absolute_import, division, print_function, unicode_literals

import six
from pip._vendor import six

from .pip_compat import PIP_VERSION, parse_requirements

Expand Down
2 changes: 1 addition & 1 deletion piptools/repositories/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from abc import ABCMeta, abstractmethod
from contextlib import contextmanager

from six import add_metaclass
from pip._vendor.six import add_metaclass


@add_metaclass(ABCMeta)
Expand Down
4 changes: 2 additions & 2 deletions piptools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
from collections import OrderedDict
from itertools import chain

import six
from click.utils import LazyFile
from pip._internal.req.constructors import install_req_from_line
from pip._internal.utils.misc import redact_auth_from_url
from pip._internal.vcs import is_url
from six.moves import shlex_quote
from pip._vendor import six
from pip._vendor.six.moves import shlex_quote

from .click import style

Expand Down
2 changes: 1 addition & 1 deletion piptools/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import re
from itertools import chain

import six
from pip._vendor import six

from .click import unstyle
from .logging import log
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ packages = find:
zip_safe = false
install_requires =
click >= 7
six
pip >= 20.1

[options.packages.find]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import os

import pytest
import six
from six.moves import shlex_quote
from pip._vendor import six
from pip._vendor.six.moves import shlex_quote

from piptools.scripts.compile import cli as compile_cli
from piptools.utils import (
Expand Down

0 comments on commit a0c7653

Please sign in to comment.