This repository has been archived by the owner on Jun 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtox.ini
76 lines (68 loc) · 1.95 KB
/
tox.ini
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
[tox]
minversion = 3.8.6
envlist =
lint
unittest
[testenv]
basepython = python3.7
passenv = *
setenv =
PYTHONDONTWRITEBYTECODE=1
commands_pre =
find {toxinidir} -type f -not -path '{toxinidir}/.tox/*' -path '*/__pycache__/*' -path '*/build/*' -name '*.py[c|o]' -delete
whitelist_externals =
find
bash
# Enabling sitepackages is needed if you need to avoid encountering exceptions
# caused by missing selinux python bindinds in ansible modules like template.
# Selinux python bindings are binary and they cannot be installed using pip
# in virtualenvs. Details: https://github.com/ansible/molecule/issues/1724
sitepackages = false
[flake8]
max-line-length = 90
max-complexity = 11
[testenv:lint]
deps = flake8>=3.6.0,<4
commands = flake8 piperci_gman tests
skip_install = true
usedevelop = false
[testenv:unittest]
deps = pdbpp
usedevelop = true
extras = test
commands =
pip freeze
pytest tests --cov=piperci_gman --cov-report=term-missing --no-cov-on-fail {posargs}
[testenv:build-docker]
platform = ^darwin|^linux
usedevelop = False
skip_install = True
deps =
setuptools_scm==3.3.3
commands_pre =
commands =
sh -c '\
TAG=$(python -c "from setuptools_scm import get_version; print(get_version())") && \
TAG=$(echo $TAG | tr "+" "_") && \
echo Building version "$TAG"... && \
docker pull piperci/gman:builder || true && \
docker build \
--target builder \
--cache-from piperci/gman:builder \
-t piperci/gman:builder \
"." && \
docker pull piperci/gman:latest || true && \
docker build \
--cache-from piperci/gman:builder \
--cache-from piperci/gman:latest \
-t piperci/gman:$TAG \
-t piperci/gman:latest \
"." \
'
# Push runtime images to remote repository
#docker push piperci/gman:$TAG
#docker push piperci/gman:latest
# Push builder image to remote repository for next build
#docker push piperci/gman:builder
whitelist_externals =
sh