update/software/tox.ini
Al Bailey 7f76bea9d3 Upload skeleton for unified software management
Current Status:
 - minimal debian packaging
 - python skeleton
 - tox
 - zuul integration
 - pecan API skeleton
 - unit tests

Next Steps:
 - CLI commands
 - API endpoints
 - controller
 - agent
 - expanded packaging

Test Plan:
  PASS: Build and Install ISO
  PASS: tox
  PASS: 'software' is in the PATH and can be invoked.
  PASS:  wget http://127.0.0.1:5490 returns 204 when
    software-api is running

Story: 2010676
Task: 47754
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I8e2d993ac85dcff7bb970ddf05fd63db9f2abe11
2023-04-03 14:03:04 +00:00

84 lines
1.8 KiB
INI

#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
[tox]
envlist = pep8,py39,pylint,bandit,cover
minversion = 2.3.2
skipsdist = True
[testenv]
allowlist_externals = find
sh
basepython = python3
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
install_command = pip install \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
{opts} {packages}
passenv =
XDG_CACHE_HOME
setenv = VIRTUAL_ENV={envdir}
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=C
OS_STDERR_CAPTURE=1
OS_STDOUT_CAPTURE=1
OS_TEST_TIMEOUT=60
PYTHONDONTWRITEBYTECODE=True
PYTHONHASHSEED=0
sitepackages = False
usedevelop = true
[bandit]
exclude = tests
skips =
[testenv:bandit]
commands = bandit --ini tox.ini -n 5 -r software
[testenv:cover]
setenv =
{[testenv]setenv}
PYTHON=coverage run --parallel-mode
commands =
coverage erase
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[flake8]
# H106: Don't put vim configuration in source files (off by default).
# H203: Use assertIs(Not)None to check for None (off by default).
# H904 Delay string interpolations at logging calls (off by default)
enable-extensions = H106 H203,H904
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,release-tag-*
ignore =
max-line-length = 80
show-source = True
[testenv:flake8]
commands = flake8 {posargs}
[testenv:pep8]
commands = flake8 {posargs}
[testenv:py39]
basepython = python3.9
commands =
stestr run {posargs}
stestr slowest
[testenv:pylint]
commands = pylint software --rcfile=./pylint.rc
[stestr]
test_path=./software/tests
top_dir=./
group_regex=([^\.]*\.)*