takluyver / pynsist

Build Windows installers for Python applications
https://pynsist.readthedocs.io/
Other
930 stars 123 forks source link

package won't build anymore. #224

Closed petersilva closed 3 years ago

petersilva commented 3 years ago

This used to work on ubuntu 18, but various steps fail in different ways on Ubuntu 20.

git clone https://github.com/MetPX/sarracenia 
cd sarracenia
./generate-win-installer.sh

the script is a few lines long, it downloads a bunch of packages with pip download --only-binary=:all: --platform win_amd64 and then python3 setup.py bdist_wheel then pynsist win_installer.cfg

the config file being built from a remplate. works ok on ubuntu 18.04, but on ubuntu 20.04, it always fails.

details of the failure modes in an issue opened for that package: https://github.com/MetPX/sarracenia/issues/368

any ideas?

takluyver commented 3 years ago

What version of pynsist do you have? This could be related to #210, a change which is in 2.6.

If you have the new version already, these are the relevant functions - if any of them returns 0, it decides the wheel is incompatible:

https://github.com/takluyver/pynsist/blob/699a87bf4354765a5421b219bc20509e5e41cfa3/nsist/wheels.py#L33-L55

petersilva commented 3 years ago
fractal% pip3 list | grep pynsist
pynsist                       2.5                  
fractal% python -V
Python 3.8.5
fractal% 
petersilva commented 3 years ago

I upgraded to 2.6 with pip --upgrade pynsist. Error messages are unchanged.

petersilva commented 3 years ago

hang on. I lied... it is complaining about a different package now... PyNacl is OK, it is Cryptography it is complaining about.

opying packages into build directory...
Collecting wheel file: six-1.15.0-py2.py3-none-any.whl (from: pynsist_pkgs/*.whl)
Collecting wheel file: PyNaCl-1.4.0-cp38-cp38-win_amd64.whl (from: pynsist_pkgs/*.whl)
Collecting wheel file: cryptography-3.4.6-cp36-abi3-win_amd64.whl (from: pynsist_pkgs/*.whl)
Traceback (most recent call last):
  File "/home/peter/.local/bin/pynsist", line 8, in <module>
    sys.exit(main())
  File "/home/peter/.local/lib/python3.8/site-packages/nsist/__init__.py", line 533, in main
    ec = InstallerBuilder(**args).run(makensis=(not options.no_makensis))
  File "/home/peter/.local/lib/python3.8/site-packages/nsist/__init__.py", line 487, in run
    self.prepare_packages()
  File "/home/peter/.local/lib/python3.8/site-packages/nsist/__init__.py", line 359, in prepare_packages
    wg.get_all()
  File "/home/peter/.local/lib/python3.8/site-packages/nsist/wheels.py", line 299, in get_all
    self.get_globs()
  File "/home/peter/.local/lib/python3.8/site-packages/nsist/wheels.py", line 317, in get_globs
    self.validate_wheel(path)
  File "/home/peter/.local/lib/python3.8/site-packages/nsist/wheels.py", line 338, in validate_wheel
    raise ValueError('Wheel {} is not compatible with Python {}, {}'
ValueError: Wheel cryptography-3.4.6-cp36-abi3-win_amd64.whl is not compatible with Python 3.8.5, win_amd64
fractal% 
takluyver commented 3 years ago

OK, that one is #219. I've always assumed that cp36 means compatible with Python 3.6 specifically; it looks like Cryptography is using it to mean 3.6 or above. I need to work out whether I'm wrong and should just change the code, or whether there's a bigger confusion & we need to either fix other tools or clarify standards.

In the meantime, assuming that wheel does actually work on Python 3.8, you can probably work around this by renaming it so it has cp38 in place of cp36.

petersilva commented 3 years ago

ok renamed... then hit same problem with bcrypt... applied same rename strategy. Package built. Tried installing it... it barfed... There is another error mentioned in the original bug:

Collecting vine==5.0.0
  Using cached vine-5.0.0-py2.py3-none-any.whl (9.4 kB)
  Saved ./vine-5.0.0-py2.py3-none-any.whl
Successfully downloaded amqp vine
Collecting appdirs
  Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
  Saved ./appdirs-1.4.4-py2.py3-none-any.whl
Successfully downloaded appdirs
ERROR: Could not find a version that satisfies the requirement netifaces (from versions: none)
ERROR: No matching distribution found for netifaces
Collecting pika
  Using cached pika-1.2.0-py2.py3-none-any.whl (154 kB)
  Saved ./pika-1.2.0-py2.py3-none-any.whl
Successfully downloaded pika
Collecting psutil
  Using cached psutil-5.8.0-cp38-cp38-win_amd64.whl (245 kB)
  Saved ./psutil-5.8.0-cp38-cp38-win_amd64.whl
Successfully downloaded psutil
Collecting paramiko

There are a bunch of binary downloaders that I run to populate pynsist_pkgs before runnint pynsist... They are all:

pip3 download X --only-binary=:all: --platform win_amd64

it fails to obtain a binary for netifaces, as shown above.

When I try to run the package it fails importing netifaces... and also complains about amqp ... which I would have thought it would have found...

petersilva commented 3 years ago

in adidtion to the manual editing above, for now, since there is no appropriate netifaces module, somebody built another one:

pip3 download netifaces-w38 --only-binary=:all: --platform win_amd64
# replaces pip3 download netifaces --only-binary=:all: --platform win_amd64

which will work until the normal source builds a 3.8 binary package.

takluyver commented 3 years ago

The renaming workarounds should no longer be needed with Pynsist 2.7 (just released). For the netifaces issue, there's nothing I can do - it just doesn't have a pre-built package for Python 3.8.

petersilva commented 3 years ago

Thanks!