gvalkov / python-evdev

Python bindings for the Linux input subsystem
https://python-evdev.rtfd.org/
BSD 3-Clause "New" or "Revised" License
336 stars 112 forks source link

pip install does not use wheel, probably mangled filenames #221

Open smemsh opened 3 months ago

smemsh commented 3 months ago

Wheels appear to be available, but it looks like the non-musl ones have mangled filenames:

 $ elinks -dump -no-numbering -no-references \
   https://pypi.org/simple/evdev-binary/ \
   | grep evdev_binary- \
   | awk '{print $1}' \
   | sort -V
evdev_binary-1.7.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
evdev_binary-1.7.1-cp37-cp37m-musllinux_1_1_x86_64.whl
evdev_binary-1.7.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
evdev_binary-1.7.1-cp38-cp38-musllinux_1_1_x86_64.whl
evdev_binary-1.7.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
evdev_binary-1.7.1-cp39-cp39-musllinux_1_1_x86_64.whl
evdev_binary-1.7.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
evdev_binary-1.7.1-cp310-cp310-musllinux_1_1_x86_64.whl
evdev_binary-1.7.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
evdev_binary-1.7.1-cp311-cp311-musllinux_1_1_x86_64.whl
evdev_binary-1.7.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
evdev_binary-1.7.1-cp312-cp312-musllinux_1_1_x86_64.whl
evdev_binary-1.7.1-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
evdev_binary-1.7.1-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
evdev_binary-1.7.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
evdev_binary-1.7.1-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl

My pip would match, for example either variation that appears to be indicated above:

 $ pip3.12 debug -v | grep cp312-cp312-manylinux | grep -e _2_5_ -e _2_28_
  cp312-cp312-manylinux_2_28_x86_64
  cp312-cp312-manylinux_2_5_x86_64

yet it insists on doing a source build, and if forced claims there's nothing available:

 $ pip3 install --user --only-binary :all: evdev
ERROR: Could not find a version that satisfies the requirement evdev (from versions: none)
ERROR: No matching distribution found for evdev

Manual download and install works fine:

 $ curl -so evdev_binary-1.7.1-cp312-cp312-manylinux_2_28_x86_64.whl $(
       elinks -dump -no-numbering https://pypi.org/simple/evdev-binary/ \
       | grep 'https.*cp312-cp312.*many' \
       | awk '{print $NF}'
   )

 $ file -i *.whl
evdev_binary-1.7.1-cp312-cp312-manylinux_2_28_x86_64.whl: application/zip; charset=binary

 $ pip3 install --user *.whl
Processing ./evdev_binary-1.7.1-cp312-cp312-manylinux_2_28_x86_64.whl
Installing collected packages: evdev-binary
Successfully installed evdev-binary-1.7.1
smemsh commented 3 months ago

Note, above workaround installs it as evdev-binary package, not evdev:

 $ pip3 list | grep evdev
evdev-binary    1.7.1

which means dependencies like evdev>=1.3 are not being satisfied by this installation.