Hi, On Thu, Aug 15, 2024 at 12:16 PM Julian Gilbey <jul...@d-and-j.net> wrote: > > On Thu, Aug 15, 2024 at 11:25:46AM -0300, Andreas Hasenack wrote: > > Hello, > > [...] > > > Thanks for raising this! What a surprise - I hadn't realised this > > > problem. But I'm not sure about the proposed patch: jupyter-client > > > itself calls ifconfig (in jupyter_client/localinterfaces.py), so it > > > might be better to have this dependency be part of the binary package > > > itself rather than just part of the test suite. > > > > > > If this isn't needed (have a read of the code in that file - it will > > > not fail is ifconfig is not found, just that some functionality will > > > be lost), and it's just that the test is failing, then your patch > > > would be fine. > > > > Ah, good catch. Looks the code tries 4 different approaches, in order: > > - netifaces, provided by python3-netifaces (not a Depends) > > - /sbin/ip from iproute2, also not a dependency, and in ubuntu > > iproute2 is "important" > > - /sbin/ifconfig (this bug) > > - gethostbyname, provided by /usr/lib/python3.12/socket.py, packaged > > in libpython3.12-minimal, which will be installed because jupyter is > > python > > > > I guess the last one will always work, and even that one has a > > fallback of returning 127.0.0.1 > > > > Maybe a Recommends for python3-netifaces, which seems the less > > error-prone method, as it doesn't involve any parsing of command > > output (ip or ifconfig)? > > Except that python3-netifaces is abandoned upstream, so I don't really > want to add new dependencies on it. :/
Oh, didn't know that, we have it in ubuntu main even. > > There is a package which is maintained (if struggling) which could be > used instead of netiface: psutil. But that should be an upstream > change rather than a Debian-local change. How about iproute2 then? That's likely already installed in most places anyway. But again, I'm not sure what bug we are fixing at this point. I don't know if out there on live systems it's using netifaces, iproute2, ifconfig, of just gethostbyname. > > > The test seems to be expecting ifconfig, though. Unsure if it's a side > > effect of not having found any of the other alternatives. > > No, the test explicitly tests that the ifconfig method works: Ok, so at least for the test we need net-tools. The question is if we should also add it (or an alternative, like iproute2) to the Depends/Recommends of the package. I'm not familiar with jupyter-clients to have a good opinion on whether the gethostbyname fallback is good enough, or if we should recommend something better like iproute2 or net-tools. Between these last two, I would prefer iproute2, as net-tools has been slowly deprecated in favor of iproute2.