-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
131 lines (122 loc) · 4.15 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# The easy usage for all test environments:
# pip install tox
# tox
[tox]
# test the highest version, the lowest, Django 2.2 and some versions complementary to Github Actions
# version Django 2.2 is special - some code in salesforce.backend.query is used only with this version.
envlist =
docs_style
typing
dj51-py312
# dj50-py313
dj50-py312
dj42-py312
dj41-py311
dj40-py310
dj32-py39
dj30-py38
dj22-py38
dj21-py38
# djdev-py313
no_django-py311
debug_toolbar-dj50-py312
# pylint-dj42-py310`
# Python versions used for Github Actions with the latest Ubuntu 22 Jammy Jellyfish are 3.8, 3.11, "3.10", 3.9
[testenv]
basepython =
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
py312: python3.12
py313: python3.13
pypy: pypy
pypy3: pypy3
deps =
# listed also a range of Python versions officially supported by Django
dj21: Django~=2.1.0 # py35-37
dj22: Django~=2.2.17 # py35-37
dj30: Django~=3.0.11 # py36-39
dj31: Django~=3.1.3 # py36-39
dj32: Django~=3.2.0 # py36-39
dj40: Django~=4.0.0 # py38-310
dj41: Django~=4.1.0 # py38-310
dj42: Django~=4.2.0 # py38-311
dj50: Django~=5.0.0 # py310-312
dj51: Django~=5.1.0 # py310-312
djdev: https://github.com/django/django/archive/main.zip
# local copy of django/origin main
# wget https://github.com/django/django/archive/main.zip -O django-42-dev.zip
# djdevlocal: django-42-dev.zip
pylint: pylint~=2.8.0 # fixed version to not report too much
pylint: pylint-django<2.5
debug_toolbar: django-debug-toolbar
coverage
# This Beatbox version works with Python 3 and 2.
# Be hopeful, it will be soon in official repositories.
# git+https://github.com/superfell/Beatbox@master#egg=beatbox
# beatbox3
git+https://github.com/hynekcer/beatbox-davisagli.git@f07c11c80dd5#egg=beatbox
psycopg2-binary
allowlist_externals = {toxinidir}/tests/tests.sh
commands =
{envpython} manage.py test salesforce tests.test_mock
{toxinidir}/tests/tests.sh
setenv =
# all bugs can be reported by the command `QUIET_KNOWN_BUGS=off tox`
# otherwise known bugs are silent
QUIET_KNOWN_BUGS={env:QUIET_KNOWN_BUGS:on}
passenv =
DJSF_LICENSE_KEY
SF_CONSUMER_KEY
SF_CONSUMER_SECRET
SF_HOST
SF_PASSWORD
SF_USER
SLOW_TESTS
[testenv:clean]
basepython = python3
commands =
{envpython} manage.py test tests.clean_test_data
[testenv:debug_toolbar-dj{32-py39,42-py39,50-py312}]
commands = {envpython} manage.py test tests.t_debug_toolbar --settings=tests.t_debug_toolbar.settings
[testenv:pylint-dj{21-py38,22-py38,30-py39,32-py39,40-py310,41-py310,42-py310}]
# Python 3.11 will require "wrapt>=1.14.1" and therefore Python between 3.8 and 3.10 is used with pylint
setenv = DJANGO_SETTINGS_MODULE=salesforce.testrunner.settings
commands = pylint --reports=no salesforce
[testenv:no_django-py{38,39,311}]
usedevelop=True
allowlist_externals =
rm
{toxinidir}/tests/tests_no_django.sh
commands =
# remove Django because it has been installed by setup.py now if not by tox
rm -rf {envsitepackagesdir}/django
{toxinidir}/tests/tests_no_django.sh
[testenv:docs_style]
# check Python code style and rst syntax
basepython = python3
skip_install = True
deps =
# the new flake8 ver 6.0 doesn't support type comments "# type: ..."
flake8<6.0
rstcheck
commands =
flake8
rstcheck --recursive README.rst CHANGELOG.rst docs
[testenv:typing]
# currently only python3.8 is supported for typing with django-salesforce-stubs
basepython = python3.8
deps =
mypy==0.770
git+https://github.com/hynekcer/[email protected]#django-stubs
allowlist_externals =
bash
touch
{toxinidir}/tests/mypy.sh
commands =
touch tests/inspectdb/models.py tests/inspectdb/dependent_model/models_template.py
bash -ec "{envpython} manage.py inspectdb --database=salesforce --tooling-api EntityDefinition FieldDefinition UserEntityAccess UserFieldAccess User >tests/tooling/models.py"
mypy salesforce tests
mypy salesforce/dbapi tests/test_mock tests/test_mock2 --strict
{toxinidir}/tests/mypy.sh