Commit f2932247 authored by Kirill Smelkov's avatar Kirill Smelkov

X neotest/info-local: Don't crash if an egg could not be found

before:

    # Thu, 02 Nov 2017 12:06:49 +0300
    # kirr@deco.navytux.spb.ru (2401:5180:0:37::1 192.168.0.2)
    # Linux deco 4.13.0-1-amd64 #1 SMP Debian 4.13.4-2 (2017-10-15) x86_64 GNU/Linux
    # cpu: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
    # cpu[0-3]: freq: intel_pstate/powersave [.40GHz - 3.40GHz]
    # cpu[0-3]: idle: intel_idle/menu: POLL(0μs) C1(2μs) C1E(10μs) C3(70μs) C6(85μs) C7s(124μs) C8(200μs) C9(480μs) C10(890μs)
    # cpu: WARNING: frequency not fixed - benchmark timings won't be stable
    # cpu: WARNING: C-state exit-latency is max 890μs - up to that can add to networked and IPC request-reply latency
    # sda: SanDisk X400 M.2  rev 0012  477G
    # wlan0: Intel Corporation Wireless 8260 rev 3a
    # wlan0: features: !rx !tx sg !tso !ufo gso gro !lro !rxvlan !txvlan !ntuple !rxhash ...
    # wlan0: coalesce: rxc: ?,  txc: ?
    # wlan0: down, speed=?, mtu=1500, txqlen=1000, gro_flush_timeout=0.000µs
    # wlan0: WARNING: TSO not enabled - TCP latency with packets > MSS will be poor
    # eth0: Intel Corporation Ethernet Connection I219-LM rev 21
    # eth0: features: rx tx sg tso !ufo gso gro !lro rxvlan txvlan !ntuple rxhash ...
    # eth0: coalesce: rxc: 3μs/0f/0μs-irq/0f-irq,  txc: 0μs/0f/0μs-irq/0f-irq
    # eth0: up, speed=1000, mtu=1500, txqlen=1000, gro_flush_timeout=0.000µs
    # Python 2.7.14
    # go version go1.9.2 linux/amd64
    # sqlite 3.20.1 (py mod 2.6.0)
    # mysqld  Ver 10.1.26-MariaDB-1 for debian-linux-gnu on x86_64 (Debian unstable)
    Traceback (most recent call last):
      File "<string>", line 4, in <module>
      File "/home/kirr/src/wendelin/venv/z-dev/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 963, in require
        needed = self.resolve(parse_requirements(requirements))
      File "/home/kirr/src/wendelin/venv/z-dev/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 849, in resolve
        raise DistributionNotFound(req, requirers)
    pkg_resources.DistributionNotFound: The 'neoppod' distribution was not found and is required by the application

after:

    # Thu, 02 Nov 2017 12:09:01 +0300
    # kirr@deco.navytux.spb.ru (2401:5180:0:37::1 192.168.0.2)
    # Linux deco 4.13.0-1-amd64 #1 SMP Debian 4.13.4-2 (2017-10-15) x86_64 GNU/Linux
    # cpu: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
    # cpu[0-3]: freq: intel_pstate/powersave [.40GHz - 3.40GHz]
    # cpu[0-3]: idle: intel_idle/menu: POLL(0μs) C1(2μs) C1E(10μs) C3(70μs) C6(85μs) C7s(124μs) C8(200μs) C9(480μs) C10(890μs)
    # cpu: WARNING: frequency not fixed - benchmark timings won't be stable
    # cpu: WARNING: C-state exit-latency is max 890μs - up to that can add to networked and IPC request-reply latency
    # sda: SanDisk X400 M.2  rev 0012  477G
    # wlan0: Intel Corporation Wireless 8260 rev 3a
    # wlan0: features: !rx !tx sg !tso !ufo gso gro !lro !rxvlan !txvlan !ntuple !rxhash ...
    # wlan0: coalesce: rxc: ?,  txc: ?
    # wlan0: down, speed=?, mtu=1500, txqlen=1000, gro_flush_timeout=0.000µs
    # wlan0: WARNING: TSO not enabled - TCP latency with packets > MSS will be poor
    # eth0: Intel Corporation Ethernet Connection I219-LM rev 21
    # eth0: features: rx tx sg tso !ufo gso gro !lro rxvlan txvlan !ntuple rxhash ...
    # eth0: coalesce: rxc: 3μs/0f/0μs-irq/0f-irq,  txc: 0μs/0f/0μs-irq/0f-irq
    # eth0: up, speed=1000, mtu=1500, txqlen=1000, gro_flush_timeout=0.000µs
    # Python 2.7.14
    # go version go1.9.2 linux/amd64
    # sqlite 3.20.1 (py mod 2.6.0)
    # mysqld  Ver 10.1.26-MariaDB-1 for debian-linux-gnu on x86_64 (Debian unstable)
    # neo             : ø
    # zodb            : 5.3.0-6-g52d79afa3
    # zeo             : 5.1.0-11-gbd4aaf68
    # mysqlclient     : ø
    # wendelin.core   : ø
parent 68e94d09
......@@ -442,7 +442,15 @@ pyver() {
{
read loc
read pyver
} < <(python -c "import pkg_resources as p; e=p.require(\"$egg\")[0]; print(\"%s\n%s\" % (e.location, e.version))")
} < <(python -c "
import pkg_resources as p
try:
e=p.require(\"$egg\")[0]
except p.DistributionNotFound:
print(\"\nø\")
else:
print(\"%s\n%s\" % (e.location, e.version))
")
local gitver=$(git -C $loc describe --long --dirty 2>/dev/null)
local ver
test "$gitver" != "" && ver="$gitver" || ver="$pyver"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment