This repository has been archived by the owner on May 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathtox.ini
145 lines (131 loc) · 4.06 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
[tox]
isolated_build = True
skip_missing_interpreters = True
minversion = 3.23.0
envlist =
fmt-check
py39-int-pre-pex1.6
py39-int-post-pex1.6
[tox:.package]
# N.B.: tox will use the same python version as under what tox is installed to package, so unless
# this is python 3 you can require a given python version for the packaging environment via the
# basepython key. We need this for flit which only runs under python3 but works for python2
# projects.
basepython = python3
[_integration]
deps =
tox
commands =
tox -e pex
[_event_integration]
deps =
{[_integration]deps}
allowlist_externals =
chmod
cp
{toxinidir}/dist/lambdex
{toxinidir}/dist/lambda_function_copy.pex
{toxinidir}/dist/lambda_function.pex
commands =
{[_integration]commands}
pex --version
pex -r {toxinidir}/examples/event_based/requirements.txt -o {toxinidir}/dist/lambda_function.pex
cp {toxinidir}/dist/lambda_function.pex {toxinidir}/dist/lambda_function_ro.pex
chmod 0544 {toxinidir}/dist/lambda_function_ro.pex
{toxinidir}/dist/lambdex build -o {toxinidir}/dist/lambda_function_copy.pex -s examples/event_based/example_function.py -H handler -M lambdex_handler.py {toxinidir}/dist/lambda_function_ro.pex
{toxinidir}/dist/lambda_function_copy.pex -c 'from lambdex_handler import handler; handler(\{"url":"https://github.com/pex-tool/lambdex"\}, None)'
{toxinidir}/dist/lambdex build -s examples/event_based/example_function.py -H handler -M lambdex_handler.py {toxinidir}/dist/lambda_function.pex
{toxinidir}/dist/lambda_function.pex -c 'from lambdex_handler import handler; handler(\{"url":"https://github.com/pex-tool/lambdex"\}, None)'
tox -e entry-point-env-var
[_gcp_http_integration]
deps =
{[_integration]deps}
.[test-gcp-http]
allowlist_externals =
{toxinidir}/dist/lambdex
commands =
{[_integration]commands}
pex --version
pex -r {toxinidir}/examples/gcp_http/requirements.txt -o {toxinidir}/dist/gcp_http_function.pex
{toxinidir}/dist/lambdex build -s examples/gcp_http/example_http_function.py -H handler -M main.py {toxinidir}/dist/gcp_http_function.pex
{toxinidir}/dist/lambdex test --type gcp-http --empty {toxinidir}/dist/gcp_http_function.pex
[testenv:py{27,36,37,38,39}-int-pre-pex1.6]
# NB: 1.4.8 is the first pre-1.6.0 version to support -c and Python 3.9 is the last version to
# support collections.Iterable which 1.4.8 uses.
deps =
{[_event_integration]deps}
pex==1.4.8
allowlist_externals =
{[_event_integration]allowlist_externals}
commands =
{[_event_integration]commands}
[testenv:py{27,36,37,38,39,310,311,312}-int-post-pex1.6]
deps =
{[_event_integration]deps}
{[_gcp_http_integration]deps}
pex>=1.6.0
allowlist_externals =
{[_event_integration]allowlist_externals}
{[_gcp_http_integration]allowlist_externals}
commands =
{[_event_integration]commands}
{[_gcp_http_integration]commands}
[testenv:entry-point-env-var]
setenv =
LAMBDEX_ENTRY_POINT = example_function:other_handler
commands =
{toxinidir}/dist/lambdex test --empty {toxinidir}/dist/lambda_function.pex
allowlist_externals =
{toxinidir}/dist/lambdex
{toxinidir}/dist/lambda_function.pex
chmod
[testenv:pex]
deps =
pex==2.1.43; python_version < "3.10"
# N.B.: This is the lowest version of Pex to support up through Python 3.12.
pex==2.1.139; python_version >= "3.10"
commands =
python scripts/build-lambdex-pex.py {toxinidir}/dist/lambdex
[testenv:lambdex]
commands = lambdex {posargs}
[testenv:fmt]
basepython = python3
skip_install = true
deps =
black==21.4b1
# The 8.1.0 release of click breaks black; so we pin.
click==8.0.1
isort==5.8.0
commands =
black .
isort .
[testenv:fmt-check]
basepython = {[testenv:fmt]basepython}
skip_install = true
deps =
{[testenv:fmt]deps}
commands =
black --check .
isort --check-only .
[_flit]
basepython = python3
deps =
flit
pygments
[testenv:package]
basepython = {[_flit]basepython}
deps =
{[_flit]deps}
commands =
flit build
[testenv:publish]
skip_install = true
basepython = {[_flit]basepython}
passenv =
# These are used in CI.
FLIT_USERNAME
FLIT_PASSWORD
deps =
{[_flit]deps}
commands =
flit publish