Check enchant-2 exec presence in tox spelling job 14/97814/1
authorguillaume.lambert <guillaume.lambert@orange.com>
Thu, 23 Sep 2021 07:26:37 +0000 (09:26 +0200)
committerGuillaume Lambert <guillaume.lambert@orange.com>
Fri, 15 Oct 2021 17:38:27 +0000 (17:38 +0000)
enchant-2 has superseded enchant (v1) in recent GNU/Linux distributions
such as debian 11.
We do not need to ask enchant installation if enchant-2 executable is
detected on the system.

Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I8b453534934737bdd11ba4e22cdf5b3e6ae62474
(cherry picked from commit d54083eb676301e1408533b64c71474666756860)

tox.ini

diff --git a/tox.ini b/tox.ini
index fdb60289c50db52df7316a9af60cc0cda42f10f8..69e2c714c35d6f6991a44b2d0a2ddc7c187d20e2 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -55,6 +55,6 @@ deps =
     PyEnchant
 whitelist_externals = sh
 commands =
-    sh -c 'command enchant>/dev/null || sudo yum -y install enchant || (echo "enchant command not found - please install it (e.g. sudo apt-get install enchant | yum install enchant )" >&2 && exit 1)'
+    sh -c 'command enchant>/dev/null || command enchant-2 -v>/dev/null || sudo yum -y install enchant || (echo "enchant command not found - please install it (e.g. sudo apt-get install enchant | yum install enchant )" >&2 && exit 1)'
     sphinx-build -q -W -b spelling -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/spelling