Hi Dominique,
the gi-find-desp.sh also adds Requires for imports in try/except blocks, which are optional.
possible fix: for module in $(egrep -h "try:|except.*:|from gi.repository import (\w+)" $1 \ | sed -ne '/try:/ { :start; n ; /except.*:/ { d; b }; bstart }; p ' \ | sed -e 's:#.*::' -e 's:raise ImportError.*::' -e 's:.*"from gi.repository import Foo".*::' | sed -e 's,from gi.repository import,,' -r -e 's:\s+$::g' -e 's:\s+as\s+\w+::g' -e 's:,: :g'); do split_name_version $module print_req_prov # Temporarly disabled... this is not true if the python code is written for python3... And there seems no real 'way' to identify this. # echo "python-gobject >= 2.21.4" done
This strips the try:/except.*/ blocks before any further processing.
One example is the Appindicator3 import in /usr/share/virt-manager/virtManager/systray.py.
Kind regards,
Stefan