Skip to content

Commit ea195a7

Browse files
authored
Merge pull request #177 from scrapinghub/py3.12
Add Python 3.12 support.
2 parents 080019a + 96d2507 commit ea195a7

9 files changed

+43
-27
lines changed

.flake8

+28-14
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,34 @@ ignore =
1212
C408,
1313

1414
# To be addressed:
15-
D100, # Missing docstring in public module
16-
D101, # Missing docstring in public class
17-
D102, # Missing docstring in public method
18-
D103, # Missing docstring in public function
19-
D104, # Missing docstring in public package
20-
D105, # Missing docstring in magic method
21-
D107, # Missing docstring in __init__
22-
D200, # One-line docstring should fit on one line with quotes
23-
D202, # No blank lines allowed after function docstring
24-
D205, # 1 blank line required between summary line and description
25-
D209, # Multi-line docstring closing quotes should be on a separate line
26-
D400, # First line should end with a period
27-
D401, # First line should be in imperative mood
28-
D402 # First line should not be the function's "signature"
15+
# Missing docstring in public module
16+
D100,
17+
# Missing docstring in public class
18+
D101,
19+
# Missing docstring in public method
20+
D102,
21+
# Missing docstring in public function
22+
D103,
23+
# Missing docstring in public package
24+
D104,
25+
# Missing docstring in magic method
26+
D105,
27+
# Missing docstring in __init__
28+
D107,
29+
# One-line docstring should fit on one line with quotes
30+
D200,
31+
# No blank lines allowed after function docstring
32+
D202,
33+
# 1 blank line required between summary line and description
34+
D205,
35+
# Multi-line docstring closing quotes should be on a separate line
36+
D209,
37+
# First line should end with a period
38+
D400,
39+
# First line should be in imperative mood
40+
D401,
41+
# First line should not be the function's "signature"
42+
D402
2943

3044
per-file-ignores =
3145
# F401: Ignore "imported but unused" errors in __init__ files, as those

.github/workflows/publish.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1717
- name: Set up Python
18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v5
1919
with:
20-
python-version: '3.x'
20+
python-version: '3.12'
2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip

.github/workflows/test.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ jobs:
2828
- python-version: "3.9"
2929
- python-version: "3.10"
3030
- python-version: "3.11"
31-
- python-version: "3.11"
31+
- python-version: "3.12"
32+
- python-version: "3.12"
3233
toxenv: "asyncio"
3334

3435
steps:
35-
- uses: actions/checkout@v2
36+
- uses: actions/checkout@v4
3637
- name: Set up Python ${{ matrix.python-version }}
37-
uses: actions/setup-python@v2
38+
uses: actions/setup-python@v5
3839
with:
3940
python-version: ${{ matrix.python-version }}
4041
- name: Install dependencies
@@ -53,7 +54,7 @@ jobs:
5354
strategy:
5455
fail-fast: false
5556
matrix:
56-
python-version: ['3.11']
57+
python-version: ['3.12']
5758
tox-job: ["mypy", "docs", "linters", "twinecheck"]
5859

5960
steps:

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ repos:
1919
- flake8-docstrings
2020
- flake8-string-format
2121
repo: https://github.com/pycqa/flake8
22-
rev: 4.0.1
22+
rev: 6.1.0

.readthedocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sphinx:
66
build:
77
os: ubuntu-22.04
88
tools:
9-
python: "3.11" # Keep in sync with .github/workflows/tests.yml
9+
python: "3.12" # Keep in sync with .github/workflows/tests.yml
1010

1111
python:
1212
install:

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@
4343
"Programming Language :: Python :: 3.9",
4444
"Programming Language :: Python :: 3.10",
4545
"Programming Language :: Python :: 3.11",
46+
"Programming Language :: Python :: 3.12",
4647
],
4748
)

tests/test_injection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ def test_load_provider_classes():
430430
injector = get_injector_for_testing(
431431
{provider_as_string: 2, HttpResponseProvider: 1}
432432
)
433-
assert all(type(prov) == HttpResponseProvider for prov in injector.providers)
433+
assert all(type(prov) is HttpResponseProvider for prov in injector.providers)
434434
assert len(injector.providers) == 2
435435

436436

tests/test_middleware.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ def parse(
262262
@inlineCallbacks
263263
def test_multi_args_callbacks(settings):
264264
item, _, _ = yield crawl_single_item(MultiArgsCallbackSpider, ProductHtml, settings)
265-
assert type(item["product"]) == ProductPage
266-
assert type(item["provided"]) == ProvidedWithDeferred
265+
assert type(item["product"]) is ProductPage
266+
assert type(item["provided"]) is ProvidedWithDeferred
267267
assert item["cb_arg"] == "arg!"
268268
assert item["cb_arg2"] is False
269269
assert item["non_cb_arg"] is None

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = min,py38,py39,py310,py311,asyncio,asyncio-min,mypy,docs
2+
envlist = min,py38,py39,py310,py311,py312,asyncio,asyncio-min,mypy,docs
33

44
[testenv]
55
deps =

0 commit comments

Comments
 (0)