diff options
author | ng0 <ng0@n0.is> | 2019-12-15 11:41:56 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-12-15 11:41:56 +0000 |
commit | ba139160511026f08dd4611dc689ee5a211febf5 (patch) | |
tree | 37ea0660357c380af7e429e8294a671343b65c81 /talerbuildconfig.py | |
parent | dd000ee983962b11a94cd0fcaa6d46ba9699b456 (diff) | |
download | build-common-ba139160511026f08dd4611dc689ee5a211febf5.tar.gz build-common-ba139160511026f08dd4611dc689ee5a211febf5.tar.bz2 build-common-ba139160511026f08dd4611dc689ee5a211febf5.zip |
add tox.
Diffstat (limited to 'talerbuildconfig.py')
-rw-r--r-- | talerbuildconfig.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/talerbuildconfig.py b/talerbuildconfig.py index 68a8630..7e91de4 100644 --- a/talerbuildconfig.py +++ b/talerbuildconfig.py @@ -188,6 +188,48 @@ class EmscriptenTool: return True return False +class PyToxTool(Tool): + name ="tox" + + def args(self, parser): + parser.add_argument( + "--with-tox", type=str, help="name of the tox executable" + ) + + def check(self, buildconfig): + # No suffix. Would probably be cheaper to do this in + # the dict as well. We also need to check the python + # version it was build against (TODO). + if existence("tox"): + import tox + mypytox_version = tox.__version__ + buildconfig._set_tool("tox", "tox", mypytox_version) + return True + else: + # Has suffix, try suffix. We know the names in advance, + # so use a dictionary and iterate over it. Use enough names + # to safe updating this for another couple of years. + version_dict = { + "3.0": "tox-3.0", + "3.1": "tox-3.1", + "3.2": "tox-3.2", + "3.3": "tox-3.3", + "3.4": "tox-3.4", + "3.5": "tox-3.5", + "3.6": "tox-3.6", + "3.7": "tox-3.7", + "3.8": "tox-3.8", + "3.9": "tox-3.9", + "4.0": "tox-4.0", + } + for key, value in version_dict.items(): + if existence(value): + # FIXME: This version reporting is slightly off + # FIXME: and only maps to the suffix. + mypytox_version = key + buildconfig._set_tool("tox", value, mypytox_version) + return True + class PyBabelTool(Tool): name = "pybabel" |