mirror of https://github.com/scrapy/scrapy.git
Remove deprecated xlib module
This commit is contained in:
parent
534de7395d
commit
c5612f387b
|
|
@ -3,4 +3,3 @@ branch = true
|
|||
include = scrapy/*
|
||||
omit =
|
||||
tests/*
|
||||
scrapy/xlib/*
|
||||
|
|
|
|||
10
conftest.py
10
conftest.py
|
|
@ -1,22 +1,12 @@
|
|||
import glob
|
||||
import six
|
||||
import pytest
|
||||
from twisted import version as twisted_version
|
||||
|
||||
|
||||
def _py_files(folder):
|
||||
return glob.glob(folder + "/*.py") + glob.glob(folder + "/*/*.py")
|
||||
|
||||
|
||||
collect_ignore = [
|
||||
# not a test, but looks like a test
|
||||
"scrapy/utils/testsite.py",
|
||||
|
||||
]
|
||||
|
||||
if (twisted_version.major, twisted_version.minor, twisted_version.micro) >= (15, 5, 0):
|
||||
collect_ignore += _py_files("scrapy/xlib/tx")
|
||||
|
||||
|
||||
if six.PY3:
|
||||
for line in open('tests/py3-ignores.txt'):
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
new-package-should-close-itp-bug
|
||||
extra-license-file usr/share/pyshared/scrapy/xlib/pydispatch/license.txt
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
"""This package contains some third party modules that are distributed along
|
||||
with Scrapy"""
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
import warnings
|
||||
from scrapy.exceptions import ScrapyDeprecationWarning
|
||||
|
||||
from pydispatch import (
|
||||
dispatcher,
|
||||
errors,
|
||||
robust,
|
||||
robustapply,
|
||||
saferef,
|
||||
)
|
||||
|
||||
warnings.warn("Importing from scrapy.xlib.pydispatch is deprecated and will"
|
||||
" no longer be supported in future Scrapy versions."
|
||||
" If you just want to connect signals use the from_crawler class method,"
|
||||
" otherwise import pydispatch directly if needed."
|
||||
" See: https://github.com/scrapy/scrapy/issues/1762",
|
||||
ScrapyDeprecationWarning, stacklevel=2)
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
import warnings
|
||||
from scrapy.exceptions import ScrapyDeprecationWarning
|
||||
|
||||
from twisted.web import client
|
||||
from twisted.internet import endpoints
|
||||
|
||||
Agent = client.Agent # since < 11.1
|
||||
ProxyAgent = client.ProxyAgent # since 11.1
|
||||
ResponseDone = client.ResponseDone # since 11.1
|
||||
ResponseFailed = client.ResponseFailed # since 11.1
|
||||
HTTPConnectionPool = client.HTTPConnectionPool # since 12.1
|
||||
TCP4ClientEndpoint = endpoints.TCP4ClientEndpoint # since 10.1
|
||||
|
||||
warnings.warn("Importing from scrapy.xlib.tx is deprecated and will"
|
||||
" no longer be supported in future Scrapy versions."
|
||||
" Update your code to import from twisted proper.",
|
||||
ScrapyDeprecationWarning, stacklevel=2)
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
import unittest
|
||||
import warnings
|
||||
from six.moves import reload_module
|
||||
|
||||
|
||||
class DeprecatedPydispatchTest(unittest.TestCase):
|
||||
def test_import_xlib_pydispatch_show_warning(self):
|
||||
with warnings.catch_warnings(record=True) as w:
|
||||
from scrapy.xlib import pydispatch
|
||||
reload_module(pydispatch)
|
||||
self.assertIn('Importing from scrapy.xlib.pydispatch is deprecated',
|
||||
str(w[0].message))
|
||||
Loading…
Reference in New Issue