-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathpyproject.toml
More file actions
185 lines (163 loc) · 4.58 KB
/
Copy pathpyproject.toml
File metadata and controls
185 lines (163 loc) · 4.58 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
[project]
name = "diracx"
description = "Client installation for users of DiracX installations"
readme = "README.md"
requires-python = ">=3.11"
keywords = []
license = { text = "GPL-3.0-only" }
classifiers = [
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: System :: Distributed Computing",
]
dependencies = ["diracx-api", "diracx-cli", "diracx-client", "diracx-core"]
dynamic = ["version"]
[project.optional-dependencies]
testing = ["diracx-testing"]
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.targets.wheel]
bypass-selection = true
[tool.ruff]
src = ["diracx-*/src", "diracx-*/tests"]
exclude = ["diracx-client/src/diracx/client"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"B", # flake8-bugbear
"I", # isort
"PLE", # pylint errors
"D", # pydocstyle
# "UP", # pyUpgrade
"FLY", # flynt
"DTZ", # flake8-datetimez
"S", # flake8-bandit
"N", # pep8-naming
"INP", # flake8-no-implicit-namespace-packages
"RUF022",
"TID251", # flake8-tidy-imports.banned-api
]
ignore = [
"B905",
"B006",
"S101", # bandit: use of assert https://docs.astral.sh/ruff/rules/assert/
# TODO: Maybe enable these
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D107",
]
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.per-file-ignores]
# Ignore Bandit security checks in the test directories
"diracx-testing/*" = ["S"]
# Test directories must not contain __init__.py: with pytest's
# import-mode=importlib, packages with common names (e.g. tests/jobs) collide
# in sys.modules when several diracx-* packages are collected in one run
"diracx-*/tests/*" = ["S", "INP"]
[tool.ruff.lint.extend-per-file-ignores]
"diracx-routers/src/diracx/routers/access_policies.py" = ["I002"]
# Namespace package roots and standalone scripts intentionally lack __init__.py
"*/src/diracx/_client_importer.py" = ["INP001"]
".github/workflows/*.py" = ["INP001"]
[tool.ruff.lint.flake8-bugbear]
# Allow default arguments like, e.g., `data: List[str] = fastapi.Query(None)`.
extend-immutable-calls = [
"fastapi.Depends",
"fastapi.Query",
"fastapi.Path",
"fastapi.Body",
"fastapi.Header",
]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"fastapi.status".msg = "Use http.HTTPStatus instead"
[tool.ruff.lint.pycodestyle]
max-line-length = 120
[tool.ruff.format]
docstring-code-format = true
[tool.isort]
profile = "black"
[tool.codespell]
skip = [
"diracx-client/src/diracx/client/_generated/*",
"diracx-[a-z]*/tests/*",
"diracx-testing/*",
"extensions/gubbins/gubbins-client/src/gubbins/client/_generated/*",
"extensions/gubbins/gubbins-*/tests/*",
]
ignore-words-list = ["CheckIn", "dependant"]
[tool.mypy]
python_version = "3.11"
strict = false
files = [
"diracx-api/src/**/*.py",
"diracx-cli/src/**/*.py",
"diracx-client/src/**/_patch.py",
"diracx-core/src/**/*.py",
"diracx-db/src/**/*.py",
"diracx-logic/src/**/*.py",
"diracx-routers/src/**/*.py",
"diracx-tasks/src/**/*.py",
]
mypy_path = [
"$MYPY_CONFIG_FILE_DIR/diracx-api/src",
"$MYPY_CONFIG_FILE_DIR/diracx-cli/src",
"$MYPY_CONFIG_FILE_DIR/diracx-client/src",
"$MYPY_CONFIG_FILE_DIR/diracx-core/src",
"$MYPY_CONFIG_FILE_DIR/diracx-db/src",
"$MYPY_CONFIG_FILE_DIR/diracx-logic/src",
"$MYPY_CONFIG_FILE_DIR/diracx-routers/src",
"$MYPY_CONFIG_FILE_DIR/diracx-tasks/src",
]
plugins = ["sqlalchemy.ext.mypy.plugin", "pydantic.mypy"]
allow_redefinition = true
explicit_package_bases = true
# disallow_untyped_defs = true
# strict = true
enable_error_code = ["import", "attr-defined", "redundant-expr", "truthy-bool"]
[[tool.mypy.overrides]]
module = 'DIRACCommon.*'
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = 'sh.*'
ignore_missing_imports = true
[tool.pytest.ini_options]
minversion = "8"
log_cli_level = "INFO"
xfail_strict = true
filterwarnings = ["default"]
testpaths = [
"diracx-api/tests",
"diracx-cli/tests",
"diracx-client/tests",
"diracx-core/tests",
"diracx-db/tests",
"diracx-logic/tests",
"diracx-routers/tests",
"diracx-tasks/tests",
]
addopts = [
"-v",
"--cov=diracx",
"--cov-report=term-missing",
"-pdiracx.testing",
"-pdiracx.testing.osdb",
"--import-mode=importlib",
"-ra",
"--strict-config",
"--strict-markers",
]
asyncio_mode = "auto"
markers = [
"enabled_dependencies: List of dependencies which should be available to the FastAPI test client",
]