<pre style='margin:0'>
Kurt Hindenburg (kurthindenburg) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/4cc3acba546f93540f3418c34bcbc8e668264d07">https://github.com/macports/macports-ports/commit/4cc3acba546f93540f3418c34bcbc8e668264d07</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 4cc3acba546 py-scrapy: update to 2.12.0 (#27191)
</span>4cc3acba546 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 4cc3acba546f93540f3418c34bcbc8e668264d07
</span>Author: Kurt Hindenburg <khindenburg@macports.org>
AuthorDate: Tue Dec 24 11:46:36 2024 -0500
<span style='display:block; white-space:pre;color:#404040;'> py-scrapy: update to 2.12.0 (#27191)
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Remove old patches and unused python version select files
</span>---
python/py-scrapy/Portfile | 19 +-
.../files/install-requires-setuptools.patch | 22 --
python/py-scrapy/files/scrapy-27 | 1 -
python/py-scrapy/files/scrapy-36 | 1 -
python/py-scrapy/files/scrapy-37 | 1 -
python/py-scrapy/files/scrapy-38 | 1 -
.../py-scrapy/files/twisted-http2-optional.patch | 285 ---------------------
7 files changed, 6 insertions(+), 324 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-scrapy/Portfile b/python/py-scrapy/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index d5c4e39d82a..88455c42880 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/python/py-scrapy/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/python/py-scrapy/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -5,7 +5,7 @@ PortGroup python 1.0
</span> PortGroup select 1.0
name py-scrapy
<span style='display:block; white-space:pre;background:#ffe0e0;'>-version 2.11.2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+version 2.12.0
</span> revision 0
# epoch needed due to previous downgrading version
epoch 1
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -27,10 +27,11 @@ set rootname_lower [string tolower ${python.rootname}]
</span> # scrapy 2.11.2 named with lowercase
set distname ${rootname_lower}-${version}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-checksums rmd160 4461b266fe52080bbc2bd5bdc14810ae627def8f \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sha256 dfbd565384fc3fffeba121f5a3a2d0899ac1f756d41432ca0879933fbfb3401d \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size 1187710
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+checksums rmd160 1ad3d68864a2390f7fb3de69b1d985c28d6035df \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 d66d6e76009b12447604196875a463b61d10721140032a8084a0a52df7f4788f \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size 1210998
</span>
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# 2.12.0 supports 313 but so many dependencies need updated
</span> python.versions 39 310 311 312
if {${name} ne ${subport}} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -47,6 +48,7 @@ if {${name} ne ${subport}} {
</span> port:py${python.version}-zopeinterface \
port:py${python.version}-protego \
port:py${python.version}-dispatcher \
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:py${python.version}-itemloaders \
</span> port:py${python.version}-itemadapter \
port:py${python.version}-tldextract \
port:py${python.version}-typing_extensions \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -70,15 +72,6 @@ if {${name} ne ${subport}} {
</span>
test.run yes
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # Dependencies:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # https://github.com/scrapy/scrapy/blob/e63188cbf753d560e43d8489c821bd6eb9fe54e9/setup.py#L21
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # But note that patches add setuptools and remove h2
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- depends_lib-append \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- port:py${python.version}-setuptools \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- port:py${python.version}-itemloaders \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- port:py${python.version}-itemadapter
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> select.group ${rootname_lower}
select.file ${filespath}/${rootname_lower}-${python.version}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-scrapy/files/install-requires-setuptools.patch b/python/py-scrapy/files/install-requires-setuptools.patch
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 03dab32c9bf..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/python/py-scrapy/files/install-requires-setuptools.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,22 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-From 4f500342c8ad4674b191e1fab0d1b2ac944d7d3e Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <tomas.hrnciar@me.com>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-Date: Wed, 28 Apr 2021 11:57:44 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-Subject: [PATCH] Require setuptools, scrapy/cmdline.py, /setup.py and
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- tests/test_webclient.py import pkg_resources
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>----
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- setup.py | 1 +
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 1 file changed, 1 insertion(+)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git a/setup.py b/setup.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 2b60a10af4..b1bb64575e 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- a/setup.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ b/setup.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -32,6 +32,7 @@ def has_environment_marker_platform_impl_support():
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 'protego>=0.1.15',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 'itemadapter>=0.1.0',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 'h2>=3.0,<4.0',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 'setuptools',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- extras_require = {}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- cpython_dependencies = [
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-scrapy/files/scrapy-27 b/python/py-scrapy/files/scrapy-27
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index b3f5d1e93a6..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/python/py-scrapy/files/scrapy-27
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-bin/scrapy-2.7
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-scrapy/files/scrapy-36 b/python/py-scrapy/files/scrapy-36
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 4fead4c41d8..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/python/py-scrapy/files/scrapy-36
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-bin/scrapy-3.6
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-scrapy/files/scrapy-37 b/python/py-scrapy/files/scrapy-37
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 027572f7522..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/python/py-scrapy/files/scrapy-37
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-bin/scrapy-3.7
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-scrapy/files/scrapy-38 b/python/py-scrapy/files/scrapy-38
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index c93544c0d5d..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/python/py-scrapy/files/scrapy-38
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-bin/scrapy-3.8
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-scrapy/files/twisted-http2-optional.patch b/python/py-scrapy/files/twisted-http2-optional.patch
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 9d338af5154..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/python/py-scrapy/files/twisted-http2-optional.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,285 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-From c5b1ee810167266fcd259f263dbfc0fe0204761a Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= <adrian@chaves.io>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-Date: Tue, 11 May 2021 09:04:53 +0200
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-Subject: [PATCH] Make Twisted[http2] installation optional (#5113)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-Co-authored-by: Eugenio Lacuesta <eugenio.lacuesta@gmail.com>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>----
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- conftest.py | 9 +++++++++
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- docs/topics/settings.rst | 14 ++++++++-----
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- setup.py | 3 +--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- tests/test_downloader_handlers_http2.py | 26 ++++++++++++++++++++-----
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- tests/test_http2_client_protocol.py | 13 ++++++++-----
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- tox.ini | 11 +++++------
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 6 files changed, 53 insertions(+), 23 deletions(-)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git a/conftest.py b/conftest.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index e4dd80de0d..4931c5a796 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- a/conftest.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ b/conftest.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,6 +1,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from pathlib import Path
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import pytest
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+from twisted.web.http import H2_ENABLED
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from scrapy.utils.reactor import install_reactor
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -25,6 +26,14 @@ def _py_files(folder):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if file_path and file_path[0] != '#':
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- collect_ignore.append(file_path)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+if not H2_ENABLED:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ collect_ignore.extend(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ (
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 'scrapy/core/downloader/handlers/http2.py',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *_py_files("scrapy/core/http2"),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ )
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ )
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- @pytest.fixture()
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def chdir(tmpdir):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git a/docs/topics/settings.rst b/docs/topics/settings.rst
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 2506497e25..0b290598f2 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- a/docs/topics/settings.rst
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ b/docs/topics/settings.rst
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -680,12 +680,16 @@ handler (without replacement), place this in your ``settings.py``::
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- .. _http2:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--The default HTTPS handler uses HTTP/1.1. To use HTTP/2 update
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--:setting:`DOWNLOAD_HANDLERS` as follows::
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+The default HTTPS handler uses HTTP/1.1. To use HTTP/2:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- DOWNLOAD_HANDLERS = {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 'https': 'scrapy.core.downloader.handlers.http2.H2DownloadHandler',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#. Install ``Twisted[http2]>=17.9.0`` to install the packages required to
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ enable HTTP/2 support in Twisted.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#. Update :setting:`DOWNLOAD_HANDLERS` as follows::
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ DOWNLOAD_HANDLERS = {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 'https': 'scrapy.core.downloader.handlers.http2.H2DownloadHandler',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- .. warning::
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git a/setup.py b/setup.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index b1bb64575e..ed2b6e3473 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- a/setup.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ b/setup.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -19,7 +19,7 @@ def has_environment_marker_platform_impl_support():
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- install_requires = [
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 'Twisted[http2]>=17.9.0',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ 'Twisted>=17.9.0',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 'cryptography>=2.0',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 'cssselect>=0.9.1',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 'itemloaders>=1.0.1',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -31,7 +31,6 @@ def has_environment_marker_platform_impl_support():
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 'zope.interface>=4.1.3',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 'protego>=0.1.15',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 'itemadapter>=0.1.0',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- 'h2>=3.0,<4.0',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 'setuptools',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- extras_require = {}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git a/tests/test_downloader_handlers_http2.py b/tests/test_downloader_handlers_http2.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 4397780148..53bb4fe929 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- a/tests/test_downloader_handlers_http2.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ b/tests/test_downloader_handlers_http2.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import json
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--from unittest import mock
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+from unittest import mock, skipIf
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from pytest import mark
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from testfixtures import LogCapture
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -7,8 +7,8 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from twisted.trial import unittest
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from twisted.web import server
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from twisted.web.error import SchemeNotSupported
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+from twisted.web.http import H2_ENABLED
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--from scrapy.core.downloader.handlers.http2 import H2DownloadHandler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from scrapy.http import Request
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from scrapy.spiders import Spider
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from scrapy.utils.misc import create_instance
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -21,11 +21,17 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- )
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+@skipIf(not H2_ENABLED, "HTTP/2 support in Twisted is not enabled")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- class Https2TestCase(Https11TestCase):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- scheme = 'https'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- download_handler_cls = H2DownloadHandler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- HTTP2_DATALOSS_SKIP_REASON = "Content-Length mismatch raises InvalidBodyLengthError"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @classmethod
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def setUpClass(cls):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ from scrapy.core.downloader.handlers.http2 import H2DownloadHandler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ cls.download_handler_cls = H2DownloadHandler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def test_protocol(self):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- request = Request(self.getURL("host"), method="GET")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- d = self.download_request(request, Spider("foo"))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -187,9 +193,14 @@ def setUp(self):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- super(Https2InvalidDNSPattern, self).setUp()
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+@skipIf(not H2_ENABLED, "HTTP/2 support in Twisted is not enabled")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- class Https2CustomCiphers(Https11CustomCiphers):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- scheme = 'https'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- download_handler_cls = H2DownloadHandler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @classmethod
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def setUpClass(cls):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ from scrapy.core.downloader.handlers.http2 import H2DownloadHandler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ cls.download_handler_cls = H2DownloadHandler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- class Http2MockServerTestCase(Http11MockServerTestCase):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -201,6 +212,7 @@ class Http2MockServerTestCase(Http11MockServerTestCase):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+@skipIf(not H2_ENABLED, "HTTP/2 support in Twisted is not enabled")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- class Https2ProxyTestCase(Http11ProxyTestCase):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # only used for HTTPS tests
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- keyfile = 'keys/localhost.key'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -209,9 +221,13 @@ class Https2ProxyTestCase(Http11ProxyTestCase):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- scheme = 'https'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- host = u'127.0.0.1'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- download_handler_cls = H2DownloadHandler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- expected_http_proxy_request_body = b'/'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @classmethod
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def setUpClass(cls):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ from scrapy.core.downloader.handlers.http2 import H2DownloadHandler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ cls.download_handler_cls = H2DownloadHandler
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def setUp(self):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- site = server.Site(UriResource(), timeout=None)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- self.port = reactor.listenSSL(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git a/tests/test_http2_client_protocol.py b/tests/test_http2_client_protocol.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 8b2f6a11df..677ede92ba 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- a/tests/test_http2_client_protocol.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ b/tests/test_http2_client_protocol.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -5,10 +5,9 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import shutil
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- import string
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from ipaddress import IPv4Address
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--from unittest import mock
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+from unittest import mock, skipIf
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from urllib.parse import urlencode
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--from h2.exceptions import InvalidBodyLengthError
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from twisted.internet import reactor
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from twisted.internet.defer import CancelledError, Deferred, DeferredList, inlineCallbacks
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from twisted.internet.endpoints import SSL4ClientEndpoint, SSL4ServerEndpoint
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -17,12 +16,10 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from twisted.python.failure import Failure
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from twisted.trial.unittest import TestCase
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from twisted.web.client import ResponseFailed, URI
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--from twisted.web.http import Request as TxRequest
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+from twisted.web.http import H2_ENABLED, Request as TxRequest
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from twisted.web.server import Site, NOT_DONE_YET
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from twisted.web.static import File
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--from scrapy.core.http2.protocol import H2ClientFactory, H2ClientProtocol
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--from scrapy.core.http2.stream import InactiveStreamClosed, InvalidHostname
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from scrapy.http import Request, Response, JsonRequest
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from scrapy.settings import Settings
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- from scrapy.spiders import Spider
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -173,6 +170,7 @@ def get_client_certificate(key_file, certificate_file) -> PrivateCertificate:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return PrivateCertificate.loadPEM(pem)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+@skipIf(not H2_ENABLED, "HTTP/2 support in Twisted is not enabled")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- class Https2ClientProtocolTestCase(TestCase):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- scheme = 'https'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- key_file = os.path.join(os.path.dirname(__file__), 'keys', 'localhost.key')
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -220,6 +218,7 @@ def setUp(self):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uri = URI.fromBytes(bytes(self.get_url('/'), 'utf-8'))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- self.conn_closed_deferred = Deferred()
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ from scrapy.core.http2.protocol import H2ClientFactory
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- h2_client_factory = H2ClientFactory(uri, Settings(), self.conn_closed_deferred)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- client_endpoint = SSL4ClientEndpoint(reactor, self.hostname, self.port_number, client_options)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- self.client = yield client_endpoint.connect(h2_client_factory)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -426,6 +425,7 @@ def test_received_dataloss_response(self):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def assert_failure(failure: Failure):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- self.assertTrue(len(failure.value.reasons) > 0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ from h2.exceptions import InvalidBodyLengthError
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- self.assertTrue(any(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- isinstance(error, InvalidBodyLengthError)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- for error in failure.value.reasons
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -511,6 +511,7 @@ def test_inactive_stream(self):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def assert_inactive_stream(failure):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- self.assertIsNotNone(failure.check(ResponseFailed))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ from scrapy.core.http2.stream import InactiveStreamClosed
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- self.assertTrue(any(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- isinstance(e, InactiveStreamClosed)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- for e in failure.value.reasons
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -596,6 +597,7 @@ def _check_invalid_netloc(self, url):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- request = Request(url)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def assert_invalid_hostname(failure: Failure):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ from scrapy.core.http2.stream import InvalidHostname
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- self.assertIsNotNone(failure.check(InvalidHostname))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- error_msg = str(failure.value)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- self.assertIn('localhost', error_msg)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -633,6 +635,7 @@ def test_connection_timeout(self):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def assert_timeout_error(failure: Failure):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- for err in failure.value.reasons:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ from scrapy.core.http2.protocol import H2ClientProtocol
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if isinstance(err, TimeoutError):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- self.assertIn(f"Connection was IDLE for more than {H2ClientProtocol.IDLE_TIMEOUT}s", str(err))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- break
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git a/tox.ini b/tox.ini
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 5b0606f8fb..8167aff962 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- a/tox.ini
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ b/tox.ini
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -50,6 +50,8 @@ commands =
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- basepython = python3
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- deps =
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {[testenv]deps}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ # Twisted[http2] is required to import some files
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Twisted[http2]>=17.9.0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- pytest-flake8
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- commands =
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- py.test --flake8 {posargs:docs scrapy tests}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -59,12 +61,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- [testenv:pylint]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- basepython = python3
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- deps =
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- {[testenv]deps}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- # Optional dependencies
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- boto
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- reppy
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- robotexclusionrulesparser
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- # Test dependencies
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ {[testenv:extra-deps]deps}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Force the pylint version used in CI for the 2.5.0 tag
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- pylint==2.7.4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- commands =
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -119,9 +116,11 @@ setenv =
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- [testenv:extra-deps]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- deps =
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {[testenv]deps}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ boto
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- reppy
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- robotexclusionrulesparser
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- Pillow>=4.0.0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Twisted[http2]>=17.9.0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- [testenv:asyncio]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- commands =
</span></pre><pre style='margin:0'>
</pre>