forked from artefactual/archivematica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
108 lines (97 loc) · 4 KB
/
tox.ini
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
[tox]
skipsdist = True
minversion = 2.7.0
envlist =
py{27,36}-archivematica-common
py{27,36}-dashboard
py{27,36}-mcpserver
py{27,36}-mcpclient
py{27,36}-mcpclient-ensure-no-mutable-globals
py{27,36}-storage-service
py{27,36}-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}
mcpserver: PYTHONPATH = {env:MCPSERVER_PYTHONPATH}
mcpclient: 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 and flake8
# dependencies in the tox host
linting: HOME = {temp_dir}/user
changedir =
archivematica-common: {env:ARCHIVEMATICA_COMMON_ROOT}
dashboard: {env:DASHBOARD_ROOT}
mcpserver: {env:MCPSERVER_ROOT}
mcpclient: {env:MCPCLIENT_ROOT}
storage-service: {env:STORAGE_SERVICE_DIR}
[testenv:py36-{archivematica-common,dashboard,mcpserver,mcpclient}]
deps = -r{toxinidir}/requirements-dev-py3.txt
[testenv:py27-mcpclient-ensure-no-mutable-globals]
commands = python {env:MCPCLIENT_DIR}/ensure_no_mutable_globals.py
[testenv:py36-mcpclient-ensure-no-mutable-globals]
deps = -r{toxinidir}/requirements-dev-py3.txt
commands = {[testenv:py27-mcpclient-ensure-no-mutable-globals]commands}
[testenv:py27-storage-service]
deps =
-r{env:STORAGE_SERVICE_ROOT}/requirements/production.txt
-r{env:STORAGE_SERVICE_ROOT}/requirements/test.txt
[testenv:py36-storage-service]
deps =
-r{env:STORAGE_SERVICE_ROOT}/requirements/production-py3.txt
-r{env:STORAGE_SERVICE_ROOT}/requirements/test-py3.txt
[testenv:py27-migrations-dashboard]
commands = django-admin makemigrations --check --dry-run
[testenv:py36-migrations-dashboard]
deps = -r{toxinidir}/requirements-dev-py3.txt
commands = {[testenv:py27-migrations-dashboard]commands}
[testenv:migrations-storage-service]
basepython = python3
deps = {[testenv:py36-storage-service]deps}
commands = django-admin makemigrations --check --dry-run
[testenv:linting]
basepython = python3
deps = pre-commit
commands = pre-commit run --all-files --show-diff-on-failure
[flake8]
exclude = .tox, .git, __pycache__, .cache, build, dist, *.pyc, *.egg-info, .eggs
application-import-names = flake8
select = C, E, F, W, B, B950
ignore = E203, E402, E501, E722, W503, W605