-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a pyproject.toml file to store configuration metadata for pytest, coverage, Ruff, mypy and tox.
- Loading branch information
1 parent
be6e57b
commit 366109d
Showing
10 changed files
with
169 additions
and
173 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
[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.MCPClient.lib.client.*", | ||
"src.MCPClient.lib.clientScripts.identify_file_format", | ||
"src.MCPClient.lib.clientScripts.normalize", | ||
"src.MCPClient.lib.clientScripts.policy_check", | ||
"src.MCPClient.lib.clientScripts.validate_file", | ||
"tests.MCPClient.conftest", | ||
"tests.MCPClient.test_identify_file_format", | ||
"tests.MCPClient.test_normalize", | ||
"tests.MCPClient.test_policy_check", | ||
"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 | ||
""" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
-r requirements.txt | ||
|
||
coverage | ||
coverage[toml] | ||
git+https://github.com/artefactual-labs/[email protected]#egg=mockldap | ||
pip-tools | ||
pytest | ||
|