-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathpyproject.toml
More file actions
274 lines (254 loc) · 6.31 KB
/
pyproject.toml
File metadata and controls
274 lines (254 loc) · 6.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "scrapy-zyte-api"
version = "0.34.0"
description = "Client library to process URLs through Zyte API"
authors = [{name = "Zyte Group Ltd", email = "info@zyte.com"}]
license = "BSD-3-Clause"
readme = "README.rst"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
requires-python = ">=3.10"
# Sync with [min] @ tox.ini
dependencies = [
"packaging>=20.0",
"scrapy>=2.0.1",
"typing_extensions>=4.1.0",
"zyte-api>=0.6.0",
]
[project.optional-dependencies]
# Sync with [testenv:min-provider] @ tox.ini
provider = [
"andi>=0.6.0",
"scrapy-poet>=0.22.3",
"web-poet>=0.17.0",
"zyte-common-items>=0.27.0",
]
x402 = [
"zyte-api[x402]>=0.8.0",
"x402<2.0.0",
]
[project.urls]
source = "https://github.com/scrapy-plugins/scrapy-zyte-api"
docs = "https://scrapy-zyte-api.readthedocs.io/en/latest/"
[tool.bumpversion]
current_version = "0.34.0"
commit = true
tag = true
tag_name = "{new_version}"
[[tool.bumpversion.files]]
filename = 'CHANGES.rst'
search = "\\(unreleased\\)$"
replace = "({now:%Y-%m-%d})"
regex = true
[[tool.bumpversion.files]]
filename = "docs/conf.py"
[[tool.bumpversion.files]]
filename = "pyproject.toml"
parse = "version\\s*=\\s*['\"](?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
[[tool.bumpversion.files]]
filename = "scrapy_zyte_api/__version__.py"
[tool.coverage.run]
branch = true
include = [
"scrapy_zyte_api/*",
]
omit = [
"tests/*",
]
disable_warnings = [
"include-ignored",
]
[tool.hatch.build.targets.sdist]
include = [
"/docs",
"/scrapy_zyte_api",
"/tests",
"/CHANGES.rst",
"/tox.ini",
]
[tool.mypy]
check_untyped_defs = true
implicit_reexport = false
warn_no_return = false
warn_unused_ignores = true
files = [
"scrapy_zyte_api",
"tests"
]
[[tool.mypy.overrides]]
module = [
"pytest_twisted",
"scrapy_crawlera",
"scrapy_zyte_smartproxy",
]
ignore_missing_imports = true
# to be fixed
[[tool.mypy.overrides]]
module = "scrapy_poet.*"
implicit_reexport = true
[tool.pytest.ini_options]
junit_family = "xunit2"
testpaths = [
"scrapy_zyte_api/",
"tests/"
]
minversion = "6.0"
filterwarnings = [
"ignore::DeprecationWarning:twisted\\.web\\.http",
"ignore::DeprecationWarning:scrapy\\.core\\.downloader\\.contextfactory", # https://github.com/scrapy/scrapy/issues/3288
# scrapy-poet warnings for Scrapy 2.14:
"ignore:CollectorPipeline\\.:scrapy.exceptions.ScrapyDeprecationWarning",
"ignore:DownloaderStatsMiddleware\\.:scrapy.exceptions.ScrapyDeprecationWarning",
"ignore:.*?InjectionMiddleware\\.:scrapy.exceptions.ScrapyDeprecationWarning",
"ignore:RetryMiddleware\\.process_spider_exception\\(\\):scrapy.exceptions.ScrapyDeprecationWarning",
"ignore::scrapy.exceptions.ScrapyDeprecationWarning:scrapy_poet",
]
[tool.ruff.lint]
extend-select = [
# flake8-builtins
"A",
# flake8-async
"ASYNC",
# flake8-bugbear
"B",
# flake8-comprehensions
"C4",
# flake8-commas
"COM",
# pydocstyle
"D",
# flake8-future-annotations
"FA",
# flynt
"FLY",
# refurb
"FURB",
# isort
"I",
# flake8-implicit-str-concat
"ISC",
# flake8-logging
"LOG",
# Perflint
"PERF",
# pygrep-hooks
"PGH",
# flake8-pie
"PIE",
# pylint
"PL",
# flake8-pytest-style
"PT",
# flake8-use-pathlib
"PTH",
# flake8-pyi
"PYI",
# flake8-quotes
"Q",
# flake8-return
"RET",
# flake8-raise
"RSE",
# Ruff-specific rules
"RUF",
# flake8-bandit
"S",
# flake8-simplify
"SIM",
# flake8-slots
"SLOT",
# flake8-debugger
"T10",
# flake8-type-checking
"TC",
# pyupgrade
"UP",
# pycodestyle warnings
"W",
# flake8-2020
"YTT",
]
ignore = [
# Trailing comma missing
"COM812",
# Missing docstring in public module
"D100",
# Missing docstring in public class
"D101",
# Missing docstring in public method
"D102",
# Missing docstring in public function
"D103",
# Missing docstring in public package
"D104",
# Missing docstring in magic method
"D105",
# Missing docstring in public nested class
"D106",
# Missing docstring in __init__
"D107",
# One-line docstring should fit on one line with quotes
"D200",
# No blank lines allowed after function docstring
"D202",
# 1 blank line required between summary line and description
"D205",
# Multi-line docstring closing quotes should be on a separate line
"D209",
# First line should end with a period
"D400",
# First line should be in imperative mood; try rephrasing
"D401",
# First line should not be the function's "signature"
"D402",
# First word of the first line should be properly capitalized
"D403",
# No blank lines allowed between a section header and its content
"D412",
# `try`-`except` within a loop incurs performance overhead
"PERF203",
# Too many return statements
"PLR0911",
# Too many branches
"PLR0912",
# Too many arguments in function definition
"PLR0913",
# Too many statements
"PLR0915",
# Magic value used in comparison
"PLR2004",
# String contains ambiguous {}.
"RUF001",
# Docstring contains ambiguous {}.
"RUF002",
# Comment contains ambiguous {}.
"RUF003",
# Mutable class attributes should be annotated with `typing.ClassVar`
"RUF012",
# Use of `assert` detected
"S101",
]
[tool.ruff.lint.isort]
split-on-trailing-comma = false
[tool.ruff.lint.per-file-ignores]
# we need to use typing.Set[] over modern alternatives with web-poet<0.19.0 && Python<3.11
# see https://github.com/scrapinghub/web-poet/pull/219
"scrapy_zyte_api/providers.py" = ["UP006", "UP035"]
"tests/**" = ["S"]
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.sphinx-scrapy]
python-version = "3.13" # Keep in sync with .github/workflows/test.yml.