File: tox.ini

package info (click to toggle)
python-jira 3.9.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,008 kB
  • sloc: python: 8,643; sh: 13; makefile: 7; xml: 4
file content (146 lines) | stat: -rw-r--r-- 3,702 bytes parent folder | download
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
146
[tox]
minversion = 4.0
isolated_build = True
requires =
    tox-extra
envlist =
    lint
    pkg
    docs
    py312
    py311
    py310
    py39
ignore_basepython_conflict = True
skip_missing_interpreters = True
skipdist = True

[gh-actions]
python =
    3.9: py39
    3.10: py310
    3.11: py311
    3.12: py312


[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_*
    GITHUB_*
    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.9
skip_install = true
deps =
    pip-tools >= 6.4.0
    pre-commit >= 2.13.0
commands =
    pip-compile --upgrade -o constraints.txt --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 \
      --verbose \
      --write-all \
      --nitpicky --fail-on-warning \
      -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:pkg]
basepython = python3
description =
  Build package, verify metadata, install package and assert behavior when ansible is missing.
deps =
  build >= 0.7.0
  twine
  pip
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 "pip3 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