| 1 |
# |
| 2 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 |
# you may not use this file except in compliance with the License. |
| 4 |
# You may obtain a copy of the License at |
| 5 |
# |
| 6 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 7 |
# |
| 8 |
# Unless required by applicable law or agreed to in writing, software |
| 9 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 10 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 |
# See the License for the specific language governing permissions and |
| 12 |
# limitations under the License. |
| 13 |
# |
| 14 |
|
| 15 |
# |
| 16 |
# Tox global configuration |
| 17 |
# |
| 18 |
[tox] |
| 19 |
envlist = py{310,311,312,313,314}-{bst-fixed,bst-master} |
| 20 |
skip_missing_interpreters = true |
| 21 |
|
| 22 |
# |
| 23 |
# Defaults for all environments |
| 24 |
# |
| 25 |
# Anything specified here is inherited by the sections |
| 26 |
# |
| 27 |
[testenv] |
| 28 |
commands = |
| 29 |
bst --version |
| 30 |
{toxinidir}/tests/bzr_wrapper {envdir}/bin |
| 31 |
pytest --basetemp {envtmpdir} {posargs} |
| 32 |
deps = |
| 33 |
-rrequirements/test-requirements.txt |
| 34 |
-rrequirements/plugin-requirements.txt |
| 35 |
git+https://github.com/apache/buildstream@{env:BST_VERSION} |
| 36 |
|
| 37 |
passenv = |
| 38 |
ARTIFACT_CACHE_SERVICE |
| 39 |
BST_FORCE_BACKEND |
| 40 |
BST_FORCE_SANDBOX |
| 41 |
GI_TYPELIB_PATH |
| 42 |
INTEGRATION_CACHE |
| 43 |
http_proxy |
| 44 |
HTTP_PROXY |
| 45 |
https_proxy |
| 46 |
HTTPS_PROXY |
| 47 |
no_proxy |
| 48 |
NO_PROXY |
| 49 |
PYTEST_* |
| 50 |
REMOTE_EXECUTION_SERVICE |
| 51 |
SOURCE_CACHE_SERVICE |
| 52 |
SSL_CERT_FILE |
| 53 |
|
| 54 |
# |
| 55 |
# These keys are not inherited by any other sections |
| 56 |
# |
| 57 |
setenv = |
| 58 |
py{310,311,312,313,314}: XDG_CACHE_HOME = {envtmpdir}/cache |
| 59 |
py{310,311,312,313,314}: XDG_CONFIG_HOME = {envtmpdir}/config |
| 60 |
py{310,311,312,313,314}: XDG_DATA_HOME = {envtmpdir}/share |
| 61 |
!master: BST_VERSION = 2.7.0 |
| 62 |
master: BST_VERSION = master |
| 63 |
|
| 64 |
allowlist_externals = |
| 65 |
py{310,311,312,313,314}: |
| 66 |
mv |
| 67 |
mkdir |
| 68 |
{toxinidir}/tests/bzr_wrapper |
| 69 |
|
| 70 |
# |
| 71 |
# Code formatters |
| 72 |
# |
| 73 |
[testenv:format] |
| 74 |
skip_install = True |
| 75 |
deps = |
| 76 |
black==22.3.0 |
| 77 |
commands = |
| 78 |
black {posargs: src tests setup.py} |
| 79 |
|
| 80 |
# |
| 81 |
# Code format checkers |
| 82 |
# |
| 83 |
[testenv:format-check] |
| 84 |
skip_install = True |
| 85 |
deps = |
| 86 |
black==22.3.0 |
| 87 |
commands = |
| 88 |
black --check --diff {posargs: src tests setup.py} |
| 89 |
|
| 90 |
# |
| 91 |
# Running linters |
| 92 |
# |
| 93 |
[testenv:lint] |
| 94 |
commands_pre = |
| 95 |
# Build C extensions to allow Pylint to analyse them |
| 96 |
{envpython} setup.py build_ext --inplace |
| 97 |
|
| 98 |
commands = |
| 99 |
pylint {posargs: buildstream_plugins tests setup.py} |
| 100 |
|
| 101 |
# |
| 102 |
# Running static type checkers |
| 103 |
# |
| 104 |
[testenv:mypy] |
| 105 |
skip_install = True |
| 106 |
commands = |
| 107 |
mypy {posargs} |
| 108 |
deps = |
| 109 |
mypy==1.13.0 |
| 110 |
types-protobuf |
| 111 |
types-python-dateutil |
| 112 |
types-setuptools |
| 113 |
types-ujson |
| 114 |
-rrequirements/plugin-requirements.txt |
| 115 |
-rrequirements/test-requirements.txt |
| 116 |
-rrequirements/mypy-requirements.txt |
| 117 |
git+https://github.com/apache/buildstream@{env:BST_VERSION} |
| 118 |
|
| 119 |
# |
| 120 |
# Building documentation |
| 121 |
# |
| 122 |
[testenv:docs] |
| 123 |
commands = |
| 124 |
make -C doc |
| 125 |
# sphinx_rtd_theme < 0.4.2 breaks search functionality for Sphinx >= 1.8 |
| 126 |
deps = |
| 127 |
sphinx >= 1.8.5 |
| 128 |
sphinx_rtd_theme >= 0.4.2 |
| 129 |
-rrequirements/plugin-requirements.txt |
| 130 |
git+https://github.com/apache/buildstream@{env:BST_VERSION} |
| 131 |
passenv = |
| 132 |
BST_FORCE_SESSION_REBUILD |
| 133 |
BST_SOURCE_CACHE |
| 134 |
HOME |
| 135 |
LANG |
| 136 |
LC_ALL |
| 137 |
allowlist_externals = |
| 138 |
make |
| 139 |
|
| 140 |
|
| 141 |
# |
| 142 |
# Publish a release, make sure to update the version in setup.py first |
| 143 |
# |
| 144 |
[testenv:release] |
| 145 |
skip_install = true |
| 146 |
commands = |
| 147 |
python3 setup.py sdist bdist_wheel |
| 148 |
twine upload -r pypi dist/* |
| 149 |
deps = |
| 150 |
twine |
| 151 |
wheel |
| 152 |
passenv = |
| 153 |
TWINE_USERNAME |
| 154 |
TWINE_PASSWORD |