-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
69 lines (61 loc) · 2.07 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
[tox]
envlist = unit,lint
minversion = 3.2.0
# https://python-poetry.org/docs/faq/#is-tox-supported
isolated_build = true
toxworkdir={env:TOX_WORK_DIR:.tox}
[testenv]
skip_install = true
basepython=python3.11
allowlist_externals =
aws
poetry
passenv =
POETRY_HTTP_BASIC_ARTIFACT_USERNAME
POETRY_HTTP_BASIC_ARTIFACT_PASSWORD
###############################################################
[testenv:unit]
setenv =
MERQ_API_KEY=ABCD1234
commands_pre =
poetry install --sync
commands =
poetry run mypy -p merqube_client_lib --strict
poetry run pytest -x -vv --disable-socket --cov merqube_client_lib --cov-report html --cov-fail-under=95 --cov-config=.coveragerc -n auto --dist loadfile tests/unit
###############################################################
[testenv:local]
# for fast local iterative testing
setenv =
MERQ_API_KEY=ABCD1234
commands_pre =
poetry install --sync
commands =
poetry run pytest -x -vv --disable-socket tests/unit
###############################################################
[testenv:integration]
setenv =
passenv = MERQ_API_KEY
commands_pre =
poetry install --sync
commands =
poetry run pytest -x -vv -n auto --dist loadfile tests/integration
###############################################################
[flake8]
# E501 is line length which we explicitly set to 120 which violates pep
# W291 is "trailing whitespace" which is normally bad, but there are SQL statements in this code that depend on it..
# E203 is caused by black and black claims its invalid; ignore it https://github.com/psf/black/issues/280
# F722: https://stackoverflow.com/questions/64909849/syntax-error-with-flake8-and-pydantic-constrained-types-constrregex
extend-ignore = E501,W291,E203,F722
exclude = tests/fixtures/*
[testenv:lint]
# The following envs dont need the package installed at all - no poetry here
deps =
flake8
flake8-black
flake8-isort
pylint
pyright
commands =
flake8 merqube_client_lib tests/unit tests/integration
pylint -E merqube_client_lib tests/unit tests/integration
pyright merqube_client_lib