Skip to content

Commit

Permalink
Merge pull request #6083 from wRAR/py3.12-release
Browse files Browse the repository at this point in the history
Adapt to the Python 3.12 final release
  • Loading branch information
wRAR committed Oct 3, 2023
2 parents 9ae8d97 + a338873 commit 5b0b002
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/tests-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 2 additions & 4 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_downloader_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def _test(response):
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)

Expand Down
3 changes: 0 additions & 3 deletions tests/test_feedexport.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ def _assert_stores(self, storage, path: Path, expected_content=b"content"):
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):
Expand Down
5 changes: 0 additions & 5 deletions tests/test_pipeline_files.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import dataclasses
import os
import random
import sys
import time
from datetime import datetime
from io import BytesIO
Expand All @@ -12,7 +11,6 @@
from urllib.parse import urlparse

import attr
import pytest
from itemadapter import ItemAdapter
from twisted.internet import defer
from twisted.trial import unittest
Expand Down Expand Up @@ -648,9 +646,6 @@ def test_blob_path_consistency(self):
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):
Expand Down

0 comments on commit 5b0b002

Please sign in to comment.