Prior this change, RUN_PYLINT_* environment variables set by config.sh
have effect only while running in Travis (because runtox script sets
them by including config.sh). By wrapping pylint runner with shell
script, RUN_PYLINT_* environment variables have effect also while
running tox locally.
Some system roles want not to run black on their code. This wrapper
decides whether to run black or not depending on content of config.sh.
This wrapper also allows to set patterns of files and directories via
config.sh to be processed or skipped by black.
Not every system role contains parts written in Python, which
confuses pytest. With a shell wrapper around pytest, pytest
can be skipped or run with adjusted parameters depending on the
content or presence of system role's specific directories.
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