Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Restore Python 3.7 support

Adrián Chaves4242ae405d97
diff --git a/scrapy/http/request/__init__.py b/scrapy/http/request/__init__.py
index ea73781c8..936afb007 100644
--- a/scrapy/http/request/__init__.py
+++ b/scrapy/http/request/__init__.py
@@ -6,8 +6,9 @@ See documentation in docs/topics/request-response.rst
"""
import inspect
from enum import Enum
-from typing import Any, Callable, Final, List, Optional, Tuple, Type, TypeVar, Union
+from typing import Callable, List, Optional, Tuple, Type, TypeVar, Union
+from typing_extensions import Final
from w3lib.url import safe_url_string
import scrapy
@@ -26,6 +27,7 @@ RequestTypeVar = TypeVar("RequestTypeVar", bound="Request")
class _NoCallback(Enum):
NO_CALLBACK = 0
+
#: When assigned to the ``callback`` parameter of
#: :class:`~scrapy.http.Request`, it indicates that the request it not meant to
#: have a spider callback at all.
diff --git a/setup.py b/setup.py
index bdae28047..049c4f9a6 100644
--- a/setup.py
+++ b/setup.py
@@ -34,6 +34,7 @@ install_requires = [
'packaging',
'tldextract',
'lxml>=4.3.0',
+ 'typing-extensions>=3.10.0.0',
]
extras_require = {}
cpython_dependencies = [
diff --git a/tox.ini b/tox.ini
index 076178d8e..1ff5f7a4e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -94,6 +94,7 @@ deps =
w3lib==1.17.0
zope.interface==5.1.0
lxml==4.3.0
+ typing-extensions==3.10.0.0
-rtests/requirements.txt
# mitmproxy 4.0.4+ requires upgrading some of the pinned dependencies