This does a few things with the end goal of making simplifying and
making consistent tox and 'make' methods of test or check.
Things here:
* move python programs out of bin and into their own main. Use
entry_points to get scripts written for them. One gain here is
that we no longer have python programs that are not named .py.
flake8 and friends would not check those programs by default.
* install scripts in bin/ using the setup.py scripts and adjust
snapcraft.yaml and debian packaging for that.
* declare and use PYTHON in Makefile to avoid repeating 'python3'
* declare and use CHECK_DIRS in Makefile for list of dirs to check.
* no longer run 'flake8' from 'make check' by default.
* remove the old tests/ directory.
This puts into place a tox.ini for running unit tests without
a large amount of deps installed into the system. For example,
we did not want to need libnl-route-3-dev or build-essential installed
in the system in order to run unit tests.
In order avoid import errors in the modules due to these missing
dependencies, we have added a 'fake_deps/' directory that provides
mock'd objects of the dependencies that were used.
The only installed packages necessary for this to run should be
tox itself and its dependencies (pip and friends). From a clean new
container we can then do:
apt-get install tox
git clone ...
tox
Also along the way:
* adjust setup.py to only need the DistUtilsExtra during 'build'.
This means tox usage doesn't require python3-distutils-extra.
* drop use of lsb_release in favor of built-in parsing.
This python module wasn't doing much. We can parse /etc/lsb-release
ourselves with less footprint. Also part of the motivation for this
is that lsb_release was not on pypi.
* replace use of StorageInfo in test_partition.py with a FakeStorageInfo
* .gitignore: ignore only the top level 'probert' directory so that
we can track fake_deps/probert.
* fix a couple escape chars, by using raw strings (r'').
* adjust gettext to return un-modified strings rather than '_(string)',
but support old style if FAKE_TRANSLATE=mangle.