Commit 619144ac authored by Vasilis Tsiligiannis's avatar Vasilis Tsiligiannis

Fix 'tox.ini' support for Python2 and Python3

* Let 'tox' select correct Python version
* Relax Python minor versions restriction
* Move package building in 'tox' configuration
Signed-off-by: Vasilis Tsiligiannis's avatarVasilis Tsiligiannis <acinonyx@openwrt.gr>
parent c2e24968
Pipeline #52397387 passed with stages
in 5 minutes and 16 seconds
......@@ -5,24 +5,33 @@ stages:
- deploy
static_python:
stage: static
image: python:2.7
image: python:2
before_script:
- pip install tox
script:
- tox -e flake8,yapf,pylint
- tox -e "py2-{flake8,yapf,pylint}"
static_python3:
stage: static
image: python:3
before_script:
- pip install tox
script:
- tox -e "py3-{flake8,yapf}"
static_robot:
stage: static
image: python:2.7
image: python:2
before_script:
- pip install tox
script:
- tox -e robot_lint
build:
stage: build
image: python:2.7
image: python:2
before_script:
- pip install tox
script:
- rm -rf dist
- python setup.py sdist bdist_wheel
- tox -e py2-build
artifacts:
expire_in: 1 week
when: always
......@@ -30,10 +39,12 @@ build:
- dist
build3:
stage: build
image: python:3.6
image: python:3
before_script:
- pip install tox
script:
- rm -rf dist
- python setup.py sdist bdist_wheel
- tox -e py3-build
artifacts:
expire_in: 1 week
when: always
......@@ -41,21 +52,21 @@ build3:
- dist
test:
stage: test
image: python:2.7
image: python:2
before_script:
- pip install tox
script:
- tox -e py27
- tox -e py2
test3:
stage: test
image: python:3.6
image: python:3
before_script:
- pip install tox
script:
- tox -e py36
- tox -e py3
deploy:
stage: deploy
image: python:2.7
image: python:2
before_script:
- pip install twine
script:
......
[tox]
envlist = flake8,yapf,pylint,robot_lint,py27,py36
envlist = {py2,py3}-{flake8,yapf,pylint,build},robot_lint,py2,py3
[flake8]
max-line-length = 180
[testenv:flake8]
[testenv:py2-flake8]
deps =
flake8
skip_install = True
......@@ -13,7 +13,16 @@ commands = flake8 \
setup.py \
satnogsclient
[testenv:yapf]
[testenv:py3-flake8]
deps =
flake8
skip_install = True
commands = flake8 \
--exclude 'satnogsclient/_version.py' \
setup.py \
satnogsclient
[testenv:py2-yapf]
deps =
yapf
skip_install = True
......@@ -22,7 +31,16 @@ commands = yapf -d -r \
setup.py \
satnogsclient
[testenv:pylint]
[testenv:py3-yapf]
deps =
yapf
skip_install = True
commands = yapf -d -r \
-e satnogsclient/_version.py \
setup.py \
satnogsclient
[testenv:py2-pylint]
deps =
pylint
commands = pylint -d "\
......@@ -35,13 +53,42 @@ commands = pylint -d "\
--ignore=_version.py \
{envsitepackagesdir}/satnogsclient
[testenv:py3-pylint]
deps =
pylint
commands = pylint -d "\
C0111,\
R0902,\
R0912,\
R0913,\
R0914,\
" \
--ignore=_version.py \
{envsitepackagesdir}/satnogsclient
[testenv:py2-build]
skip_install = True
commands =
python setup.py sdist bdist_wheel
[testenv:py3-build]
skip_install = True
commands =
python setup.py sdist bdist_wheel
[testenv:robot_lint]
deps =
robotframework
changedir = {toxinidir}/robot
commands = {toxinidir}/contrib/robot_lint.sh
[testenv:{py27,py36}]
[testenv:py2]
deps =
robotframework
changedir = {toxinidir}/robot
commands = python -m robot -d output testsuites
[testenv:py3]
deps =
robotframework
changedir = {toxinidir}/robot
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment