-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathtox.ini
115 lines (98 loc) · 2.68 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
[tox]
envlist = d{42,51}-py{311,312}-{pg,sqlite,mysql},docs,lint,package
skip_missing_interpreters = true
[pytest]
pythonpath=./tests/demoapp/ src
django_find_project = false
DJANGO_SETTINGS_MODULE=demo.settings
norecursedirs = .tox docs ./demoapp/
python_files=tests/test_*.py
allowlist_externals=mkdir
addopts =
-q
-p no:warnings
--tb=short
--capture=no
--echo-version django
--echo-attr django.conf.settings.DATABASES.default.ENGINE
--cov=concurrency
--cov-report=html
--cov-config=tests/.coveragerc
pep8ignore = * ALL
markers =
functional: mark a test as functional
admin: admin tests
[testenv]
;install_command=pip install {opts} {packages}
passenv =
PYTHONDONTWRITEBYTECODE
PGHOST
PGPORT
whitelist_externals =
mkdir
/usr/local/bin/psql
/bin/sh
/usr/local/bin/mysql
/usr/local/mysql/bin/mysql
/usr/bin/psql
changedir={toxinidir}
setenv =
PYTHONPATH =
DBNAME = concurrency
pg: DBENGINE = pg
mysql: DBENGINE = mysql
sqlite: DBENGINE = sqlite
d42: GROUP = dj4
d51: GROUP = dj5
deps =
pdm
pypy-pg: psycopg2cffi
mysql: mysqlclient
; d42: django==4.2.*
; d51: django==5.1.*
commands =
; pdm sync -L {env:GROUP}.lock
pdm install -G {env:GROUP} -L {env:GROUP}-g.lock
{posargs:pdm run pytest tests -v -rw --create-db}
[testenv:mysql]
commands =
- mysql -u root -h 127.0.0.1 -e 'DROP DATABASE IF EXISTS concurrency;'
- mysql -u root -h 127.0.0.1 -e 'CREATE DATABASE IF NOT EXISTS concurrency;'
{[testenv]commands}
[testenv:pg]
commands =
- psql -h $PGHOST -p $PGPORT -c 'DROP DATABASE "concurrency";' -U postgres
- psql -h $PGHOST -p $PGPORT -c 'CREATE DATABASE "concurrency";' -U postgres
{[testenv]commands}
[testenv:clean]
commands =
mysql: - mysql -u root -e 'DROP DATABASE IF EXISTS concurrency;'
pg: - psql -c 'DROP DATABASE "concurrency";' -U postgres
[testenv:docs]
basepython = python312
allowlist_externals=
mkdir
deps =
pdm
-rdocs/requirements.pip
commands =
mkdir -p ~build/docs
pdm run sphinx-build -aE docs/ ~build/docs
[testenv:lint]
envdir={toxworkdir}/d42-py312/
skip_install = true
commands =
pip install flake8 isort
flake8 src tests
isort -c src tests
[testenv:package]
deps=
build
twine
setenv =
TWINE_USERNAME = {env:TWINE_TEST_USERNAME:__token__}
TWINE_PASSWORD = {env:TWINE_TEST_PASSWORD}
commands =
python -c "import shutil; shutil.rmtree('dist', ignore_errors=True)"
python -m build
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*