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


Groups > linux.debian.maint.python > #13104 > unrolled thread

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

Started byAndreas Tille <andreas@an3as.eu>
First post2021-01-12 22:10 +0100
Last post2021-01-13 00:10 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.debian.maint.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  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

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

FromAndreas Tille <andreas@an3as.eu>
Date2021-01-12 22:10 +0100
SubjectBug#980005: lumpy-sv: lumpyexpress fails with no args
Message-ID<Bwz5o-3yG-15@gated-at.bofh.it>
Control: tags -1 confirmed
Control: tags -1 help

Hi,

I confirm I can reproduce the issue in a minimal chroot while the
lumpyexpress command prints the help screen as expected.  This smells
like a missing dependency but I do not have any idea which one.  It
seems there is a similar known issue here

   https://stackoverflow.com/questions/65028261/attributeerror-module-importlib-has-no-attribute-util-ii

but there is no answer here.

Any idea how to fix this?

Kind regards

      Andreas.

On Tue, Jan 12, 2021 at 08:05:26PM +0000, Ken Yamaguchi wrote:
> Package: lumpy-sv
> Version: 0.3.1+dfsg-4
> Severity: important
> X-Debbugs-Cc: debian@knowledgesynthesis.com
> 
> Dear Maintainer,
> 
> I built a lumpy-sv Docker image with the attached Dockerfile. Running a container for the image produces the following error:
> 
> Sourcing executables from /etc/lumpy-sv/lumpyexpress.config ...
> 
> Checking for required python modules (/usr/bin/python3)...
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> AttributeError: module 'importlib' has no attribute 'util'
> 
> Thanks,
> Ken
> 
> -- System Information:
> Debian Release: bullseye/sid
>   APT prefers testing
>   APT policy: (500, 'testing')
> Architecture: amd64 (x86_64)
> 
> Kernel: Linux 4.19.0-13-amd64 (SMP w/4 CPU threads)
> Kernel taint flags: TAINT_WARN
> Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
> Shell: /bin/sh linked to /bin/dash
> Init: unable to detect
> 
> Versions of packages lumpy-sv depends on:
> ii  bamkit            0.0.1+git20170413.ccd079d-2
> ii  libbamtools2.5.1  2.5.1+dfsg-7+b1
> ii  libc6             2.31-9
> ii  libgcc-s1         10.2.1-3
> ii  libgzstream0      1.5+dfsg-5
> ii  libhts3           1.11-4
> ii  libstdc++6        10.2.1-3
> ii  python3           3.9.1-1
> ii  python3-numpy     1:1.19.4-1+b1
> ii  python3-pysam     0.15.4+ds-3+b2
> ii  samblaster        0.1.26-1
> ii  samtools          1.11-1
> 
> Versions of packages lumpy-sv recommends:
> pn  sambamba  <none>
> 
> lumpy-sv suggests no packages.
> 
> -- no debconf information

> FROM debian:bullseye-slim
> 
> RUN apt-get update && \
>     apt-get -y --no-install-recommends full-upgrade && \
>     apt-get -y --no-install-recommends install \
>         lumpy-sv \
>         && \
>     rm -rf /var/lib/apt/lists/*
> 
> RUN useradd -ms /bin/bash lumpy
> 
> USER lumpy
> 
> WORKDIR /home/lumpy
> 
> CMD ["lumpyexpress"]

> _______________________________________________
> Debian-med-packaging mailing list
> Debian-med-packaging@alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-packaging


-- 
http://fam-tille.de

[toc] | [next] | [standalone]


#13105

FromJuhani Numminen <juhaninumminen0@gmail.com>
Date2021-01-12 23:10 +0100
Message-ID<BwA1r-49m-3@gated-at.bofh.it>
In reply to#13104
Andreas Tille kirjoitti 12.1.2021 klo 23.08:
> Hi,
> 
> I confirm I can reproduce the issue in a minimal chroot while the
> lumpyexpress command prints the help screen as expected.  This smells
> like a missing dependency but I do not have any idea which one.  It
> seems there is a similar known issue here
> 
>    https://stackoverflow.com/questions/65028261/attributeerror-module-importlib-has-no-attribute-util-ii
> 
> but there is no answer here.
> 
> Any idea how to fix this?
> 
> Kind regards
> 
>       Andreas.

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

[toc] | [prev] | [next] | [standalone]


#13106

FromKen Yamaguchi <debian@knowledgesynthesis.com>
Date2021-01-13 00:10 +0100
Message-ID<BwAXv-4HF-1@gated-at.bofh.it>
In reply to#13105
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web