Drop tox. Instead run tests on tree in snap environment.
The use of tox for git-ubuntu unit tests and pylint is problematic
for a number of reasons.
- as with all virtualenv, any dependency that is not pure python
requires compilation and non-virtualenv dependencies.
- distro_info is not installable from pypi.
- git-ubuntu is expected to run in the snap environment.
All of these issues are not a problem in the snap environment. The
solution here is to run the tests in an already-existing snap environment.
This does present a bit of a chicken-egg problem, but one that is only
exposed when we add new python dependencies to git-ubuntu.
git-ubuntu-self-test is modified to accept a TEST_TREE environment
variable and do the right thing in both snap environment and development
tree.
So now both of these work:
# test the snap installed git-ubuntu libraries.
$ git-ubuntu.self-test
# test the tree in "."
$ ./snap-wrappers/wrappers/git-ubuntu-self-test
Other things done here:
a.) remove DEBEMAIL from environment to avoid bug 1801948.
b.) remove tox.ini file
c.) remove pylintrc in favor of running with explicit command line options.
This is preferable as pylintrc is not available when
'git-ubuntu.self-test' is run from the snap itself.
d.) execute pylint with --jobs=0 , which selects 1 process per core.
e.) use 'rm -f' rather than 'unlink' for removing pycoverage file.
f.) place 'SNAP_REVISION' and 'SNAP_VERSION' into environment.
these are just informative.
If we change directory to the location of the gitubuntu Python module
first, the commands to pylint and pytest are simpler and additionally
has the advantage that the output from pytest is nicer.
The newest astroid (a dependency of pylint) doesn't work with the pinned
version of pylint, causing it to fail.
Instead, unpin pylint. This stops us falling behind on ancient pinned
versions of modules, and we can rely on CI to pick up problems nightly
as with this particular failure.
Since we can't easily unpin with a cached copy of pylint, install it
directly from PyPI as a "dependency" of git-ubuntu itself instead of as
a separate part.
The latest pylint still doesn't play well with the use of py.path, but
differently, causing an ImportError at pylint time when there is no such
problem at runtime. Add it to the list of modules to ignore.