From 3740fdf8b01ba8f2d5e9577e73671e221d389621 Mon Sep 17 00:00:00 2001 From: Vinny Meller Date: Mon, 18 Nov 2024 20:37:43 -0500 Subject: [PATCH 1/2] ci: update python versions to test against --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 25fabf7..bc3ce90 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8, 3.9] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v2 @@ -21,7 +21,7 @@ jobs: sudo apt-get install libdb-dev - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Cache pip @@ -38,4 +38,4 @@ jobs: pip install -r tests/requirements-test.txt - name: Test with pytest run: | - pytest \ No newline at end of file + pytest From a9cd2dad048129f803ea47d005fdc15aa1c6a8fa Mon Sep 17 00:00:00 2001 From: Vinny Meller Date: Mon, 18 Nov 2024 20:29:28 -0500 Subject: [PATCH 2/2] fix: update calls to removed function request_fingerprint --- scrapy_deltafetch/middleware.py | 4 ++-- tests/test_deltafetch.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scrapy_deltafetch/middleware.py b/scrapy_deltafetch/middleware.py index 9f6f1b4..af20f1f 100644 --- a/scrapy_deltafetch/middleware.py +++ b/scrapy_deltafetch/middleware.py @@ -5,7 +5,7 @@ from scrapy.http import Request from scrapy.item import Item -from scrapy.utils.request import request_fingerprint +from scrapy.utils.request import fingerprint from scrapy.utils.project import data_path from scrapy.utils.python import to_bytes from scrapy.exceptions import NotConfigured @@ -79,7 +79,7 @@ def process_spider_output(self, response, result, spider): yield r def _get_key(self, request): - key = request.meta.get('deltafetch_key') or request_fingerprint(request) + key = request.meta.get('deltafetch_key') or fingerprint(request) return to_bytes(key) def _is_enabled_for_request(self, request): diff --git a/tests/test_deltafetch.py b/tests/test_deltafetch.py index 362bf1e..562a01e 100644 --- a/tests/test_deltafetch.py +++ b/tests/test_deltafetch.py @@ -9,7 +9,7 @@ from scrapy.spiders import Spider from scrapy.settings import Settings from scrapy.exceptions import NotConfigured -from scrapy.utils.request import request_fingerprint +from scrapy.utils.request import fingerprint from scrapy.utils.python import to_bytes from scrapy.statscollectors import StatsCollector from scrapy.utils.test import get_crawler @@ -319,7 +319,7 @@ def test_get_key(self): mw = self.mwcls(self.temp_dir, reset=True) test_req1 = Request('http://url1') self.assertEqual(mw._get_key(test_req1), - to_bytes(request_fingerprint(test_req1))) + to_bytes(fingerprint(test_req1))) test_req2 = Request('http://url2', meta={'deltafetch_key': b'dfkey1'}) self.assertEqual(mw._get_key(test_req2), b'dfkey1')