-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathtox.ini
107 lines (97 loc) · 2.51 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
[tox]
envlist =
cov-clean
py{311,310,39,38,37}
py37-mindeps
cov-combine
cov-report
mypy
skip_missing_interpreters = true
minversion = 4.3.5
[testenv]
package = wheel
wheel_build_env = build_wheel
extras = test
passenv = GLOBUS_SDK_PATH
deps =
mindeps: click==8.0.0
mindeps: requests==2.19.1
mindeps: pyjwt==2.0.0
mindeps: cryptography==3.3.1
mindeps: packaging==17.0
sdkmain: https://github.com/globus/globus-sdk-python/archive/main.tar.gz
# the 'localsdk' factor allows CLI tests to be run against a local repo copy of globus-sdk
# it requires that the GLOBUS_SDK_PATH env var is set and uses subprocess and os to pass it as
# an argument to 'pip'
#
# This is unfortunately necessary: tox does not expand env vars in commands
#
# usage examples:
# GLOBUS_SDK_PATH=../globus-sdk tox -e py311-localsdk
# GLOBUS_SDK_PATH=../globus-sdk tox -e 'py{37,38,39,310,311}-localsdk'
commands =
localsdk: python -c 'import os, subprocess, sys; subprocess.run([sys.executable, "-m", "pip", "install", "-e", os.environ["GLOBUS_SDK_PATH"]])'
coverage run -m pytest {posargs}
depends =
py{37,38,39,310,311}{,-mindeps}: cov-clean
cov-combine: py{37,38,39,310,311}{,-mindeps}
cov-report: cov-combine
[testenv:cov-clean]
deps = coverage
skip_install = true
commands = coverage erase
[testenv:cov-combine]
deps = coverage
skip_install = true
commands = coverage combine
[testenv:cov-report]
deps = coverage
skip_install = true
commands_pre = coverage html --fail-under=0
commands = coverage report
[testenv:lint]
deps = pre-commit~=2.9.2
skip_install = true
commands = pre-commit run --all-files
[testenv:mypy]
base_python =
python3.11
python3.10
deps =
mypy==1.0.1
types-jwt
types-requests
types-jmespath
commands = mypy src/
[testenv:reference]
allowlist_externals = find
commands_pre = find reference/ -name "*.adoc" -type f -delete
commands = python ./reference/_generate.py {posargs}
[testenv:twine-check]
skip_install = true
deps =
build
twine
allowlist_externals = rm
commands_pre = rm -rf dist/
# check that twine validating package data works
commands =
python -m build
twine check dist/*
[testenv:prepare-release]
skip_install = true
deps = scriv
commands =
scriv collect
python ./changelog.d/post-fix-changelog.py changelog.adoc
[testenv:publish-release]
skip_install = true
deps =
build
twine
# clean the build dir before rebuilding
allowlist_externals = rm
commands_pre = rm -rf dist/
commands =
python -m build
twine upload dist/*