Skip to content

main/speedtest-cli: fix command line scripts

Keith Maxwell requested to merge maxwell-k/aports:speedtest-cli into master

Before this change:

$ dabuild sh
$ sudo apk add speedtest-cli >/dev/null && speedtest-cli --version
env: can't execute 'python': No such file or directory
$ speedtest --version
Traceback (most recent call last):
  File "/usr/bin/speedtest", line 6, in <module>
    from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'

This change removes the specific install line for speedtest-cli, because it leaves a broken shebang first line. setup.py already installs a speedtest-cli script which a functional shebang line.

This change adds py3-setuptools as a runtime dependency because pkg_resources is imported by a file installed into /usr/bin/:

$ grep pkg_resources /usr/bin/speedtest
from pkg_resources import load_entry_point

pkg_resources is part of py3-setuptools:

$ apk info -L py3-setuptools | grep pkg_resources/__init__.py
usr/lib/python3.8/site-packages/pkg_resources/__init__.py

After this change:

$ dabuild sh
$ sudo apk add speedtest-cli >/dev/null && speedtest-cli --version
speedtest-cli 2.1.2
Python 3.8.2 (default, Apr  9 2020, 21:05:08) [GCC 9.3.0]
$ speedtest --version
speedtest-cli 2.1.2
Python 3.8.2 (default, Apr  9 2020, 21:05:08) [GCC 9.3.0]

Merge request reports

Loading