-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
442 lines (419 loc) · 12.5 KB
/
pyproject.toml
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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
[tool.poetry]
name = "django-import-export-extensions"
version = "1.2.0"
description = "Extend functionality of `django-import-export`"
license = "MIT"
authors = ["Saritasa <[email protected]>"]
maintainers = [
"Nikita Azanov <[email protected]>",
"Andrey Otto <[email protected]>",
"Stanislav Khlud <[email protected]>",
"Egor Toryshak <[email protected]",
]
readme = "README.md"
repository = "https://github.com/saritasa-nest/django-import-export-extensions"
documentation = "https://django-import-export-extensions.readthedocs.io"
keywords = [
"python",
"json",
"django",
"csv",
"xlsx",
"celery",
"import_export",
"django_import_export_extensions",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development",
"Framework :: Django",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"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",
"Programming Language :: Python :: 3 :: Only",
]
packages = [{ include = "import_export_extensions" }]
[tool.poetry.dependencies]
python = "^3.10"
django = ">=4.2"
django-import-export = { extras = ["xls", "xlsx"], version = ">=4.2" }
# Django REST Framework
# https://www.django-rest-framework.org/
djangorestframework = "^3.15.2"
# OpenApi auto specs generator
# https://drf-spectacular.readthedocs.io/en/latest/
drf-spectacular = ">=0.27.1,<0.29.0"
# Filter querysets dynamically
# https://django-filter.readthedocs.io/en/stable/
django-filter = "^24.3"
# Different useful Django utils
# https://django-extensions.readthedocs.io/en/latest/
django-extensions = "^3.2.3"
# Implementation of a pickled object field in django
# https://github.com/gintas/django-picklefield
django-picklefield = "^3.2"
# Celery
# https://docs.celeryproject.org/en/stable/
celery = { extras = ["redis"], version = "^5.4.0" }
# HTTP library for Python
# https://requests.readthedocs.io/en/latest/
requests = "^2.32.3"
[tool.poetry.group.dev.dependencies]
ipdb = "^0.13.13"
ipython = "^8.27.0"
# The Django Debug Toolbar is a configurable set of panels that display various debug information
# about the current request/response and when clicked, display more details about the panel's content.
# https://django-debug-toolbar.readthedocs.io/en/latest/
django-debug-toolbar = "^4.4.6"
# Decouple helps configure settings using env variables and .env files
# https://github.com/HBNetwork/python-decouple
python-decouple = "^3.8"
[tool.poetry.group.linters.dependencies]
# Mypy is a static type checker for Python.
# https://mypy.readthedocs.io/en/stable/
mypy = "^1.11.2"
# This is a PEP 561 type stub package for the `requests` package
# https://pypi.org/project/types-requests/
types-requests = "^2.32.0.20240905"
[tool.poetry.group.test.dependencies]
# Provides a Django management command to check whether the primary database is ready to accept connections.
# https://pypi.org/project/django-probes/
django-probes = "^1.7.0"
# Plugin for pytest that provides a set of useful tools for testing Django applications and projects
# https://pytest-django.readthedocs.io/en/latest/
pytest-django = "^4.9.0"
# This plugin provides a mocker fixture for pytest
# https://pypi.org/project/pytest-mock/
pytest-mock = "^3.14.0"
# Allows you to use fixtures in @pytest.mark.parametrize.
# https://pypi.org/project/pytest-lazy-fixtures/
pytest-lazy-fixtures = "^1.1.1"
# Package for generating test data
# https://factoryboy.readthedocs.io/en/stable/
factory-boy = "^3.3.1"
# Werkzeug is a comprehensive WSGI web application library
# https://werkzeug.palletsprojects.com/en/3.0.x/
werkzeug = "^3.0.4"
# This plugin produces coverage reports.
# https://pytest-cov.readthedocs.io/en/latest/index.html
pytest-cov = ">=5,<7"
# Psycopg is a PostgreSQL adapter for the Python
# https://www.psycopg.org/docs/install.html
psycopg2-binary = "^2.9.9"
[tool.poetry.group.docs.dependencies]
# Package for documnation generation
# https://www.sphinx-doc.org/en/master/
sphinx = "<9"
# Theme for documentation
# https://github.com/pradyunsg/furo
furo = "^2024.8.6"
[tool.poetry.group.local.dependencies]
# A Python library for parsing and creating TOML
# https://pypi.org/project/toml/
toml = "^0.10.2"
# A framework for managing and maintaining multi-language pre-commit hooks.
# https://pre-commit.com/
pre-commit = ">=3.8,<5.0"
# Collection of invoke commands which used in Saritasa organization
# https://github.com/saritasa-nest/saritasa-python-invocations/
saritasa-invocations = "^1.2.1"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
line-length = 79
indent-width = 4
target-version = "py310"
[tool.ruff.lint]
extend-select = [
# https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
"W",
"E",
# https://docs.astral.sh/ruff/rules/#mccabe-c90
"C90",
# https://docs.astral.sh/ruff/rules/#isort-i
"I",
# https://docs.astral.sh/ruff/rules/#pep8-naming-n
"N",
# https://docs.astral.sh/ruff/rules/#pydocstyle-d
"D",
# https://docs.astral.sh/ruff/rules/#pyupgrade-up
"UP",
# https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ANN",
# https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"S",
# https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"B",
# https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"A",
# https://docs.astral.sh/ruff/rules/#flake8-commas-com
"COM",
# https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"C4",
# https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"DTZ",
# https://docs.astral.sh/ruff/rules/#flake8-debugger-t10
"T10",
# https://docs.astral.sh/ruff/rules/#flake8-django-dj
"DJ",
# https://docs.astral.sh/ruff/rules/#flake8-print-t20
"T20",
# https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"PT",
# https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"SIM",
# https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"PTH",
# https://docs.astral.sh/ruff/rules/#flake8-todos-td
"TD",
# https://docs.astral.sh/ruff/rules/#eradicate-era
"ERA",
# https://docs.astral.sh/ruff/rules/#tryceratops-try
"TRY",
# https://docs.astral.sh/ruff/rules/#flynt-fly
"FLY",
# https://docs.astral.sh/ruff/rules/#perflint-perf
"PERF",
# https://docs.astral.sh/ruff/rules/#refurb-furb
"FURB",
# https://docs.astral.sh/ruff/rules/#flake8-pie-pie
"PIE",
# https://docs.astral.sh/ruff/rules/#flake8-async-async
"ASYNC",
# https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"RUF",
]
ignore = [
# https://docs.astral.sh/ruff/rules/missing-type-args
"ANN002",
# https://docs.astral.sh/ruff/rules/missing-type-self
"ANN101",
# https://docs.astral.sh/ruff/rules/missing-type-cls
"ANN102",
# https://docs.astral.sh/ruff/rules/missing-type-kwargs
"ANN003",
# https://docs.astral.sh/ruff/rules/any-type
"ANN401",
# https://docs.astral.sh/ruff/rules/undocumented-public-module
"D100",
# https://docs.astral.sh/ruff/rules/undocumented-public-package
"D104",
# https://docs.astral.sh/ruff/rules/undocumented-magic-method
"D105",
# https://docs.astral.sh/ruff/rules/undocumented-public-nested-class
"D106",
# https://docs.astral.sh/ruff/rules/undocumented-public-init
"D107",
# https://docs.astral.sh/ruff/rules/one-blank-line-before-class
"D203",
# https://docs.astral.sh/ruff/rules/multi-line-summary-second-line
"D213",
# https://docs.astral.sh/ruff/rules/escape-sequence-in-docstring/
"D301",
# https://docs.astral.sh/ruff/rules/dashed-underline-after-section
"D407",
# https://docs.astral.sh/ruff/rules/undocumented-param/
"D417",
# https://docs.astral.sh/ruff/rules/error-suffix-on-exception-name
"N818",
# https://docs.astral.sh/ruff/rules/invalid-module-name
"N999",
# https://docs.astral.sh/ruff/rules/unnecessary-collection-call
"C408",
# https://docs.astral.sh/ruff/rules/mutable-class-default
"RUF012",
# https://docs.astral.sh/ruff/rules/raise-vanilla-args
"TRY003",
# https://docs.astral.sh/ruff/rules/try-consider-else
"TRY300",
# https://docs.astral.sh/ruff/rules/missing-trailing-comma
"COM812", # ruff formatter suggested to exclude it
# https://docs.astral.sh/ruff/rules/try-except-in-loop/
"PERF203",
# TODO: remove after fix:
# https://docs.astral.sh/ruff/rules/missing-type-function-argument/
"ANN001",
# https://docs.astral.sh/ruff/rules/missing-return-type-undocumented-public-function/
"ANN201",
# https://docs.astral.sh/ruff/rules/missing-return-type-private-function/
"ANN202",
# https://docs.astral.sh/ruff/rules/missing-return-type-special-method/
"ANN204",
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
# https://docs.astral.sh/ruff/rules/unused-import
"F401",
]
"**/settings.py" = [
# https://docs.astral.sh/ruff/rules/line-too-long
"E501",
]
"**/test_project/*" = [
# https://docs.astral.sh/ruff/rules/assert
"S101",
# https://docs.astral.sh/ruff/rules/hardcoded-password-func-arg
"S106",
# https://docs.astral.sh/ruff/rules/suspicious-non-cryptographic-random-usage
"S311",
]
"**/test_*" = [
# https://docs.astral.sh/ruff/rules/missing-return-type-undocumented-public-function
"ANN201",
]
"**/migrations/*" = [
# https://docs.astral.sh/ruff/rules/undocumented-public-class
"D101",
# https://docs.astral.sh/ruff/rules/line-too-long
"E501",
]
"**/views**" = [
# https://docs.astral.sh/ruff/rules/ANN201
"ANN001",
# https://docs.astral.sh/ruff/rules/ANN201
"ANN201",
]
"**/admin**" = [
# https://docs.astral.sh/ruff/rules/missing-type-function-argument
"ANN001",
# https://docs.astral.sh/ruff/rules/missing-return-type-undocumented-public-function
"ANN201",
]
"**/api**" = [
# https://docs.astral.sh/ruff/rules/missing-type-function-argument
"ANN001",
# https://docs.astral.sh/ruff/rules/missing-return-type-undocumented-public-function
"ANN201",
# https://docs.astral.sh/ruff/rules/missing-return-type-private-function
"ANN202",
]
"tasks.py" = [
# https://docs.astral.sh/ruff/rules/hardcoded-password-func-arg
"S106",
]
"**/apps.py" = [
# https://docs.astral.sh/ruff/rules/undocumented-public-method
"D102",
]
"**/docs**" = [
# https://docs.astral.sh/ruff/rules/builtin-variable-shadowing/
"A001",
]
[tool.ruff.lint.isort]
force-wrap-aliases = true
split-on-trailing-comma = true
section-order = [
"future",
"standard-library",
"django",
"drf",
"third-party",
"first-party",
"apps",
"local-folder",
]
[tool.ruff.lint.isort.sections]
django = ["django"]
drf = ["rest_framework"]
apps = [
"apps",
"config",
"libs",
]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
parametrize-names-type = "list"
parametrize-values-type = "list"
parametrize-values-row-type = "list"
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
exclude = [
# Disabling for admin since it's just configs and black/ruff format one item
# tuples as one line
"**/admin.py",
"**/views.py",
"**/admin/*",
"**/views/*",
]
[tool.mypy]
ignore_missing_imports = true
implicit_optional = false
warn_no_return = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_configs = true
allow_redefinition = false
disallow_any_generics = true
strict_equality = true
strict_optional = true
ignore_errors = false
local_partial_types = true
enable_error_code = [
"truthy-bool",
"redundant-expr",
]
disable_error_code = [
"attr-defined",
"index",
"annotation-unchecked",
]
exclude = [
"settings.py",
"docs/",
]
[[tool.mypy.overrides]]
module = "test_project.*"
warn_unreachable = false
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "test_project.settings"
python_files = [
"tests.py",
"test_*.py",
"*_tests.py",
]
addopts = [
"--ff",
"--capture=no",
"--verbose",
"--cov-config=pyproject.toml",
"--cov-report=lcov:coverage.lcov",
"--cov-report=term-missing:skip-covered",
]
[tool.coverage.run]
source = [
"import_export_extensions",
]
omit = [
"**/invocations/**",
"**/migrations/**",
"**/__init__.py",
"test_project/**",
"tasks.py",
]
[tool.coverage.report]
exclude_also = [
"def __repr__",
"def __str__",
"pass",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]