-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathpyproject.toml
163 lines (151 loc) · 6.34 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
[tool.poetry]
name = "mysagw"
version = "0.2.0"
description = "Application management for SAGW"
repository = "https://github.com/adfinis/mySAGW"
authors = ["Adfinis"]
license = "GPL-3.0-or-later"
[tool.poetry.dependencies]
python = "^3.9"
django = "^4.2.18"
django-countries = "^7.5.1"
django-environ = "^0.11.2"
django-excel = "^0.0.10"
django-filter = "^24.1"
django-localized-fields = "^6.7"
django-phonenumber-field = {extras = ["phonenumberslite"], version = "^8.0.0"}
django-postgres-extra = "^2.0.8"
django-simple-history = "^3.5.0"
django-watchman = "^1.3.0"
djangorestframework = "^3.15.2"
djangorestframework-jsonapi = "^7.0.2"
drf-extra-fields = "^3.5.0"
gunicorn = "^22.0.0"
mozilla-django-oidc = "^4.0.1"
openpyxl = "3.0.10" # TODO: dependency of `pyexcel-xlsx`. Remove as soon as https://github.com/pyexcel/pyexcel-xlsx/issues/52 is resolved
psycopg2-binary = "^2.9.10"
pyexcel = "^0.7.0"
pyexcel-xlsx = "^0.6.0"
pypdf = "^4.1.0"
requests = "^2.32.2"
reportlab = "^4.1.0"
setuptools = "75.5.0" # needed for django-excel. Pinned because of build errors. See https://github.com/adfinis/mySAGW/issues/1176
[tool.poetry.group.dev.dependencies]
django-extensions = "^3.2.3"
factory-boy = "^3.3.1"
freezegun = "^1.5.0"
gitlint = "^0.19.1"
pdbpp = "^0.10.3"
pre-commit = "^3.6.2"
psycopg2-binary = "^2.9.6"
pytest = "^8.3.3"
pytest-cov = "^5.0.0"
pytest-django = "^4.9.0"
pytest-env = "^1.1.4"
pytest-factoryboy = "^2.7.0"
pytest-freezer = "^0.4.8"
pytest-mock = "^3.10.0"
pytest-randomly = "^3.12.0"
requests-mock = "^1.10.0"
ruff = "^0.5.7"
syrupy = "^4.7.1"
[tool.ruff]
exclude = [
"migrations",
"snapshots",
]
line-length = 88
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"A003", # `flake8-builtins` - Class attribute {name} is shadowing a Python builtin
"ANN", # `flake8-annotations`
"ARG", # `flake8-unused-arguments`
"COM812", # handled by ruff format
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in __init__
"D202", # No blank lines allowed after function docstring (found {num_lines})
"D203", # 1 blank line required before class docstring
"D212", # Multi-line docstring summary should start at the first line
"DJ001", # flake8-django` - Avoid using null=True on string-based fields
"E501", # Line too long ({width} > {limit} characters) - managed by ruff format
"ERA001", # eradicate - Found commented-out code
"FA100", # `future-rewritable-type-annotation` - obsolete in python >= 3.9
"FBT002", # `flake8-boolean-trap` - Boolean default positional argument in function definition
"FBT003", # Boolean positional value in function call
"FIX", # `flake8-fixme`
"ISC001", # handled by ruff format
"N818", # Exception name {name} should be named with an Error suffix - https://github.com/astral-sh/ruff/issues/5367
"PERF203", # `try-except-in-loop` - obsolete in python >= 3.11
"PGH005", # doesn't work correctly with `requests-mock`
"PLR0913", # Too many arguments to function call
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"PT006", # Wrong name(s) type in @pytest.mark.parametrize, expected {expected}
"PT017", # Found assertion on exception {name} in except block, use pytest.raises() instead
"PLW2901", # `for` loop variable `search_term` overwritten by assignment target
"RET502", # Do not implicitly return None in function able to return non-None value
"RET503", # Missing explicit return at the end of function able to return non-None value
"RUF001", # ambiguous-unicode-character-string
"RUF012", # Mutable class attributes should be annotated with typing.ClassVar
"S101", # Use of assert detected
"TD002", # missing-todo-author
"TD003", # missing-todo-link
"TID252", # banned-module-level-imports
]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.isort]
known-first-party = ["mysagw", "caluma"]
combine-as-imports = true
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
[tool.ruff.lint.per-file-ignores]
"manage.py" = ["INP001"]
[tool.pytest.ini_options]
addopts = "--reuse-db --randomly-seed=1521188766 --randomly-dont-reorganize"
DJANGO_SETTINGS_MODULE = "mysagw.settings"
env = [
"ADMINS=Test Example <test@example.com>,Test2 <test2@example.com>",
"OIDC_OP_USER_ENDPOINT=mock://mysagw.github.com/openid/userinfo",
"OIDC_BEARER_TOKEN_REVALIDATION_TIME=60",
]
filterwarnings = [
"error::DeprecationWarning",
"error::PendingDeprecationWarning",
"ignore:invalid escape sequence", # needed for deprecation == "2.0.7" (dependency of localized-fields)
"ignore:pkg_resources is deprecated as an API:DeprecationWarning", # needed until this is resolved: https://github.com/SmileyChris/django-countries/issues/439
"ignore:distutils Version classes are deprecated. Use packaging.version instead.:DeprecationWarning", # issue in pytest-freezegun
"ignore:LocalizedAutoSlug is deprecated and will be removed in the next major version:DeprecationWarning",
"ignore:'django_extensions' defines default_app_config:PendingDeprecationWarning", # deprecation in django_extensions
"ignore:CSR support in pyOpenSSL is deprecated. You should use the APIs in cryptography.:DeprecationWarning", # deprecation in a dependency of mozilla-django-oidc
"ignore:ast.NameConstant is deprecated and will be removed in Python 3.14; use ast.Constant instead:DeprecationWarning", # deprecation from reportlab
"ignore:.*Use timezone-aware objects to represent datetimes in UTC.*:DeprecationWarning", # deprecation in openpyxl
]
[tool.coverage.run]
source = ["."]
[tool.coverage.report]
fail_under = 100
exclude_lines = [
"pragma: no cover",
"pragma: todo cover",
"def __str__",
"def __unicode__",
"def __repr__",
]
omit = [
"*/migrations/*",
"*/apps.py",
"manage.py",
"mysagw/settings_*.py",
"mysagw/wsgi.py",
]
show_missing = true
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"