Skip to content

Commit dc24afe

Browse files
committed
[requirements] remove six, we dont support Python 2 anymore
1 parent ef93417 commit dc24afe

File tree

7 files changed

+6
-17
lines changed

7 files changed

+6
-17
lines changed

requirements.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
11
Scrapy>=1.0.0
2-
service-identity>=1.0.0
3-
six>=1.12.0
4-
jmespath==0.10.0
5-
pyasn1>=0.4.8

scrapyrt/conf/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
import six
32
from copy import deepcopy
43
from importlib import import_module
54

@@ -12,7 +11,7 @@ def __init__(self):
1211
self.setmodule(default_settings)
1312

1413
def setmodule(self, module):
15-
if isinstance(module, six.string_types):
14+
if isinstance(module, str):
1615
module = import_module(module)
1716
for setting in dir(module):
1817
self.set(setting, getattr(module, setting))

scrapyrt/core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from copy import deepcopy
44
import datetime
55
import os
6-
import six
76

87
from scrapy import signals
98
from scrapy.crawler import CrawlerRunner, Crawler
@@ -58,7 +57,7 @@ def __init__(self, settings, scrapyrt_manager):
5857
self.scrapyrt_manager = scrapyrt_manager
5958

6059
def crawl(self, spidercls, *args, **kwargs):
61-
if isinstance(spidercls, six.string_types):
60+
if isinstance(spidercls, str):
6261
spidercls = self.spider_loader.load(spidercls)
6362

6463
for kw in kwargs:

scrapyrt/utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import inspect
22

3-
import sys
4-
5-
import six
63
from scrapy import Request
74

85

@@ -33,7 +30,7 @@ def to_bytes(text, encoding=None, errors='strict'):
3330
is already a bytes object, return it as-is."""
3431
if isinstance(text, bytes):
3532
return text
36-
if not isinstance(text, six.string_types):
33+
if not isinstance(text, str):
3734
raise TypeError('to_bytes must receive a unicode, str or bytes '
3835
'object, got %s' % type(text).__name__)
3936
if encoding is None:

setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@
3737
'License :: OSI Approved :: BSD License',
3838
],
3939
install_requires=[
40-
'Twisted>=14.0.0',
41-
'Scrapy>=1.0.0',
42-
'six>=1.5.2'
40+
'Scrapy>=1.0.0'
4341
],
4442
package_data={
4543
'scrapyrt': [

tests/servers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import tempfile
88
import time
99
from subprocess import Popen, PIPE
10+
from urllib.parse import urljoin
1011

1112
import port_for
12-
from six.moves.urllib.parse import urljoin
1313

1414
from . import TESTS_PATH
1515
from .utils import get_testenv, generate_project

tests/test_log_observer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
from six import StringIO
2+
from io import StringIO
33

44
from mock import patch
55
from twisted.python.log import startLoggingWithObserver, removeObserver

0 commit comments

Comments
 (0)