-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
245 lines (225 loc) · 7.13 KB
/
pyproject.toml
File metadata and controls
245 lines (225 loc) · 7.13 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
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[tool.towncrier]
directory = "changes"
package = "ckan"
filename = "CHANGELOG.rst"
title_format = "v.{version} {project_date}"
issue_format = "`#{issue} <https://github.com/ckan/ckan/pull/{issue}>`_"
wrap = true
[[tool.towncrier.type]]
directory = 'migration'
name = 'Migration notes'
showcontent = true
[[tool.towncrier.type]]
directory = 'feature'
name = 'Major features'
showcontent = true
[[tool.towncrier.type]]
directory = 'misc'
name = 'Minor changes'
showcontent = true
[[tool.towncrier.type]]
directory = 'bugfix'
name = 'Bugfixes'
showcontent = true
[[tool.towncrier.type]]
directory = 'removal'
name = 'Removals and deprecations'
showcontent = true
[tool.pytest.ini_options]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::bs4.GuessedAtParserWarning", # using lxml as default parser
]
markers = [
"ckan_config: patch configuration used by other fixtures via (key, value) pair.",
"provide_plugin: register class as a plugin",
"with_plugins: enable specified plugins",
]
testpaths = ["ckan", "ckanext"]
log_cli = false
addopts = "--capture=no --strict-markers --pdbcls=IPython.terminal.debugger:TerminalPdb --ckan-ini=test-core.ini"
[tool.pyright]
pythonVersion = "3.10"
include = ["ckan", "ckanext"]
exclude = [
"**/test*",
"**/migration",
"ckan/lib/create_test_data.py"
]
strict = []
strictParameterNoneValue = true # type must be Optional if default value is None
# Check the meaning of rules here
# https://github.com/microsoft/pyright/blob/main/docs/configuration.md
reportFunctionMemberAccess = true # non-standard member accesses for functions
reportMissingImports = true
reportMissingModuleSource = true
reportMissingTypeStubs = false
reportImportCycles = false
reportUnusedImport = true
reportUnusedClass = true
reportUnusedFunction = true
reportUnusedVariable = true
reportDuplicateImport = true
reportOptionalSubscript = true
reportOptionalMemberAccess = true
reportOptionalCall = true
reportOptionalIterable = true
reportOptionalContextManager = true
reportOptionalOperand = true
# We are using Context in a way that conflicts with this check
reportTypedDictNotRequiredAccess = false
reportConstantRedefinition = true
reportIncompatibleMethodOverride = false
reportIncompatibleVariableOverride = false
reportOverlappingOverload = true
reportUntypedFunctionDecorator = false
reportUnknownParameterType = true
reportUnknownArgumentType = false
reportUnknownLambdaType = false
reportUnknownMemberType = false
reportMissingTypeArgument = true
reportInvalidTypeVarUse = true
reportCallInDefaultInitializer = true
reportUnknownVariableType = false
reportUntypedBaseClass = true
reportUnnecessaryIsInstance = true
reportUnnecessaryCast = true
reportUnnecessaryComparison = true
reportAssertAlwaysTrue = true
reportSelfClsParameterName = true
reportUnusedCallResult = false # allow function calls for side-effect only (like logic.check_acces)
useLibraryCodeForTypes = true
reportGeneralTypeIssues = true
reportPropertyTypeMismatch = true
reportWildcardImportFromLibrary = true
reportUntypedClassDecorator = false # authenticator relies on repoze.who class-decorator
reportUntypedNamedTuple = true
reportPrivateUsage = false # TODO: do not access private members in CKAN's codebase
reportPrivateImportUsage = true
reportInconsistentConstructor = true
reportMissingSuperCall = false
reportUninitializedInstanceVariable = false
reportInvalidStringEscapeSequence = true
reportMissingParameterType = true
reportImplicitStringConcatenation = false
reportUndefinedVariable = true
reportUnboundVariable = true
reportInvalidStubStatement = true
reportIncompleteStub = true
reportUnsupportedDunderAll = true
reportUnusedCoroutine = true
reportUnnecessaryTypeIgnoreComment = true
reportMatchNotExhaustive = true
[tool.mypy]
files = "ckan"
exclude = "ckan/(pastertemplates|tests|migration)"
[[tool.mypy.overrides]]
ignore_missing_imports = true
module = [
"babel.*",
"blinker.*",
"cookiecutter.*",
"dominate.*",
"feedgen.*",
"flask_babel.*",
"flask_debugtoolbar.*",
"flask_multistatic.*",
"passlib.*",
"pysolr.*",
"repoze.*",
"rq.*",
"webassets.*",
"zope.*",
]
[tool.ruff]
line-length = 88
exclude = [".*", "./bin", "./contrib", "./node_modules"]
extend-exclude = [
# These should be removed once linting is passed for them
"ckan/lib/app_globals.py",
"ckan/lib/cli.py",
"ckan/lib/create_test_data.py",
"ckan/lib/dictization/model_dictize.py",
"ckan/lib/dictization/model_save.py",
"ckan/lib/jinja_extensions.py",
"ckan/lib/maintain.py",
"ckan/lib/navl/validators.py",
"ckan/lib/plugins.py",
"ckan/lib/search/__init__.py",
"ckan/lib/search/index.py",
"ckan/lib/search/query.py",
"ckan/logic/action/delete.py",
"ckan/logic/action/get.py",
"ckan/logic/action/update.py",
"ckan/logic/auth/create.py",
"ckan/logic/auth/delete.py",
"ckan/logic/auth/get.py",
"ckan/logic/auth/update.py",
"ckan/logic/converters.py",
"ckan/logic/validators.py",
"ckan/model/__init__.py",
"ckan/model/dashboard.py",
"ckan/model/domain_object.py",
"ckan/model/follower.py",
"ckan/model/group.py",
"ckan/model/group_extra.py",
"ckan/model/license.py",
"ckan/model/meta.py",
"ckan/model/misc.py",
"ckan/model/modification.py",
"ckan/model/package.py",
"ckan/model/package_extra.py",
"ckan/model/package_relationship.py",
"ckan/model/resource.py",
"ckan/model/system_info.py",
"ckan/model/tag.py",
"ckan/model/task_status.py",
"ckan/model/user.py",
"ckan/model/vocabulary.py",
"ckan/authz.py",
"ckanext/datastore/logic/action.py",
"ckanext/datastore/tests/test_create.py",
"ckanext/example_idatasetform/plugin.py",
"ckanext/multilingual/plugin.py",
"ckanext/stats/stats.py",
"doc/conf.py",
]
[tool.ruff.lint]
select = ["E", "F", "W", "C901", "G", "PLW0602"]
[tool.ruff.lint.per-file-ignores]
# These should be fixed
# E731 is lambda assignment
# PLW0602 is global variable without assignment, F824 in flake8
"test_*.py" = ["E501"]
"ckan/lib/helpers.py" = ["PLW0602", "E731", "C901"]
"ckan/lib/jobs.py" = ["PLW0602"]
"ckan/lib/dictization/__init__.py" = ["E731"]
# Files that are too complex
"ckanext/tabledesigner/views.py" = ["C901"]
"ckanext/resourceproxy/blueprint.py" = ["C901"]
"ckanext/datatablesview/blueprint.py" = ["C901"]
"ckanext/datastore/plugin.py" = ["C901"]
"ckanext/datastore/blueprint.py" = ["C901"]
"ckanext/datastore/backend/postgres.py" = ["C901", "E731"]
"ckanext/datapusher/logic/action.py" = ["C901"]
"ckanext/activity/views.py" = ["C901"]
"ckanext/activity/changes.py" = ["C901"]
"ckan/views/resource.py" = ["C901"]
"ckan/views/dataset.py" = ["C901"]
"ckan/views/api.py" = ["C901"]
"ckan/views/__init__.py" = ["C901"]
"ckan/model/base.py" = ["C901", "E731"]
"ckan/logic/action/create.py" = ["C901"]
"ckan/logic/__init__.py" = ["C901"]
"ckan/lib/navl/dictization_functions.py" = ["C901"]
"ckan/lib/mailer.py" = ["C901"]
"ckan/lib/config_tool.py" = ["C901"]
"ckan/config/middleware/flask_app.py" = ["C901"]
"ckan/config/environment.py" = ["C901"]
"ckan/config/declaration/serialize.py" = ["C901"]
"ckan/config/declaration/load.py" = ["C901"]
"ckan/cli/views.py" = ["C901"]
"ckan/cli/plugin_info.py" = ["C901"]