Update .gitea/workflow/*.yaml
This commit is contained in:
@@ -10,7 +10,7 @@ jobs:
|
|||||||
- name: Checkout source code
|
- name: Checkout source code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Python 3.10 # Setup Python inside the runner
|
- name: Install Python 3.10.12 # Setup Python inside the runner
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.10.12'
|
python-version: '3.10.12'
|
||||||
|
|||||||
54
backend/tox.ini
Normal file
54
backend/tox.ini
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
[flake8]
|
||||||
|
max-line-length = 100
|
||||||
|
|
||||||
|
[tox]
|
||||||
|
skipsdist = True
|
||||||
|
skip_missing_interpreters = True
|
||||||
|
envlist = fmt, lint, unit, integration
|
||||||
|
|
||||||
|
[vars]
|
||||||
|
all_path = {[vars]src_path} {[vars]tst_path}
|
||||||
|
src_path = {toxinidir}
|
||||||
|
tst_path = {toxinidir}/tests/
|
||||||
|
|
||||||
|
[testenv]
|
||||||
|
passenv =
|
||||||
|
PYTHONPATH
|
||||||
|
CHARM_BUILD_DIR
|
||||||
|
MODEL_SETTINGS
|
||||||
|
KUBECONFIG
|
||||||
|
setenv =
|
||||||
|
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
|
||||||
|
PYTHONBREAKPOINT=ipdb.set_trace
|
||||||
|
PY_COLORS=1
|
||||||
|
|
||||||
|
[testenv:fmt]
|
||||||
|
commands =
|
||||||
|
isort {[vars]all_path}
|
||||||
|
black {[vars]all_path}
|
||||||
|
deps =
|
||||||
|
-r requirements-fmt.txt
|
||||||
|
description = Apply coding style standards to code
|
||||||
|
|
||||||
|
[testenv:lint]
|
||||||
|
commands =
|
||||||
|
codespell {toxinidir}/. --skip {toxinidir}/.git --skip {toxinidir}/.tox \
|
||||||
|
--skip {toxinidir}/build --skip {toxinidir}/lib --skip {toxinidir}/venv \
|
||||||
|
--skip {toxinidir}/.mypy_cache \
|
||||||
|
--skip {toxinidir}/icon.svg --skip *.json.tmpl
|
||||||
|
# pflake8 wrapper supports config from pyproject.toml
|
||||||
|
pflake8 {[vars]all_path}
|
||||||
|
isort --check-only --diff {[vars]all_path}
|
||||||
|
black --check --diff {[vars]all_path}
|
||||||
|
deps =
|
||||||
|
-r requirements-lint.txt
|
||||||
|
description = Check code against coding style standards
|
||||||
|
|
||||||
|
[testenv:unit]
|
||||||
|
commands =
|
||||||
|
coverage run --source={[vars]src_path} \
|
||||||
|
-m pytest -vv --tb native {posargs}
|
||||||
|
coverage report
|
||||||
|
deps =
|
||||||
|
-r requirements-unit.txt
|
||||||
|
description = Run unit tests
|
||||||
Reference in New Issue
Block a user