-
Notifications
You must be signed in to change notification settings - Fork 193
/
tox.ini
98 lines (90 loc) · 3.18 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
# Tox (http://tox.testrun.org/) 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.
[tox]
envlist = py27, py36, py37, py38, py39, py310, py311, {py36,py37,py38,py39,py310,py311,py312}-docs
[testenv]
# get stable output for unordered types
setenv =
PYTHONHASHSEED = 42
py27: PY_MAJOR_VERSION = py2
py36,py37,py38,py39,py310,py311,py312: PY_MAJOR_VERSION = py3
commands =
pytest --cov=petl --cov-report lcov:lcov.info petl
coverage report -m
deps =
-rrequirements-tests.txt
-rrequirements-formats.txt
[testenv:{py36,py37,py38,py39,py310,py311,py312}-docs]
# build documentation under similar environment to readthedocs
changedir = docs
deps =
-rrequirements-docs.txt
commands =
sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
[testenv:{py36,py37,py38,py39,py310,py311,py312}-doctest]
commands =
py36,py37,py38,py39,py310,py311,py312: pytest --doctest-modules --cov=petl --cov-report lcov:lcov.info petl
[testenv:{py36,py37,py38,py39}-dochtml]
changedir = docs
deps =
-rrequirements-docs.txt
commands =
sphinx-build -W -b singlehtml -d {envtmpdir}/doctrees . _build/singlehtml
[testenv:remote]
#? Create individual containers with the following commands:
#$ docker run -it --name samba -p 139:139 -p 445:445 -d "dperson/samba" -p -u "petl;test" -s "public;/public-dir;yes;no;yes;all"
#$ docker run -it --name sftp -p 22:22 -d atmoz/sftp petl:test:::public
#? Or create both with:
#$ docker compose up --detach samba sftp
#? Stop and remove the containers with:
#$ docker compose down --remove-orphans -v --rmi local
setenv =
{[testenv]setenv}
PETL_TEST_SMB=smb://WORKGROUP;petl:test@localhost/public/
PETL_TEST_SFTP=sftp://petl:test@localhost/public/
commands =
pytest --cov=petl --cov-report lcov:lcov.info petl
deps =
{[testenv]deps}
-rrequirements-remote.txt
[testenv:database]
#? Create individual test containers with the following commands:
#$ docker run -it --name mysql -p 3306:3306 -p 33060:33060 -e MYSQL_ROOT_PASSWORD=pass0 -e MYSQL_DATABASE=petl -e MYSQL_USER=petl -e MYSQL_PASSWORD=test -d mysql:latest
#$ docker run -it --name postgres -p 5432:5432 -e POSTGRES_DB=petl -e POSTGRES_USER=petl -e POSTGRES_PASSWORD=test -d postgres:latest
#? Or create both with:
#$ docker compose up --detach mysql postgres
setenv =
{[testenv]setenv}
commands =
pytest --cov=petl --cov-report lcov:lcov.info petl
deps =
-rrequirements-tests.txt
-rrequirements-database.txt
[testenv:compose]
#? Create test containers and run tests with the following commands:
#$ tox -e compose
setenv =
{[testenv:remote]setenv}
allowlist_externals =
docker
commands =
docker compose up --detach
pytest --cov=petl --cov-report lcov:lcov.info petl
coverage report -m
docker compose down --remove-orphans -v --rmi local
deps =
{[testenv]deps}
{[testenv:remote]deps}
{[testenv:database]deps}
[testenv:mysqldb]
basepython = python2.7
setenv =
PYTHONHASHSEED = 42
deps =
MySQL-python==1.2.5
SQLAlchemy==1.2.10
-rrequirements-tests.txt
commands =
pytest petl