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

Add Python 3.8 official support #4092

Merged
merged 21 commits into from Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3d4317b
[tox.ini] Added python 3.8 fields
further-reading Oct 21, 2019
4e939ca
[setup.py] Added python 3.8 fields
further-reading Oct 21, 2019
c12a075
[.travis.yml] Added python 3.8 fields
further-reading Oct 21, 2019
85ac5c5
Update .travis.yml
further-reading Oct 21, 2019
179dc91
Update setup.py
further-reading Oct 27, 2019
4068797
Update test_downloadermiddleware_httpcache.py
further-reading Oct 27, 2019
deacd34
[test_downloadermiddleware_httpcache] Attempting to add xfail for lev…
further-reading Oct 27, 2019
11942c4
[test_downloadermiddleware_httpcache] Trying hack to handle systemerr…
further-reading Oct 27, 2019
b3df0a8
[test_downloadermiddleware_httpcache] Adding xfails to impacted tests…
further-reading Oct 27, 2019
70b2854
[test_downloadermiddleware_httpcache] Making xfails more informative
further-reading Oct 27, 2019
20ea912
[test_downloadermiddleware_httpcache] Making xfails more informative
further-reading Oct 27, 2019
b5a0026
Update .travis.yml
further-reading Oct 28, 2019
3d0df41
Mark the LevelDB storage backend as deprecated
Gallaecio Oct 28, 2019
3af2abb
Merge pull request #1 from Gallaecio/py38
further-reading Oct 28, 2019
16bb3ac
[test_downloadermiddleware_httpcache] Using skipif approach
further-reading Oct 28, 2019
9b47dc6
[travis, setup] Adding official python 3.8 support
further-reading Oct 28, 2019
4432136
[test_downloadermiddleware_httpcache] Fixing pytest skip behaviour
further-reading Oct 28, 2019
c51fb95
[test_downloadermiddleware_httpcache] Fixing pytest skip behaviour
further-reading Oct 28, 2019
7490903
[tox.ini] Removing obsolete py37 extra deps enviornment
further-reading Oct 28, 2019
b73d217
[test_downloadermiddleware_httpcache.py] Fixing pytest mark behaviour
further-reading Oct 28, 2019
93e3dc1
[test_downloadermiddleware_httpcache.py] Cleaning text
further-reading Oct 28, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Expand Up @@ -27,6 +27,10 @@ matrix:
python: 3.7
- env: TOXENV=py37-extra-deps
python: 3.7
- env: TOXENV=py38
python: 3.8
- env: TOXENV=py37-extra-deps
further-reading marked this conversation as resolved.
Show resolved Hide resolved
python: 3.8
further-reading marked this conversation as resolved.
Show resolved Hide resolved
- env: TOXENV=docs
python: 3.6
install:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -56,6 +56,7 @@ def has_environment_marker_platform_impl_support():
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
# 'Programming Language :: Python :: 3.8', not supported yet
further-reading marked this conversation as resolved.
Show resolved Hide resolved
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Internet :: WWW/HTTP',
Expand Down
11 changes: 10 additions & 1 deletion tests/test_downloadermiddleware_httpcache.py
Expand Up @@ -6,6 +6,7 @@
import email.utils
from contextlib import contextmanager
import pytest
import sys
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💄 This does not seem to be used below.


from scrapy.http import Response, HtmlResponse, Request
from scrapy.spiders import Spider
Expand Down Expand Up @@ -89,6 +90,7 @@ def assertEqualRequestButWithCacheValidators(self, request1, request2):
assert any(h in request2.headers for h in (b'If-None-Match', b'If-Modified-Since'))
self.assertEqual(request1.body, request2.body)

@pytest.mark.xfail(sys.version_info >= (3, 8), raises=SystemError, reason='leveldb not supported in python 3.8')
def test_dont_cache(self):
with self._middleware() as mw:
self.request.meta['dont_cache'] = True
Expand All @@ -104,6 +106,7 @@ def test_dont_cache(self):

class DefaultStorageTest(_BaseTest):

@pytest.mark.xfail(sys.version_info >= (3, 8), raises=SystemError, reason='leveldb not supported in python 3.8')
def test_storage(self):
with self._storage() as storage:
request2 = self.request.copy()
Expand All @@ -117,6 +120,7 @@ def test_storage(self):
time.sleep(2) # wait for cache to expire
assert storage.retrieve_response(self.spider, request2) is None

@pytest.mark.xfail(sys.version_info >= (3, 8), raises=SystemError, reason='leveldb not supported in python 3.8')
def test_storage_never_expire(self):
with self._storage(HTTPCACHE_EXPIRATION_SECS=0) as storage:
assert storage.retrieve_response(self.spider, self.request) is None
Expand Down Expand Up @@ -156,7 +160,12 @@ def _get_settings(self, **new_settings):

class LeveldbStorageTest(DefaultStorageTest):

pytest.importorskip('leveldb')
try:
pytest.importorskip('leveldb')
except SystemError:
# Happens in python 3.8
# This will cause xfail in DefaultStorageTest to trigger
pass
further-reading marked this conversation as resolved.
Show resolved Hide resolved
storage_class = 'scrapy.extensions.httpcache.LeveldbCacheStorage'


Expand Down
11 changes: 11 additions & 0 deletions tox.ini
Expand Up @@ -92,6 +92,10 @@ deps = {[testenv:py35]deps}
basepython = python3.7
deps = {[testenv:py35]deps}

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

[testenv:pypy3]
basepython = pypy3
deps = {[testenv:py35]deps}
Expand Down Expand Up @@ -128,6 +132,13 @@ deps =
reppy
robotexclusionrulesparser
further-reading marked this conversation as resolved.
Show resolved Hide resolved

[testenv:py38-extra-deps]
basepython = python3.8
deps =
{[testenv:py35]deps}
reppy
robotexclusionrulesparser

[testenv:py27-extra-deps]
basepython = python2.7
deps =
Expand Down