This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
tox.ini
91 lines (80 loc) · 2.23 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
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
#
# NOTE:
# - tox will only override or substitute sections registered as envs, while
# - Any section can be used as a source of substitution.
[tox]
envlist = test
[server]
user = {env:USER}
testdb = {env:USER}
host = localhost
port = 65432
[docker:server]
image =
dockerfile = server/postgres12-python39.Dockerfile
environment =
POSTGRES_USER={[server]user}
POSTGRES_HOST_AUTH_METHOD=trust
POSTGRES_DB={[server]testdb}
ports =
{[server]port}:5432/tcp
[testenv:test-container]
docker = server
deps = -r requirements-dev.txt
allowlist_externals = bash
commands =
bash -c 'source .tox/test-container/bin/activate && source server/requirements.sh'
pytest --exitfirst {posargs}
setenv =
PGHOST={[server]host}
PGPORT={[server]port}
PGUSER={[server]user}
TESTDB={[server]testdb}
[testenv:test]
deps = -r requirements-dev.txt
allowlist_externals = bash
commands =
bash -c 'source .tox/test/bin/activate && source server/requirements.sh'
pytest --exitfirst {posargs}
setenv =
PGHOST={env:PGHOST:localhost}
PGPORT={env:PGPORT:5432}
PGUSER={env:PGUSER:{env:USER}}
TESTDB={env:TESTDB:{env:USER}}
[testenv:lint]
deps = {[testenv:test]deps}
skip_install = true
commands =
black . --check --diff
isort --profile black . -c --diff
pyright
[testenv:doc]
deps = -r requirements-doc.txt
passenv=
TAG_REF
commands =
sphinx-build -W --keep-going -b html -j 2 -c {toxinidir}/doc/ {toxinidir}/doc/source {toxinidir}/build/doc/{env:TAG_REF:}
[testenv:docstyle]
deps = {[testenv:doc]deps}
skip_install = true
commands =
pydocstyle {posargs:greenplumpython}
[pytest]
addopts = --doctest-modules
doctest_optionflags = NORMALIZE_WHITESPACE
# TODO: Enable all examples under greenplumpython
testpaths =
tests
greenplumpython
markers =
requires_pickler_on_server
requires_pgvector
[pydocstyle]
# TODO: Enable docstyle check for all files
match = .*(group|dataframe|expr|config|functions|type|db|func|order|op)\.py
[pycodestyle]
max-line-length = 100