Skip to content

Commit 692f105

Browse files
committed
drop remaining six imports
1 parent 1d6b1cc commit 692f105

16 files changed

+14
-29
lines changed

requirements-base.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
requests>=1.0
22
retrying>=1.3.3
3-
six>=1.10.0

scrapinghub/client/collections.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from six import string_types
2-
from six.moves import collections_abc
1+
from collections.abc import Iterable
32

43
from ..hubstorage.collectionsrt import Collection as _Collection
54

@@ -183,7 +182,7 @@ def delete(self, keys):
183182
The method returns ``None`` (original method returns an empty generator).
184183
"""
185184
if (not isinstance(keys, str) and
186-
not isinstance(keys, collections_abc.Iterable)):
185+
not isinstance(keys, Iterable)):
187186
raise ValueError("You should provide string key or iterable "
188187
"object providing string keys")
189188
self._origin.delete(keys)

scrapinghub/client/frontiers.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from functools import partial
22
from collections import defaultdict
33

4-
from six import string_types
5-
64
from ..hubstorage.frontier import Frontier as _Frontier
75
from ..hubstorage.utils import urlpathjoin
86

scrapinghub/client/proxy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import six
21
import json
32

43
from ..hubstorage import ValueTooLarge as _ValueTooLarge
@@ -165,7 +164,7 @@ def iter(self):
165164
:return: an iterator over key/value pairs.
166165
:rtype: :class:`collections.abc.Iterable`
167166
"""
168-
return next(self._origin.apiget()).items()
167+
return iter(next(self._origin.apiget()).items())
169168

170169

171170
def _format_iter_filters(params):

scrapinghub/client/utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import warnings
66
from codecs import decode
77

8-
import six
9-
108

119
class LogLevel:
1210
DEBUG = logging.DEBUG

scrapinghub/hubstorage/batchuploader.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import random
44
import logging
55
import warnings
6-
import six
76
from queue import Queue
87
from io import BytesIO
98
from gzip import GzipFile

scrapinghub/hubstorage/resourcetype.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
import socket
44
import time
55

6-
import six
76
import requests.exceptions as rexc
8-
from six.moves import collections_abc
7+
from collections.abc import MutableMapping
98

109
from .utils import urlpathjoin, xauth
1110
from .serialization import jlencode, jldecode, mpdecode
@@ -226,7 +225,7 @@ def stats(self):
226225
return next(self.apiget('stats', chunk_size=STATS_CHUNK_SIZE))
227226

228227

229-
class MappingResourceType(ResourceType, collections_abc.MutableMapping):
228+
class MappingResourceType(ResourceType, MutableMapping):
230229

231230
_cached = None
232231
ignore_fields = ()

scrapinghub/hubstorage/serialization.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import six
21
from json import dumps, loads
32
from datetime import datetime
43

scrapinghub/hubstorage/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import six
21
import time
32
from queue import Empty
43

@@ -80,7 +79,7 @@ class iterqueue:
8079
8180
it exposes an attribute "count" with the number of messages read
8281
83-
>>> from six.moves.queue import Queue
82+
>>> from queue import Queue
8483
>>> q = Queue()
8584
>>> for x in range(10):
8685
... q.put(x)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
platforms=['Any'],
2727
packages=['scrapinghub', 'scrapinghub.client', 'scrapinghub.hubstorage'],
2828
package_data={'scrapinghub': ['VERSION']},
29-
install_requires=['requests>=1.0', 'retrying>=1.3.3', 'six>=1.10.0'],
29+
install_requires=['requests>=1.0', 'retrying>=1.3.3'],
3030
extras_require={'msgpack': mpack_required},
3131
python_requires='>=3.8',
3232
classifiers=[

0 commit comments

Comments
 (0)