Until we will be sure about system python detection in tox-travis
or we find another way of how to enforce running molecule on
system python, we must prevent the bumping system python version
when Travis team bumps default building environmet by setting the
building environment explicitly.
Do not make extra package installing dependent on TRAVIS_PYTHON_VERSION.
Instead, install them if they are available (silently ignore errors
about missing packages).
Try to keep CI configuration in a one place (this involves removing
LSR_USE_PYTHON from Travis CI Web Settings Interface and then the
loss of reason to keep it in .travis.yml)
Introduce several environment variables:
RUN_PYLINT_DISABLED - disable pylint execution
RUN_PYLINT_INCLUDE - specify regex for files to be included
RUN_PYLINT_EXCLUDE - specify regex for files to be excluded
Virtual environments names are now based on the version of Python
interpreter that is used. This prevents creation of redundant
environments, that is there will be only one[1] virtual environment
per Python interpreter, which saves the time by preventing the
installation of the same packages more than once.
[1] In Travis CI, this is easy to implement by using the
TRAVIS_PYTHON_VERSION environment variable. Locally, as there
is no information about what version of Python interpreter is
used when creating a virtual environment in tox, there may be
more virtual environments per interpreter (for example, env-3.6
and env-molecule may be both based on Python 3.6).
Add run_pylint.py that probe working directory for python source files
and pass them to pylint. This is needed because pylint expects module
or package, so passing a directory with no __init__.py in it makes
pylint angry. With this change, LSR_PYLINT_DIRS is no longer needed.
Additionally, we no longer need:
- init-hook in pylintrc
- [pylintrc] section in tox.ini, because the configuration from this
section is now the part of pylintrc
- [pycodestyle] section in tox.ini, because pycodestyle linter is not
used
- use `./.travis/runtox [ARG1 [ARG2 [...[ARGn]]]]` to run tox locally
- use LSR_USE_PYTHON to decide whether to run jobs with pylinters and
pytesters or not
This commit introduces the refactored Travis CI setup and tox.ini
to fullfil the need to have common CI setup across all roles.
The current proposal and discussion can be found at:
https://github.com/linux-system-roles/template/issues/4
Fedora 30 uses tox 3 which does not work with Python 2.6 out of the box.
Setting the install and list_dependencies commands to run `pip` instead
of `python -m pip` seems to fix this for now.
This removes warnings like:
[WARNING]: The value False (type bool) in a string field was converted
to u'False' (type string). If this does not look like what you expect,
quote the entire value to ensure it does not change.