[lxc-devel] [pylxd/master] Use stages for travis builds
albertodonato on Github
lxc-bot at linuxcontainers.org
Fri Dec 4 16:05:19 UTC 2020
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 302 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20201204/3c5d031a/attachment.bin>
-------------- next part --------------
From 96ea34c6f73d2aa7bde0d13c3d6b8398440f3950 Mon Sep 17 00:00:00 2001
From: Alberto Donato <alberto.donato at canonical.com>
Date: Fri, 4 Dec 2020 16:51:46 +0100
Subject: [PATCH 1/2] move all configs to setup.cfg
Signed-off-by: Alberto Donato <alberto.donato at canonical.com>
---
.coveragerc | 12 ----------
setup.cfg | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++
tox.ini | 48 ---------------------------------------
3 files changed, 65 insertions(+), 60 deletions(-)
delete mode 100644 .coveragerc
delete mode 100644 tox.ini
diff --git a/.coveragerc b/.coveragerc
deleted file mode 100644
index 6f82cddc..00000000
--- a/.coveragerc
+++ /dev/null
@@ -1,12 +0,0 @@
-[run]
-branch = True
-source = pylxd
-
-[report]
-show_missing=True
-omit =
- pylxd/tests/*
- pylxd/deprecated/*
-exclude_lines =
- def __str__
- pragma: no cover
diff --git a/setup.cfg b/setup.cfg
index 55144ac4..f4a58d3b 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -28,6 +28,11 @@ install_requires =
ws4py!=0.3.5, >=0.3.4 # 0.3.5 is broken for websocket support
packages = find:
+[globals]
+lint_files =
+ {toxinidir}/pylxd
+ {toxinidir}/setup.py
+
[build_sphinx]
source-dir = doc/source
build-dir = doc/build
@@ -52,3 +57,63 @@ output_file = pylxd/locale/pylxd.pot
[nosetests]
nologcapture=1
+
+[flake8]
+show-source = True
+ignore = E203, E266, E501, W503, W504
+builtins = _
+exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
+
+[tox:tox]
+minversion = 1.6
+envlist = py3, pypy, lint
+skipsdist = True
+
+[testenv]
+usedevelop = True
+install_command = pip install -U {opts} {packages}
+setenv =
+ VIRTUAL_ENV={envdir}
+ PYLXD_WARNINGS=none
+deps =
+ -r{toxinidir}/test-requirements.txt
+commands = nosetests --with-coverage --cover-package=pylxd pylxd
+
+[testenv:integration]
+commands = nosetests integration
+
+[testenv:migration]
+commands = nosetests migration
+
+[testenv:format]
+basepython=python3
+deps =
+ black == 20.8b1
+ isort == 5.6.4
+commands=
+ isort --profile black {[globals]lint_files}
+ black {[globals]lint_files}
+
+[testenv:lint]
+basepython=python3
+deps =
+ black == 20.8b1
+ flake8 >= 2.5.0
+ isort == 5.6.4
+commands=
+ black --check {[globals]lint_files}
+ isort --profile black --check-only --diff {[globals]lint_files}
+ flake8 {[globals]lint_files}
+
+[coverage:run]
+branch = True
+source = pylxd
+
+[coverage:report]
+show_missing = True
+omit =
+ pylxd/tests/*
+ pylxd/deprecated/*
+exclude_lines =
+ def __str__
+ pragma: no cover
diff --git a/tox.ini b/tox.ini
deleted file mode 100644
index a0fb1be6..00000000
--- a/tox.ini
+++ /dev/null
@@ -1,48 +0,0 @@
-[tox]
-minversion = 1.6
-envlist = py3,pypy,lint
-skipsdist = True
-
-[testenv]
-usedevelop = True
-install_command = pip install -U {opts} {packages}
-setenv =
- VIRTUAL_ENV={envdir}
- PYLXD_WARNINGS=none
-deps =
- -r{toxinidir}/test-requirements.txt
-commands = nosetests --with-coverage --cover-package=pylxd pylxd
-
-[testenv:integration]
-commands = nosetests integration
-
-[testenv:migration]
-commands = nosetests migration
-
-[testenv:format]
-basepython=python3
-deps =
- black==20.8b1
- flake8>=2.5.0
- isort==5.6.4
-commands=
- isort --profile black {toxinidir}/pylxd
- black {toxinidir}/pylxd
-
-[testenv:lint]
-basepython=python3
-deps =
- black==20.8b1
- flake8>=2.5.0
- isort==5.6.4
-commands=
- black --check {toxinidir}/pylxd
- isort --profile black --check-only --diff {toxinidir}/pylxd
- flake8 {toxinidir}/pylxd
-
-
-[flake8]
-show-source = True
-ignore = E203, E266, E501, W503, W504
-builtins = _
-exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
From 3452a0354925a6e702471c85a4e667a5d35334e9 Mon Sep 17 00:00:00 2001
From: Alberto Donato <alberto.donato at canonical.com>
Date: Fri, 4 Dec 2020 16:56:11 +0100
Subject: [PATCH 2/2] use stages for travis builds
---
.travis.yml | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 70242a5e..330b524c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,20 +3,20 @@ python:
- "3.6"
- "3.7"
- "3.8"
-env:
- matrix:
- - TOXENV=py3
- - TOXENV=lint
- # - TOXENV=integration # requires a remote lxd setup
-
-install:
- - travis_retry pip install tox
- - pip install codecov
+stages:
+ - lint
+ - test
+install: pip install tox codecov
+jobs:
+ fast_finish: true
+ include:
+ - stage: lint
+ script: tox -e lint
+ python: "3.6"
script:
- - tox
+ - tox -e py
- test -d .tox/$TOXENV/log && cat .tox/$TOXENV/log/*.log || true
cache:
directories:
- $HOME/.cache/pip
-after_success:
- - codecov
+after_success: codecov
More information about the lxc-devel
mailing list