-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
149 lines (143 loc) · 4.52 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
[tool.pytest.ini_options]
env = [
"API_MONGO_HOST=localhost:27017",
"API_MONGO_DB=search_stats",
"API_MONGO_USER=mongo",
"API_MONGO_PASSWORD=secret",
"API_SOLR_HOST=localhost:8983",
"API_SOLR_CORE=files",
"FREVA_NO_RICH_PANELS=1",
"FREVA_CONFIG={PWD}/dev-env/freva.toml",
"API_REDIS_SSL_CERTFILE={PWD}/dev-env/config/certs/client-cert.pem",
"API_REDIS_SSL_KEYFILE={PWD}/dev-env/config/certs/client-key.pem",
"API_REDIS_HOST=redis://localhost:6379",
"API_REDIS_USER=redis",
"API_REDIS_PASSWORD=secret",
"API_SERVICES=zarr-stream,databrowser",
"API_CONFIG={PWD}/freva-rest/src/freva_rest/api_config.toml",
]
filterwarnings = ["ignore::UserWarning"]
[tool.flake8]
ignore = ["F405", "F403"]
[tool.mypy]
files = "freva-*/src"
strict = true
warn_unused_ignores = true
warn_unreachable = true
show_error_codes = true
install_types = true
non_interactive = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
warn_redundant_casts = true
ignore_missing_imports = true
allow_untyped_calls = true
[tool.isort]
known_first_party = [
"freva_rest",
"freva_client",
"freva_data_portal",
"data_portal_worker",
"databrowser_api",
]
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
[tool.tox]
legacy_tox_ini = """
[tox]
min_version = 4.0
env_list = docs, lint, types
passenv = *
[testenv]
passenv = *
parallel_show_output = false
[testenv:test]
description = "Run the unit tests."
deps = -e ./freva-rest
-e ./freva-client
-e ./freva-data-portal-worker[full]
httpx
pytest
pytest-asyncio
pytest-cov
pytest-mock
mock
pymongo
pytest-env
setuptools
xarray
commands =
pytest -vv --cov=freva-rest --cov=freva-client --cov=freva-data-portal-worker --cov-report=html:coverage_report --junitxml report.xml --cov-report xml tests/
python3 -m coverage report --fail-under=98.5 --precision=2
[testenv:docs]
description = "Create the documentation."
deps = -e ./freva-rest
-e ./freva-client
-e ./freva-data-portal-worker[full]
sphinx-execute-code-python3
sphinx-code-tabs
sphinx-copybutton
sphinx-sitemap
sphinx-togglebutton
sphinxcontrib-httpdomain
pydata-sphinx-theme
setenv =
FREVA_CONFIG = {toxinidir}/dev-env/freva.toml
FREVA_NO_RICH_PANELS = 1
allowlist_externals = make
commands = make -C docs clean
make -C docs html
[testenv:lint]
description = "Check code quality."
deps = -e ./freva-rest
-e ./freva-client
-e ./freva-data-portal-worker[full]
black
isort
flake8
pytest-stub
commands =
python3 -m isort --check --profile black -t py312 -l 79 freva-rest/src
python3 -m isort --check --profile black -t py312 -l 79 freva-client/src
python3 -m isort --check --profile black -t py312 -l 79 freva-data-portal-worker/src
python3 -m flake8 freva-client/src --count --max-complexity=10 --ignore=F405,F403,W503,C901 --max-line-length=88 --statistics --show-source
python3 -m flake8 freva-rest/src --count --max-complexity=10 --ignore=F405,F403,W503,C901 --max-line-length=88 --statistics --show-source
python3 -m flake8 freva-data-portal-worker/src --count --max-complexity=10 --ignore=F405,F403,W503,C901 --max-line-length=88 --statistics --show-source
[testenv:types]
description = "Static type checking."
deps = ./freva-rest
./freva-client
./freva-data-portal-worker[full]
mypy
motor-stubs
pytest-stub
appdirs
commands_post =
commands = python3 -m mypy --install-types --non-interactive
[testenv:release]
deps = git-python
packaging
requests
tomli
commands = python3 bump.py tag freva_rest -p freva-rest
allowlist_externals = rm
curl
commands_pre = curl -H 'Cache-Control: no-cache' -Ls -o bump.py https://raw.githubusercontent.com/FREVA-CLINT/freva-deployment/main/release.py
commands_post = rm bump.py
[testenv:bump]
commands = python3 bump.py deploy -p freva-rest -v
commands_pre = curl -H 'Cache-Control: no-cache' -Ls -o bump.py https://raw.githubusercontent.com/FREVA-CLINT/freva-deployment/main/release.py
allowlist_externals = rm
curl
commands_post = rm bump.py
deps = git-python
packaging
requests
tomli
[testenv:build]
commands = pyinstaller --onefile --name data-loader-worker freva-data-portal/pyinstaller.py
deps = ./freva-data-portal
pyinstaller
"""