Skip to content

Commit

Permalink
Moved pylint CI tests to run from tox (log2timeline#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz authored Jun 9, 2020
1 parent cb76185 commit 448ec86
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 58 deletions.
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ os: linux
dist: bionic
jobs:
include:
- name: "Pylint on Ubuntu Bionic (20.04) (Docker) with Python 3.8"
env: [TARGET="pylint", UBUNTU_VERSION="20.04"]
group: edge
language: python
python: 3.8
services:
- docker
- name: "Fedora 31 (Docker) with Python 3.7"
env: FEDORA_VERSION="31"
group: edge
Expand Down Expand Up @@ -75,6 +68,15 @@ jobs:
python: 3.8
services:
- docker
- name: "Pylint on Ubuntu Focal (20.04) (Docker) with Python 3.8 (tox)"
env:
- TOXENV="pylint"
- UBUNTU_VERSION="20.04"
group: edge
language: python
python: 3.8
services:
- docker
- name: "MacOS 10.14 with Python 3.7 (tox)"
env: TOXENV="py37"
os: osx
Expand Down
25 changes: 5 additions & 20 deletions config/travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ then
RPM_PACKAGES="python3-tox";

else
RPM_PACKAGES="";

if test ${TARGET} = "pylint";
then
RPM_PACKAGES="${RPM_PACKAGES} findutils pylint";
fi
RPM_PACKAGES="${RPM_PACKAGES} python3 ${RPM_PYTHON3_DEPENDENCIES} ${RPM_PYTHON3_TEST_DEPENDENCIES}";
fi
docker exec ${CONTAINER_NAME} dnf install -y ${RPM_PACKAGES};
Expand Down Expand Up @@ -76,21 +70,12 @@ then
if test -n "${TOXENV}";
then
DPKG_PACKAGES="build-essential curl python${TRAVIS_PYTHON_VERSION} python${TRAVIS_PYTHON_VERSION}-dev tox";

elif test "${TARGET}" = "jenkins3";
then
DPKG_PACKAGES="sudo";
else
DPKG_PACKAGES="";

if test "${TARGET}" = "jenkins3";
then
DPKG_PACKAGES="${DPKG_PACKAGES} sudo";

elif test ${TARGET} = "pylint";
then
DPKG_PACKAGES="${DPKG_PACKAGES} python3-distutils pylint";
fi
if test "${TARGET}" != "jenkins3";
then
DPKG_PACKAGES="${DPKG_PACKAGES} python3 ${DPKG_PYTHON3_DEPENDENCIES} ${DPKG_PYTHON3_TEST_DEPENDENCIES}";
fi
DPKG_PACKAGES="python3 ${DPKG_PYTHON3_DEPENDENCIES} ${DPKG_PYTHON3_TEST_DEPENDENCIES}";
fi
docker exec -e "DEBIAN_FRONTEND=noninteractive" ${CONTAINER_NAME} sh -c "apt-get install -y ${DPKG_PACKAGES}";

Expand Down
22 changes: 0 additions & 22 deletions config/travis/run_pylint.sh

This file was deleted.

8 changes: 0 additions & 8 deletions config/travis/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ then
if test -n "${TOXENV}";
then
TEST_COMMAND="tox -e ${TOXENV}";

elif test "${TARGET}" = "pylint";
then
TEST_COMMAND="./config/travis/run_pylint.sh";
else
TEST_COMMAND="./config/travis/run_python3.sh";
fi
Expand All @@ -46,10 +42,6 @@ then
elif test "${TARGET}" = "jenkins3";
then
TEST_COMMAND="./config/jenkins/linux/run_end_to_end_tests_py3.sh travis";

elif test "${TARGET}" = "pylint";
then
TEST_COMMAND="./config/travis/run_pylint.sh";
else
TEST_COMMAND="./config/travis/run_python3.sh";
fi
Expand Down
18 changes: 17 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py3{5,6,7,8},coverage
envlist = py3{5,6,7,8},coverage,pylint

[testenv]
pip_pre = True
Expand Down Expand Up @@ -29,3 +29,19 @@ deps =
codecov
commands =
codecov

[testenv:pylint]
skipsdist=True
pip_pre = True
setenv =
PYTHONPATH = {toxinidir}
deps =
-rrequirements.txt
-rtest_requirements.txt
pylint >= 2.4.0, < 2.5.0
commands =
pylint --version
# Ignore setup.py for now due to:
# setup.py:15:0: E0001: Cannot import 'distutils.command.bdist_msi' due to
# syntax error 'expected an indented block (<unknown>, line 347)' (syntax-error)
pylint --rcfile=.pylintrc dfdatetime tests

0 comments on commit 448ec86

Please sign in to comment.