Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #13106

Bug#980005: lumpy-sv: lumpyexpress fails with no args

From Ken Yamaguchi <debian@knowledgesynthesis.com>
Newsgroups linux.debian.bugs.dist, linux.debian.maint.python
Subject Bug#980005: lumpy-sv: lumpyexpress fails with no args
Date 2021-01-13 00:10 +0100
Message-ID <BwAXv-4HF-1@gated-at.bofh.it> (permalink)
References <Bwy9k-30B-5@gated-at.bofh.it> <Bwz5o-3yG-15@gated-at.bofh.it> <BwA1r-49m-3@gated-at.bofh.it> <Bwy9k-30B-5@gated-at.bofh.it> <BwA1r-49m-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Cross-posted to 2 groups.

Show all headers | View raw


On Wed, Jan 13, 2021 at 12:04:08AM +0200, Juhani Numminen wrote:
> It's a change made in debian/patches/lumpyexpress.config.patch.
> https://salsa.debian.org/med-team/lumpy-sv/-/commit/e64a65545fbf60c5c98965bc1d00d416b2f9582c#6864ced7557ec33a7ee70c7b0c75b076f84f4fac_24_30
> 
> -    $PYTHON_TEST -c "import imp; imp.find_module('pysam')"
> -    $PYTHON_TEST -c "import imp; imp.find_module('numpy')"
> +    $PYTHON_TEST -c "import importlib; importlib.util.find_spec('pysam')"
> +    $PYTHON_TEST -c "import importlib; importlib.util.find_spec('numpy')"
> 
> It's not entirely correct even if it worked: the original causes
> a visible error message to alert if one of the required modules does
> not exist. The current patch will not cause error messages or the
> python check to exit non-zero.
> 
> Because it's a Debian context we could rely on dpkg dependencies i.e.
> just don't perform this check and comment out the two lines.
> 
> --
> Juhani

There's a discussion of the issue at

    https://stackoverflow.com/questions/39660934/error-when-using-importlib-util-to-check-for-library/39661116

To remove the error,

-    $PYTHON_TEST -c "import imp; imp.find_module('pysam')"
-    $PYTHON_TEST -c "import imp; imp.find_module('numpy')"
+    $PYTHON_TEST -c "from importlib import util; util.find_spec('pysam')"
+    $PYTHON_TEST -c "from importlib import util; util.find_spec('numpy')"

To print an error message, perhaps the awkward-looking

-    $PYTHON_TEST -c "import imp; imp.find_module('pysam')"
-    $PYTHON_TEST -c "import imp; imp.find_module('numpy')"
+    $PYTHON_TEST -c "from importlib import util; print('pysam not found') if util.find_spec('pysam') is None else None"
+    $PYTHON_TEST -c "from importlib import util; print('numpy not found') if util.find_spec('numpy') is None else None"

Ken

Back to linux.debian.maint.python | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Bug#980005: lumpy-sv: lumpyexpress fails with no args Andreas Tille <andreas@an3as.eu> - 2021-01-12 22:10 +0100
  Bug#980005: lumpy-sv: lumpyexpress fails with no args Juhani Numminen <juhaninumminen0@gmail.com> - 2021-01-12 23:10 +0100
    Bug#980005: lumpy-sv: lumpyexpress fails with no args Ken Yamaguchi <debian@knowledgesynthesis.com> - 2021-01-13 00:10 +0100

csiph-web