vpelletier / python-libusb1

Python ctype-based wrapper around libusb1
GNU Lesser General Public License v2.1
174 stars 67 forks source link

Added pyinstaller hooks. Fixes #68 #69

Closed jrast closed 3 years ago

FFY00 commented 3 years ago

I tried importlib.resource but sadly its backport does not seem to work on <3.3 . When I drop 2.7 support, I think I will switch to that, and then this may lead to further simplification in these hooks - if this is really what they are doing.

importlib.resources should work on Python 2. I have looked into the issue you were running into (from the disutils mailing list) and what is hapenning is that something, I don't know exactly what, is pulling zipp 3.4.1, which does not support Python 2.7. The find_namespace: directive is unsupported on Python < 3.3 error is a bit cryptic here, but the issue is that the zipp version is not compatible, the last version to support Python 2 is 1.2.0.

vpelletier commented 3 years ago

@FFY00 : Thanks a lot for finding this merge request.

In your email on the list you mentioned find_packages, and I indeed added a call to it ( 452c3e920eb213cd96067a4f5386a461f64a5969 ) without thinking too much about it. Trying without it, now I get importlib_resources complaining about python version because I used <=4.0.0 when I should have written <4.0.0. With these two changes, and the install succeeded. Maybe 4.0.0 removed an upper limit on zipp version ?

Collecting importlib_resources<4.0.0
  Using cached importlib_resources-3.3.1-py2.py3-none-any.whl (26 kB)
Collecting contextlib2; python_version < "3"
  Using cached contextlib2-0.6.0.post1-py2.py3-none-any.whl (9.8 kB)
Collecting pathlib2; python_version < "3"
  Using cached pathlib2-2.3.5-py2.py3-none-any.whl (18 kB)
Collecting typing; python_version < "3.5"
  Using cached typing-3.7.4.3-py2-none-any.whl (26 kB)
Collecting singledispatch; python_version < "3.4"
  Using cached singledispatch-3.6.1-py2.py3-none-any.whl (9.5 kB)
Collecting zipp>=0.4; python_version < "3.8"
  Using cached zipp-1.2.0-py2.py3-none-any.whl (4.8 kB)
Collecting six
  Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)

I'll merge this request and reply to the list (...tomorrow, as it's already quite late here).

FFY00 commented 3 years ago

Ah yes :facepalm:. I forgot importlib_resources depends on zipp.

vpelletier commented 3 years ago

(...tomorrow, as it's already quite late here)

QED: find_packages != find_namespace, 452c3e920eb213cd96067a4f5386a461f64a5969 had nothing to do with the breakage.

So after all, this seems to be a bug in how setup.py install is choosing the zipp version it should use.