-
Notifications
You must be signed in to change notification settings - Fork 107
/
pyproject.toml
176 lines (164 loc) · 5.73 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
[tool.pytest.ini_options]
addopts = "--reuse-db -p no:cacheprovider"
DJANGO_SETTINGS_MODULE="settings.test"
norecursedirs = ".svn _build tmp* node_modules bower_components share .tox"
[tool.coverage.run]
omit = [
"**/src/archivematicaCommon/lib/externals/*",
"**/migrations/*",
"**/south_migrations/*",
"**/management/commands/*",
"**/settings/*",
"**/tests/*",
"**/wsgi.py",
"**/manage.py",
]
include = [
"**/src/archivematicaCommon/lib/*",
"**/src/dashboard/src/*",
"**/src/MCPClient/lib/*",
"**/src/MCPClient/lib/clientScripts/*",
"**/src/MCPServer/lib/*",
]
branch = true
[tool.ruff.lint]
# Rule reference: https://docs.astral.sh/ruff/rules/
select = [
"B",
"C4",
"E",
"F",
"I",
"UP",
"W",
]
ignore = [
"B018",
"B904",
"E402",
"E501",
"UP031",
]
[tool.ruff.lint.per-file-ignores]
"src/*/settings/*" = ["F403"]
"src/dashboard/src/settings/*" = ["F405"]
[tool.ruff.lint.isort]
force-single-line = true
[tool.mypy]
explicit_package_bases = true
warn_redundant_casts = true
warn_unused_configs = true
[[tool.mypy.overrides]]
module = [
"src.archivematicaCommon.lib.executeOrRunSubProcess",
"src.MCPClient.lib.client.*",
"src.MCPClient.lib.clientScripts.characterize_file",
"src.MCPClient.lib.clientScripts.has_packages",
"src.MCPClient.lib.clientScripts.identify_file_format",
"src.MCPClient.lib.clientScripts.normalize",
"src.MCPClient.lib.clientScripts.policy_check",
"src.MCPClient.lib.clientScripts.transcribe_file",
"src.MCPClient.lib.clientScripts.validate_file",
"tests.archivematicaCommon.test_execute_functions",
"tests.dashboard.components.accounts.test_views",
"tests.dashboard.components.administration.test_administration",
"tests.dashboard.fpr.test_views",
"tests.dashboard.test_oidc",
"tests.integration.test_oidc_auth",
"tests.MCPClient.conftest",
"tests.MCPClient.test_characterize_file",
"tests.MCPClient.test_has_packages",
"tests.MCPClient.test_identify_file_format",
"tests.MCPClient.test_normalize",
"tests.MCPClient.test_policy_check",
"tests.MCPClient.test_transcribe_file",
"tests.MCPClient.test_validate_file",
]
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
no_implicit_reexport = true
strict_equality = true
warn_return_any = true
warn_unused_ignores = true
[tool.tox]
legacy_tox_ini = """
[tox]
skipsdist = True
envlist =
archivematica-common
dashboard
mcp-server
mcp-client
storage-service
migrations-dashboard
migrations-storage-service
linting
[testenv]
skip_install = True
deps = -r{toxinidir}/requirements-dev.txt
commands = py.test {posargs}
allowlist_externals =
bash
find
setenv =
# General
LOGNAME = user
DJANGO_SETTINGS_MODULE = {env:DJANGO_SETTINGS_MODULE:settings.test}
PYTEST_ADDOPTS = {env:PYTEST_ADDOPTS:}
SRC_DIR = {toxinidir}/src
HACK_DIR = {toxinidir}/hack
# Archivematica Common
ARCHIVEMATICA_COMMON_ROOT = {env:SRC_DIR}/archivematicaCommon
ARCHIVEMATICA_COMMON_DIR = {env:ARCHIVEMATICA_COMMON_ROOT}/lib
# Dashboard
DASHBOARD_ROOT = {env:SRC_DIR}/dashboard
DASHBOARD_DIR = {env:DASHBOARD_ROOT}/src
DASHBOARD_PYTHONPATH = {env:DASHBOARD_DIR}:{env:ARCHIVEMATICA_COMMON_DIR}
# MCP Server
MCPSERVER_ROOT = {env:SRC_DIR}/MCPServer
MCPSERVER_DIR = {env:MCPSERVER_ROOT}/lib
MCPSERVER_PYTHONPATH = {env:MCPSERVER_DIR}:{env:ARCHIVEMATICA_COMMON_DIR}:{env:DASHBOARD_DIR}
# MCP Client
MCPCLIENT_ROOT = {env:SRC_DIR}/MCPClient
MCPCLIENT_DIR = {env:MCPCLIENT_ROOT}/lib
MCPCLIENT_PYTHONPATH = {env:MCPCLIENT_DIR}:{env:MCPCLIENT_DIR}/clientScripts:{env:ARCHIVEMATICA_COMMON_DIR}:{env:DASHBOARD_DIR}
# Storage Service
STORAGE_SERVICE_ROOT = {env:HACK_DIR}/submodules/archivematica-storage-service
STORAGE_SERVICE_DIR = {env:STORAGE_SERVICE_ROOT}/storage_service
STORAGE_SERVICE_PYTHONPATH = {env:STORAGE_SERVICE_DIR}:{env:STORAGE_SERVICE_DIR}/storage_service
# TOXENV-specific
archivematica-common: PYTHONPATH = {env:DASHBOARD_PYTHONPATH}
dashboard: PYTHONPATH = {env:DASHBOARD_PYTHONPATH}
mcp-server: PYTHONPATH = {env:MCPSERVER_PYTHONPATH}
mcp-client: PYTHONPATH = {env:MCPCLIENT_PYTHONPATH}
storage-service: PYTHONPATH = {env:STORAGE_SERVICE_PYTHONPATH}
migrations-dashboard: PYTHONPATH = {env:DASHBOARD_PYTHONPATH}
migrations-storage-service: PYTHONPATH = {env:STORAGE_SERVICE_PYTHONPATH}
# Setting HOME prevents Python's pwd module to ask for a real uid inside
# the container, and using {temp_dir} allows caching the pre-commit
# dependencies in the tox host
linting: HOME = {temp_dir}/user
changedir =
archivematica-common: {toxinidir}/tests/archivematicaCommon
dashboard: {toxinidir}/tests/dashboard
mcp-server: {toxinidir}/tests/MCPServer
mcp-client: {toxinidir}/tests/MCPClient
storage-service: {env:STORAGE_SERVICE_ROOT}
[testenv:storage-service]
deps =
-r{env:STORAGE_SERVICE_ROOT}/requirements-dev.txt
[testenv:migrations-dashboard]
commands = django-admin makemigrations --check --dry-run
[testenv:migrations-storage-service]
deps = {[testenv:storage-service]deps}
commands = {[testenv:migrations-dashboard]commands}
[testenv:linting]
basepython = python3
deps = pre-commit
commands = pre-commit run --all-files --show-diff-on-failure
"""