Skip to content

Commit

Permalink
remove support for scrapy < 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Oct 5, 2020
1 parent d2ffb8d commit 6fb0ed6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ matrix:
env: TOXENV=py37
- python: 3.8
env: TOXENV=py38
- python: 2.7
env: TOXENV=py27-scrapy10

before_install:
- docker pull scrapinghub/splash
Expand Down
17 changes: 6 additions & 11 deletions scrapy_splash/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@
import six

from scrapy.http import Headers
try:
import scrapy
if scrapy.version_info >= (2, ):
from scrapy.utils.python import to_unicode
else:
from scrapy.utils.python import to_native_str as to_unicode
from scrapy.utils.python import to_bytes
except ImportError:
# scrapy < 1.1
from scrapy.utils.python import unicode_to_str as to_bytes
from scrapy.utils.python import str_to_unicode as to_unicode
import scrapy
if scrapy.version_info >= (2, ):
from scrapy.utils.python import to_unicode
else:
from scrapy.utils.python import to_native_str as to_unicode
from scrapy.utils.python import to_bytes


def dict_hash(obj, start=''):
Expand Down
14 changes: 8 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# and then run "tox" from this directory.

[tox]
envlist = py27,py34,py35,py36,py27-scrapy10
envlist = py27,py34,py35,py36,py37,py38

[testenv]
passenv = SPLASH_URL
Expand All @@ -30,8 +30,10 @@ deps = {[testenv:py34]deps}
basepython = python3.6
deps = {[testenv:py34]deps}

[testenv:py27-scrapy10]
deps =
-rrequirements-test.txt
scrapy < 1.1
service_identity
[testenv:py37]
basepython = python3.7
deps = {[testenv:py34]deps}

[testenv:py38]
basepython = python3.8
deps = {[testenv:py34]deps}

0 comments on commit 6fb0ed6

Please sign in to comment.