# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # # Tox global configuration # [tox] envlist = py{310,311,312,313,314}-{bst-fixed,bst-master} skip_missing_interpreters = true # # Defaults for all environments # # Anything specified here is inherited by the sections # [testenv] commands = bst --version {toxinidir}/tests/bzr_wrapper {envdir}/bin pytest --basetemp {envtmpdir} {posargs} deps = -rrequirements/test-requirements.txt -rrequirements/plugin-requirements.txt git+https://github.com/apache/buildstream@{env:BST_VERSION} passenv = ARTIFACT_CACHE_SERVICE BST_FORCE_BACKEND BST_FORCE_SANDBOX GI_TYPELIB_PATH INTEGRATION_CACHE http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY PYTEST_* REMOTE_EXECUTION_SERVICE SOURCE_CACHE_SERVICE SSL_CERT_FILE # # These keys are not inherited by any other sections # setenv = py{310,311,312,313,314}: XDG_CACHE_HOME = {envtmpdir}/cache py{310,311,312,313,314}: XDG_CONFIG_HOME = {envtmpdir}/config py{310,311,312,313,314}: XDG_DATA_HOME = {envtmpdir}/share !master: BST_VERSION = 2.7.0 master: BST_VERSION = master allowlist_externals = py{310,311,312,313,314}: mv mkdir {toxinidir}/tests/bzr_wrapper # # Code formatters # [testenv:format] skip_install = True deps = black==22.3.0 commands = black {posargs: src tests setup.py} # # Code format checkers # [testenv:format-check] skip_install = True deps = black==22.3.0 commands = black --check --diff {posargs: src tests setup.py} # # Running linters # [testenv:lint] commands_pre = # Build C extensions to allow Pylint to analyse them {envpython} setup.py build_ext --inplace commands = pylint {posargs: buildstream_plugins tests setup.py} # # Running static type checkers # [testenv:mypy] skip_install = True commands = mypy {posargs} deps = mypy==1.13.0 types-protobuf types-python-dateutil types-setuptools types-ujson -rrequirements/plugin-requirements.txt -rrequirements/test-requirements.txt -rrequirements/mypy-requirements.txt git+https://github.com/apache/buildstream@{env:BST_VERSION} # # Building documentation # [testenv:docs] commands = make -C doc # sphinx_rtd_theme < 0.4.2 breaks search functionality for Sphinx >= 1.8 deps = sphinx >= 1.8.5 sphinx_rtd_theme >= 0.4.2 -rrequirements/plugin-requirements.txt git+https://github.com/apache/buildstream@{env:BST_VERSION} passenv = BST_FORCE_SESSION_REBUILD BST_SOURCE_CACHE HOME LANG LC_ALL allowlist_externals = make # # Publish a release, make sure to update the version in setup.py first # [testenv:release] skip_install = true commands = python3 setup.py sdist bdist_wheel twine upload -r pypi dist/* deps = twine wheel passenv = TWINE_USERNAME TWINE_PASSWORD