mirror of https://github.com/scrapy/scrapy.git
Merge pull request #6083 from wRAR/py3.12-release
Adapt to the Python 3.12 final release
This commit is contained in:
commit
5b0b00212e
|
|
@ -11,7 +11,7 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
||||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
|
|||
|
|
@ -21,7 +21,10 @@ jobs:
|
|||
- python-version: "3.11"
|
||||
env:
|
||||
TOXENV: py
|
||||
- python-version: "3.11"
|
||||
- python-version: "3.12"
|
||||
env:
|
||||
TOXENV: py
|
||||
- python-version: "3.12"
|
||||
env:
|
||||
TOXENV: asyncio
|
||||
- python-version: pypy3.9
|
||||
|
|
@ -45,22 +48,17 @@ jobs:
|
|||
env:
|
||||
TOXENV: botocore-pinned
|
||||
|
||||
- python-version: "3.11"
|
||||
- python-version: "3.12"
|
||||
env:
|
||||
TOXENV: extra-deps
|
||||
- python-version: "3.11"
|
||||
- python-version: "3.12"
|
||||
env:
|
||||
TOXENV: botocore
|
||||
|
||||
- python-version: "3.12.0-rc.2"
|
||||
env:
|
||||
TOXENV: py
|
||||
- python-version: "3.12.0-rc.2"
|
||||
# keep until uvloop supports 3.12
|
||||
- python-version: "3.11"
|
||||
env:
|
||||
TOXENV: asyncio
|
||||
- python-version: "3.12.0-rc.2"
|
||||
env:
|
||||
TOXENV: extra-deps
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -71,7 +69,7 @@ jobs:
|
|||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install system libraries
|
||||
if: matrix.python-version == 'pypy3.9' || contains(matrix.env.TOXENV, 'pinned') || contains(matrix.python-version, '3.12.0')
|
||||
if: matrix.python-version == 'pypy3.9' || contains(matrix.env.TOXENV, 'pinned')
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install libxml2-dev libxslt-dev
|
||||
|
|
|
|||
|
|
@ -21,13 +21,13 @@ jobs:
|
|||
- python-version: "3.10"
|
||||
env:
|
||||
TOXENV: py
|
||||
- python-version: "3.10"
|
||||
env:
|
||||
TOXENV: asyncio
|
||||
- python-version: "3.11"
|
||||
env:
|
||||
TOXENV: py
|
||||
- python-version: "3.11"
|
||||
- python-version: "3.12"
|
||||
env:
|
||||
TOXENV: py
|
||||
- python-version: "3.12"
|
||||
env:
|
||||
TOXENV: asyncio
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
# Tests requirements
|
||||
attrs
|
||||
# https://github.com/giampaolo/pyftpdlib/issues/560
|
||||
pyftpdlib; python_version < "3.12"
|
||||
pyftpdlib >= 1.5.8
|
||||
pytest
|
||||
pytest-cov==4.0.0
|
||||
pytest-xdist
|
||||
|
|
@ -10,8 +9,7 @@ testfixtures
|
|||
# uvloop currently doesn't build on 3.12
|
||||
uvloop; platform_system != "Windows" and python_version < "3.12"
|
||||
|
||||
# bpython requires greenlet which currently doesn't build on 3.12
|
||||
bpython; python_version < "3.12" # optional for shell wrapper tests
|
||||
bpython # optional for shell wrapper tests
|
||||
brotli; implementation_name != 'pypy' # optional for HTTP compress downloader middleware tests
|
||||
# 1.1.0 is broken on PyPy: https://github.com/google/brotli/issues/1072
|
||||
brotli==1.0.9; implementation_name == 'pypy' # optional for HTTP compress downloader middleware tests
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class FileTestCase(unittest.TestCase):
|
|||
return self.download_request(request, Spider("foo")).addCallback(_test)
|
||||
|
||||
def test_non_existent(self):
|
||||
request = Request(f"file://{self.mktemp()}")
|
||||
request = Request(path_to_file_uri(self.mktemp()))
|
||||
d = self.download_request(request, Spider("foo"))
|
||||
return self.assertFailure(d, OSError)
|
||||
|
||||
|
|
|
|||
|
|
@ -125,9 +125,6 @@ class FileFeedStorageTest(unittest.TestCase):
|
|||
path.unlink()
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
sys.version_info >= (3, 12), reason="pyftpdlib doesn't support Python 3.12 yet"
|
||||
)
|
||||
class FTPFeedStorageTest(unittest.TestCase):
|
||||
def get_test_spider(self, settings=None):
|
||||
class TestSpider(scrapy.Spider):
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import dataclasses
|
||||
import os
|
||||
import random
|
||||
import sys
|
||||
import time
|
||||
from datetime import datetime
|
||||
from io import BytesIO
|
||||
|
|
@ -12,7 +11,6 @@ from unittest import mock
|
|||
from urllib.parse import urlparse
|
||||
|
||||
import attr
|
||||
import pytest
|
||||
from itemadapter import ItemAdapter
|
||||
from twisted.internet import defer
|
||||
from twisted.trial import unittest
|
||||
|
|
@ -648,9 +646,6 @@ class TestGCSFilesStore(unittest.TestCase):
|
|||
store.bucket.get_blob.assert_called_with(expected_blob_path)
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
sys.version_info >= (3, 12), reason="pyftpdlib doesn't support Python 3.12 yet"
|
||||
)
|
||||
class TestFTPFileStore(unittest.TestCase):
|
||||
@defer.inlineCallbacks
|
||||
def test_persist(self):
|
||||
|
|
|
|||
Loading…
Reference in New Issue