Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove six library #7985

Merged
merged 3 commits into from
Jul 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion 3rdparty/python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,5 @@ responses==0.10.4
scandir==1.2
setproctitle==1.1.10
setuptools==40.6.3
six>=1.9.0,<2
wheel==0.31.1
www-authenticate==0.9.2
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ python_library(
sources=['node_preinstalled_module_resolver.py'],
dependencies=[
':node_resolver_base',
'3rdparty/python:six',
'src/python/pants/base:build_environment',
'src/python/pants/base:exceptions',
'src/python/pants/fs',
Expand Down
1 change: 0 additions & 1 deletion src/python/pants/backend/jvm/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ python_library(
sources=['ivy_utils.py'],
dependencies=[
'3rdparty/python/twitter/commons:twitter.common.collections',
'3rdparty/python:six',
':ivy_utils_resources',
'src/python/pants/backend/jvm/subsystems:jar_dependency_management',
'src/python/pants/backend/jvm/targets:jvm',
Expand Down
3 changes: 1 addition & 2 deletions src/python/pants/backend/jvm/ivy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from collections import OrderedDict, defaultdict, namedtuple
from functools import total_ordering

import six
from twitter.common.collections import OrderedSet

from pants.backend.jvm.subsystems.jar_dependency_management import (JarDependencyManagement,
Expand Down Expand Up @@ -848,7 +847,7 @@ def _hardlink_cachepath(cls, ivy_repository_cache_dir, inpath, hardlink_dir, out
hardlink_map[path] = path

# Create hardlinks for paths in the ivy cache dir.
for path, hardlink in six.iteritems(hardlink_map):
for path, hardlink in hardlink_map.items():
if path == hardlink:
# Skip paths that aren't going to be hardlinked.
continue
Expand Down
1 change: 0 additions & 1 deletion src/python/pants/backend/jvm/tasks/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ python_library(
dependencies = [
'3rdparty/python:future',
'3rdparty/python/twitter/commons:twitter.common.collections',
'3rdparty/python:six',
':classpath_util',
':nailgun_task',
'src/python/pants/backend/jvm:argfile',
Expand Down
3 changes: 1 addition & 2 deletions src/python/pants/backend/project_info/tasks/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import os
from collections import defaultdict

import six
from twitter.common.collections import OrderedSet

from pants.backend.jvm.subsystems.jvm_platform import JvmPlatform
Expand Down Expand Up @@ -336,7 +335,7 @@ def iter_transitive_jars(jar_lib):
default_interpreter = min(python_interpreter_targets_mapping.keys())

interpreters_info = {}
for interpreter, targets in six.iteritems(python_interpreter_targets_mapping):
for interpreter, targets in python_interpreter_targets_mapping.items():
req_libs = [target for target in Target.closure_for_targets(targets)
if has_python_requirements(target)]
chroot = self.resolve_requirements(interpreter, req_libs)
Expand Down
1 change: 0 additions & 1 deletion src/python/pants/base/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ python_library(
dependencies = [
'3rdparty/python:pathspec',
'3rdparty/python:scandir',
'3rdparty/python:six',
':build_environment',
'src/python/pants/util:dirutil',
'src/python/pants/util:memo',
Expand Down
1 change: 0 additions & 1 deletion src/python/pants/build_graph/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
python_library(
dependencies = [
'3rdparty/python/twitter/commons:twitter.common.collections',
'3rdparty/python:six',
'src/python/pants/base:build_environment',
'src/python/pants/base:build_file',
'src/python/pants/base:build_file_target_factory',
Expand Down
2 changes: 0 additions & 2 deletions src/python/pants/engine/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ python_library(
name='parser',
sources=['parser.py'],
dependencies=[
'3rdparty/python:six',
':addressable',
':objects',
'src/python/pants/build_graph',
Expand Down Expand Up @@ -164,7 +163,6 @@ python_library(
sources=['selectors.py'],
dependencies=[
'3rdparty/python:future',
'3rdparty/python:six',
'src/python/pants/util:objects',
]
)
Expand Down
1 change: 0 additions & 1 deletion src/python/pants/engine/legacy/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ python_library(
name='parser',
sources=['parser.py'],
dependencies=[
'3rdparty/python:six',
':structs',
'src/python/pants/base:build_file_target_factory',
'src/python/pants/base:parse_context',
Expand Down
3 changes: 1 addition & 2 deletions src/python/pants/goal/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
from collections import defaultdict

import six
from twitter.common.collections import OrderedSet

from pants.util.collections import factory_dict
Expand Down Expand Up @@ -333,7 +332,7 @@ def itermappings(self):

:API: public
"""
return six.iteritems(self.by_target)
return self.by_target.items()

def keys_for(self, basedir, product):
"""Returns the set of keys the given mapped product is registered under.
Expand Down
1 change: 0 additions & 1 deletion src/python/pants/java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ python_library(
name = 'nailgun_protocol',
sources = ['nailgun_protocol.py'],
dependencies = [
'3rdparty/python:six',
'src/python/pants/util:objects',
'src/python/pants/util:osutil',
]
Expand Down
1 change: 0 additions & 1 deletion src/python/pants/java/jar/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

python_library(
dependencies = [
'3rdparty/python:six',
'src/python/pants/base:build_environment',
'src/python/pants/base:hash_utils',
'src/python/pants/base:payload_field',
Expand Down
1 change: 0 additions & 1 deletion src/python/pants/net/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ python_library(
dependencies = [
'3rdparty/python:requests',
'3rdparty/python:pyopenssl',
'3rdparty/python:six',
'src/python/pants/util:dirutil',
],
)
5 changes: 2 additions & 3 deletions src/python/pants/net/http/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from contextlib import closing, contextmanager

import requests
import six

from pants.util.dirutil import safe_open
from pants.util.strutil import strip_prefix
Expand All @@ -38,7 +37,7 @@ class PermanentError(Error):

def __init__(self, value=None, response_code=None):
super(Fetcher.PermanentError, self).__init__(value)
if response_code and not isinstance(response_code, six.integer_types):
if response_code and not isinstance(response_code, int):
raise ValueError('response_code must be an integer, got {}'.format(response_code))
self._response_code = response_code

Expand Down Expand Up @@ -152,7 +151,7 @@ def __init__(self, width=None, chunk_size_bytes=None, stream=None):
:type stream: :class:`io.RawIOBase`
"""
self._width = width or 50
if not isinstance(self._width, six.integer_types):
if not isinstance(self._width, int):
raise ValueError('The width must be an integer, given {}'.format(self._width))
self._chunk_size_bytes = chunk_size_bytes or 10 * 1024
self._stream = stream or sys.stderr.buffer
Expand Down
6 changes: 0 additions & 6 deletions src/python/pants/util/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ python_library(
python_library(
name = 'rwbuf',
sources = ['rwbuf.py'],
dependencies = [
'3rdparty/python:six',
]
)

python_library(
Expand Down Expand Up @@ -149,9 +146,6 @@ python_library(
python_library(
name = 'tarutil',
sources = ['tarutil.py'],
dependencies = [
'3rdparty/python:six',
],
)

python_library(
Expand Down
1 change: 0 additions & 1 deletion tests/python/pants_test/process/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

python_tests(
dependencies = [
'3rdparty/python:six',
'src/python/pants/process',
'tests/python/pants_test:test_base',
'tests/python/pants_test/subsystem:subsystem_utils',
Expand Down