forked from pycontribs/jira
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
140 lines (131 loc) · 3.61 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
[tox]
minversion = 4.0
isolated_build = True
requires =
# plugins disabled until they gets compatible with tox v4
# tox-extra
# tox-pyenv
envlist =
py311
py310
py39
py38
ignore_basepython_conflict = True
skip_missing_interpreters = True
skipdist = True
[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
[testenv]
usedevelop = True
# hide deps from stdout https://github.com/tox-dev/tox/issues/601
# list_dependencies_command=echo
extras =
cli
opt
test
sitepackages=False
commands=
git clean -xdf jira tests
python -m pip check
python make_local_jira_user.py
python -m pytest {posargs}
setenv =
PIP_CONSTRAINT={toxinidir}/constraints.txt
PIP_LOG={envdir}/pip.log
PIP_DISABLE_PIP_VERSION_CHECK=1
# Avoid 2020-01-01 warnings: https://github.com/pypa/pip/issues/6207
PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
CI_JIRA_URL=http://localhost:2990/jira
CI_JIRA_ADMIN=admin
CI_JIRA_ADMIN_PASSWORD=admin
CI_JIRA_USER=jira_user
CI_JIRA_USER_FULL_NAME=Newly Created CI User
CI_JIRA_USER_PASSWORD=jira
CI_JIRA_ISSUE=Task
passenv =
CI
CI_JIRA_*
CURL_CA_BUNDLE
PIP_*
REQUESTS_CA_BUNDLE
SSL_CERT_FILE
TWINE_*
XDG_CACHE_HOME
# For Windows users, getpass.get_user() needs USERNAME
USERNAME
allowlist_externals =
git
sh
[testenv:deps]
description = Update dependency lock files
# Force it to use oldest supported version of python or we would lose ability
# to get pinning correctly.
basepython = python3.8
deps =
pip-tools >= 6.4.0
pre-commit >= 2.13.0
commands =
pip-compile --upgrade -o constraints.txt setup.cfg --extra cli --extra docs --extra opt --extra async --extra test --strip-extras
{envpython} -m pre_commit autoupdate
[testenv:docs]
extras =
cli
docs
# changedir=docs
usedevelop = True
skipdist = False
setenv =
PYTHONHTTPSVERIFY=0
commands =
sphinx-build \
-a -n -v -W --keep-going \
-b html --color \
-d "{toxworkdir}/docs_doctree" \
docs/ "{toxworkdir}/docs_out"
# Print out the output docs dir and a way to serve html:
python -c \
'import pathlib; '\
'docs_dir = pathlib.Path(r"{toxworkdir}") / "docs_out"; index_file = docs_dir / "index.html"; print(f"\nDocumentation available under `file://\{index_file\}`\n\nTo serve docs, use `python3 -m http.server --directory \{docs_dir\} 0`\n")'
[testenv:packaging]
basepython = python3
description =
Build package, verify metadata, install package and assert behavior when ansible is missing.
deps =
build >= 0.7.0
twine
skip_install = true
# Ref: https://twitter.com/di_codes/status/1044358639081975813
commands =
# build wheel and sdist using PEP-517
{envpython} -c 'import os.path, shutil, sys; \
dist_dir = os.path.join(r"{toxinidir}", "dist"); \
os.path.isdir(dist_dir) or sys.exit(0); \
print("Removing \{!s\} contents...".format(dist_dir), file=sys.stderr); \
shutil.rmtree(dist_dir)'
{envpython} -m build \
--outdir {toxinidir}/dist/ \
{toxinidir}
# Validate metadata using twine
twine check --strict {toxinidir}/dist/*
# Install the wheel
sh -c "python3 -m pip install {toxinidir}/dist/*.whl"
# Check if cli was installed
jirashell --help
# Uninstall the wheel
{envpython} -m pip uninstall -y jira
[testenv:lint]
deps = pre-commit>=1.17.0
commands=
python -m pre_commit run --color=always {posargs:--all}
setenv =
PIP_CONSTRAINT=
skip_install = true
usedevelop = false
[testenv:maintenance]
# this will obliterate your jira instance, used to clean the CI server
commands=
python examples/maintenance.py