[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[long] entry points and package which doesn not provide egg info or dist-info



Hello,

I am the maintainer of silx

I have this problem with the gui application

$ silx view
Traceback (most recent call last):
  File "/usr/bin/silx", line 33, in <module>
    sys.exit(load_entry_point('silx==1.1.2', 'console_scripts', 'silx')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/silx/__main__.py", line 67, in main
    status = launcher.execute(sys.argv)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/silx/utils/launcher.py", line 294, in execute
    return command.execute(command_argv)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/silx/utils/launcher.py", line 128, in execute
    status = func(argv)
             ^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/silx/app/view/main.py", line 214, in main
    mainQt(options)
  File "/usr/lib/python3/dist-packages/silx/app/view/main.py", line 156, in mainQt
    import silx.gui.utils.matplotlib  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/silx/gui/utils/matplotlib.py", line 39, in <module>
    from pkg_resources import parse_version
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3328, in <module>
    @_call_aside
     ^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3303, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3341, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 631, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 969, in require
    needed = self.resolve(parse_requirements(requirements))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 829, in resolve
    dist = self._resolve_dist(
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 871, in _resolve_dist
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'h5py' distribution was not found and is required by 'hdf5plugin silx'

So the entry point do not find the h5py package even if python3-h5py is installed via python3-h5py-serial

I reported the issue to the h5py  maintainer via this bug report.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1051781

This package is a bit special since it provide a serial implementation python3-h5py-serial and an MPI one via the 
python3-h5py-mpi. both packages are co-installable.

In each of these packages there is an 

/usr/lib/python3/dist-packages/h5py._debian_h5py_serial-3.7.0.dist-info/METADATA
/usr/lib/python3/dist-packages/h5py._debian_h5py_serial-3.7.0.dist-info/RECORD
/usr/lib/python3/dist-packages/h5py._debian_h5py_serial-3.7.0.dist-info/WHEEL
/usr/lib/python3/dist-packages/h5py._debian_h5py_serial-3.7.0.dist-info/top_level.txt

and

/usr/lib/python3/dist-packages/h5py._debian_h5py_mpi-3.7.0.dist-info/METADATA
/usr/lib/python3/dist-packages/h5py._debian_h5py_mpi-3.7.0.dist-info/RECORD
/usr/lib/python3/dist-packages/h5py._debian_h5py_mpi-3.7.0.dist-info/WHEEL
/usr/lib/python3/dist-packages/h5py._debian_h5py_mpi-3.7.0.dist-info/top_level.txt

On Debian the two versions are named h5py._debian_h5py_serial and h5py._debian_h5py_mpi

This organisation is specific to Debian since upstream provide only one version of the h5py package.
On Debian we are able to co-install and MPI and a serial version of this library linked 
to the serial or mpi version of the hdf5 library.

the differences are 

$ diff /usr/lib/python3/dist-packages/h5py._debian_h5py_serial-3.7.0.dist-info/METADATA /usr/lib/python3/dist-packages/h5py._debian_h5py_mpi-3.7.0.dist-info/METADATA 
2c2
< Name: h5py.-debian-h5py-serial
---
> Name: h5py.-debian-h5py-mpi
30a31
> Requires-Dist: mpi4py (>=3.0.2)

so the name and a dependecy to the mpi4py package.

for the RECORD part the installed files are  located in two different directory, so they are totally different.

top_level.txt  WHEEL are identical

There is a generic python3-h5py which is used in the B-D of packages depending on h5py.
It is almost empty but depends on one of the two implementations.

$ dpkg -L python3-h5py
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/python3-h5py
/usr/share/doc/python3-h5py/README.Debian
/usr/share/doc/python3-h5py/README.rst
/usr/share/doc/python3-h5py/changelog.Debian.gz
/usr/share/doc/python3-h5py/copyright

$ apt show python3-h5py
Package: python3-h5py
Version: 3.7.0-8
Priority: optional
Section: python
Source: h5py
Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Installed-Size: 22,5 kB
Depends: python3-h5py-serial | python3-h5py-mpi

This package does not provide a dist-info named h5py. So all entry points which depends on h5py will failed (like silx)
bookworm is affected by this issue. Nevertheless I do not know how many packages have this issue, the rdepends on python3-h5py is  like this

  Dépend: dioptas
  Dépend: invesalius
  Dépend: mcaller
  Dépend: ont-fast5-api
  Dépend: pbhoney
  Dépend: poretools
  Dépend: pycoqc
  Dépend: pyfr
  Dépend: python3-anndata (>= 3)
  Dépend: python3-astrodendro (>= 0.2.0)
  Dépend: python3-bayespy
  Dépend: python3-binoculars
  Dépend: python3-biom-format
  Dépend: python3-bioxtasraw
  Dépend: python3-bmtk
  Dépend: python3-cooler (>= 2.5)
  Dépend: python3-dipy
  Dépend: python3-fabio
  Dépend: python3-genx
  Dépend: python3-glue (>= 2.10)
  Dépend: python3-guidata (>= 3.0)
  Dépend: python3-h5netcdf
  Dépend: python3-hdf5plugin
  Dépend: python3-hdf5storage
  Dépend: python3-hdf-compass
  Dépend: python3-hdmf (>= 2.10)
  Dépend: python3-hdmf (<< 4)
  Dépend: python3-hickle (>= 2.10.0)
  Dépend: python3-hydroffice.bag
  Dépend: python3-hyperspy (>= 2.3)
  Dépend: python3-keras
  Dépend: python3-keras-applications
  Dépend: python3-loompy
  Dépend: python3-mintpy
  Dépend: python3-mofapy
  Dépend: python3-nabu (>= 3.0)
  Dépend: python3-openems
  Dépend: python3-pyfai
  Dépend: python3-pygac
  Dépend: python3-pyhst2-cuda
  Dépend: python3-pymca5
  Dépend: python3-pynwb (>= 2.9~)
  Dépend: python3-pyspectral
  Dépend: python3-sardana
  Dépend: python3-sasdata
  Dépend: python3-sasview
  Dépend: python3-silx
  Dépend: python3-skbio (>= 3.6.0)
  Dépend: python3-taurus
  Dépend: python3-tomoscan (>= 3.0)
  Dépend: python3-unifrac (>= 3.3.0)
  Dépend: python3-xraylarch (>= 3.2)
  Dépend: python3-xrayutilities
  Dépend: python3-yt
  Dépend: q2-feature-table
  Dépend: q2-quality-control
  Dépend: q2-types
  Dépend: siconos-mechanics-tools (>= 2.8.0-1)
  Dépend: tombo
  Est en conflit avec: python3-h5py-serial (<< 2.10.0-3~)
python3-h5py
  Recommande: pan-data-reduction-frameworks
  Recommande: pizzly
  Recommande: pysph-viewer
  Recommande: python3-bcbio
  Recommande: python3-geotiepoints
  Recommande: python3-meshio
  Recommande: python3-pbcore
  Recommande: python3-satpy
Reverse Depends:
  Suggère: python3-astropy
  Suggère: python3-dask
  Suggère: python3-h5py-mpi
  Suggère: python3-h5py-serial
  Suggère: python3-klepto
  Suggère: python3-veusz
  Suggère: python3-vigra
  Suggère: python3-zarr
  Suggère: science-nanoscale-physics-dev

- The dependencies are expected to be h5py in all upstream projects. So my question is how do we provide this egg info , should we use alternative in order to create the dist-info depending on the packages installed. Is alternative the right tool for this use case ?

- Is it possible or a desirable expectation from dh_python to failed if there is entry point expecting no available dist of egg info ? This way we will not provide non working packages.

- or a lintian check would be more appropriate for this purpose ?

- how do we fix bookworm ?

thanks for your time

Frederic


Reply to: