-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.cfg
More file actions
112 lines (102 loc) · 2.38 KB
/
Copy pathsetup.cfg
File metadata and controls
112 lines (102 loc) · 2.38 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
[coverage:run]
# uncomment the following to omit files during running
omit =
solvis_graphql_api/pynamodb_config.py
solvis_graphql_api/handler.py
solvis_graphql_api/tests/*
solvis_graphql_api/ab_test/ab_test.py
solvis_graphql_api/ab_test/client
solvis_graphql_api/scripts/cli.py
solvis_graphql_api/scripts/cli_ab_test.py
[coverage:report]
exclude_lines =
pragma: no cover
def __repr__
if self.debug:
if settings.DEBUG
if TYPE_CHECKING:
raise AssertionError
raise NotImplementedError
if 0:
if __name__ == .__main__.:
def main
[tox:tox]
isolated_build = true
envlist = audit, py312, format, lint, build
[gh-actions]
python =
3.12: py312, format, lint, build
[testenv]
allowlist_externals = pytest
dependency_groups =
dev
passenv = *
setenv =
PYTHONPATH = {toxinidir}
PYTHONWARNINGS = ignore
TESTING = 1
commands =
pytest --cov=solvis_graphql_api --cov-branch --cov-report=xml --cov-report=term-missing
[testenv:audit]
allowlist_externals =
deps =
uv
tox-uv
commands =
uv export --format requirements-txt --no-emit-project --output audit.txt
uv run pip-audit -r audit.txt --require-hashes
[testenv:format]
allowlist_externals =
deps =
uv
tox-uv
dependency_groups =
dev
commands =
uv run ruff format .
[testenv:lint]
allowlist_externals =
deps =
uv
tox-uv
dependency_groups =
dev
commands =
uv run ruff check .
uv run mypy solvis_graphql_api
[testenv:build]
allowlist_externals =
deps =
uv
tox-uv
dependency_groups =
dev
commands =
uv build
[testenv:smoke]
# Smoke test that fires up the API and runs a simple query against it.
# call with
# uv run tox -e smoke
allowlist_externals =
bash
curl
deps =
boto3
setenv =
PYTHONPATH = {toxinidir}
TESTING = 1
commands =
bash -c '\
flask --app solvis_graphql_api.solvis_graphql_api:app run --port 5099 & \
FLASK_PID=$!; \
for i in 1 2 3 4 5; do curl -so /dev/null http://localhost:5099/graphql 2>/dev/null && break; sleep 1; done; \
RESPONSE=$(curl -sf -X POST http://localhost:5099/graphql \
-H "Content-Type: application/json" \
-d '\''{"query": "{ about }"}'\'' ); \
kill $FLASK_PID 2>/dev/null; \
echo "$RESPONSE"; \
echo "$RESPONSE" | grep -q "solvis_graphql_api" \
'
[tool:pytest]
markers =
slow: slow tests