Skip to content

Commit

Permalink
fix pip version in action
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalEgn committed Jul 10, 2024
1 parent 66363db commit e3d3a30
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

install_requires = [
'automat==20.2.0',
'amqp~=2.0,>2.2.0,!=2.3.0',
'amqp',
'autosemver~=0.2',
"backports.tempfile==1.0",
'boto3~=1.14',
Expand All @@ -27,6 +27,7 @@
'inspire-utils~=3.0,>=3.0.0',
# newer scrapy is incompatible with old scrapyd
'Scrapy~=1.6,<1.7.0',
'parsel<=1.8.0',
'scrapy-crawl-once~=0.1,>=0.1.1',
'scrapy-sentry~=0.0,>=0.8.0',
# TODO: unpin once they support wheel building again, needed for Python 3
Expand All @@ -45,13 +46,14 @@
'harvestingkit>=0.6.12',
'Sickle~=0.6,>=0.6.2',
# newer versions seem incompatible with required scrapyd version
'Twisted~=18.0,>=18.9.0',
'Twisted~=18.0,>=18.9.0; python_version == "2.7"',
'Twisted>=21.2.0; python_version >= "3"',
#latex parsing
'pylatexenc~=2.9',
'queuelib==1.5.0',
'sentry-sdk==1.3.0',
'structlog==20.1.0',
'python-logstash==0.4.8',
'queuelib>=1.5.0',
'sentry-sdk>=0.10.0',
'structlog>=19.0.0',
'python-logstash>=0.4.8',
]

tests_require = [
Expand All @@ -61,7 +63,7 @@
'freezegun>=0.3.9',
'isort==4.2.2',
'mock~=2.0,>=2.0.0',
'pytest>=2.8.0',
'pytest>=2.8.0, <8.0.0',
'pytest-cov>=2.1.0',
'pytest-pep8>=1.0.6',
'requests-mock>=1.3.0',
Expand Down
10 changes: 8 additions & 2 deletions tests/unit/test_desy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from __future__ import absolute_import, division, print_function

import os

import sys
import mock
import pytest
from deepdiff import DeepDiff
Expand Down Expand Up @@ -106,6 +106,8 @@ def override_generated_fields(record):
]
)
def test_pipeline(generated_records, expected_records):
if sys.version_info[0] >= 3:
unicode = str
clean_generated_records = [
override_generated_fields(generated_record)
for generated_record in generated_records
Expand All @@ -126,6 +128,10 @@ def test_invalid_jsonll():
response.meta = {"s3_subdirectory": 'invalid_record'}

result = list(spider.parse(response))
assert result[0].exception.startswith('ValueError')
exception = result[0].exception
if exception.startswith('ValueError') or exception.startswith('JSONDecodeError'):
assert True
else:
assert False
assert result[0].traceback is not None
assert result[0].source_data == "This is not actually JSONL"
7 changes: 5 additions & 2 deletions tests/unit/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# more details.

import logging

import sys
from scrapy.utils.project import get_project_settings
from scrapy.utils.log import (configure_logging, logger)

Expand All @@ -21,4 +21,7 @@ def test_log_settings():

configure_logging(settings=settings)
assert any(isinstance(handler, logging.StreamHandler) for handler in logger.root.handlers)
assert not any(isinstance(handler, logging.FileHandler) for handler in logger.root.handlers)
if sys.version_info[0] >= 3:
assert any(isinstance(handler, logging.FileHandler) and handler.level == logging.NOTSET for handler in logger.root.handlers)
else:
assert not any(isinstance(handler, logging.FileHandler) for handler in logger.root.handlers)

0 comments on commit e3d3a30

Please sign in to comment.