Skip to content

Commit

Permalink
Remove scraoy-spider-metadata from requirements.
Browse files Browse the repository at this point in the history
  • Loading branch information
wRAR committed Sep 27, 2023
1 parent 0a86dc2 commit 71f2b8c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
install_requires=[
'Scrapy>=1.6',
'scrapinghub>=2.1.0',
'scrapy-spider-metadata; python_version >= "3.8"'
],
entry_points={
'console_scripts': [
Expand Down
6 changes: 4 additions & 2 deletions tests/test_crawl.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ def test_image_info(tmp_path):
assert data == expected


@pytest.mark.skipif(not SPIDER_METADATA_AVAILABLE, reason="scrapy-spider-metadata is not installed")
def test_image_info_metadata(tmp_path):
project_dir = create_project(tmp_path, spider_text="""
from scrapy import Spider
Expand All @@ -321,10 +320,11 @@ class MySpider(Spider):
"spiders": ["myspider"],
"metadata": {"myspider": {"foo": 42}},
}
if not SPIDER_METADATA_AVAILABLE:
del expected["metadata"]
assert data == expected


@pytest.mark.skipif(not SPIDER_METADATA_AVAILABLE, reason="scrapy-spider-metadata is not installed")
def test_image_info_metadata_skip_broken(tmp_path):
project_dir = create_project(tmp_path, spider_text="""
from scrapy import Spider
Expand All @@ -340,4 +340,6 @@ class MySpider(Spider):
"spiders": ["myspider"],
"metadata": {},
}
if not SPIDER_METADATA_AVAILABLE:
del expected["metadata"]
assert data == expected
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ deps =
hubstorage
packaging
py36-scrapy16: Scrapy==1.6
scrapy-spider-metadata; python_version >= "3.8"

commands =
pytest --verbose --cov=sh_scrapy --cov-report=term-missing --cov-report=html --cov-report=xml {posargs: sh_scrapy tests}

0 comments on commit 71f2b8c

Please sign in to comment.