From 2b82bfd97ee506c700f74714db199710d1140ad6 Mon Sep 17 00:00:00 2001 From: Peter Silva Date: Sat, 5 Aug 2023 00:49:08 -0400 Subject: [PATCH] got windows binary generation working again. --- generate-win-installer.sh | 49 +++++++++++++++++++++++++++++++++++---- setup.py | 2 +- 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/generate-win-installer.sh b/generate-win-installer.sh index 0aac4fb56..2766bc3be 100755 --- a/generate-win-installer.sh +++ b/generate-win-installer.sh @@ -1,4 +1,36 @@ -#!/bin/bash +#/bin/bash + +# so... if you invoke this without arguments it often fails with: +# +# Downloading embeddable Python build... +#Getting https://www.python.org/ftp/python/3.10.12/python-3.10.12-embed-amd64.zip +#Traceback (most recent call last): +# File "/home/peter/.local/bin/pynsist", line 8, in +# sys.exit(main()) +# File "/home/peter/.local/lib/python3.10/site-packages/nsist/__init__.py", line 533, in main +# ec = InstallerBuilder(**args).run(makensis=(not options.no_makensis)) +# File "/home/peter/.local/lib/python3.10/site-packages/nsist/__init__.py", line 475, in run +# self.fetch_python_embeddable() +# File "/home/peter/.local/lib/python3.10/site-packages/nsist/__init__.py", line 205, in fetch_python_embeddable +# download(url, cache_file) +# File "/home/peter/.local/lib/python3.10/site-packages/nsist/util.py", line 22, in download +# r.raise_for_status() +# File "/home/peter/.local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status +# raise HTTPError(http_error_msg, response=self) +#requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://www.python.org/ftp/python/3.10.12/python-3.10.12-embed-amd64.zip +# +# +# you need to visit https://www.python.org/downloads/windows/ +# +# And look for the minor version that they announce has the AMD64 embedded package... +# +# hunting for python 3.10, we see it is 3.10.9 that is blessed, so call the thing with that version: +# +# ./generate_win_installer 3.10.9 +# +# and it should find it. +# + set -e # Windows specific pkgs @@ -9,9 +41,15 @@ cd pynsist_pkgs/ # Ensure to download only windows binaries pip3 download amqp --only-binary=:all: --platform win_amd64 pip3 download appdirs --only-binary=:all: --platform win_amd64 -pip3 download netifaces --only-binary=:all: --platform win_amd64 -#pip3 download netifaces-w38 --only-binary=:all: --platform win_amd64 -pip3 download pika --only-binary=:all: --platform win_amd64 +pip3 download humanfriendly --only-binary=:all: --platform win_amd64 + +# these are often missing... means vip will be disabled. +#pip3 download netifaces --only-binary=:all: --platform win_amd64 +#pip3 download netifaces-w39 --only-binary=:all: --platform win_amd64 + +# not used anymore. +#pip3 download pika --only-binary=:all: --platform win_amd64 + pip3 download psutil --only-binary=:all: --platform win_amd64 pip3 download paramiko --only-binary=:all: --platform win_amd64 pip3 download regex --only-binary=:all: --platform win_amd64 @@ -28,6 +66,7 @@ pip3 download humanize --only-binary=:all: --platform win_amd64 #pip3 download pycparser --only-binary=:all: --platform win_amd64 #pip3 download pathtools --only-binary=:all: --platform win_amd64 pip3 download watchdog --only-binary=:all: --platform win_amd64 +pip3 download python-magic-bin --only-binary=:all: --platform win_amd64 cd .. @@ -41,7 +80,7 @@ if [ "$1" ]; then else PYVERSION="`python3 -V| awk '{ print $2; }'`" fi -VERSION=`grep __version__ sarracenia/__init__.py | cut -c15- | sed -e 's/"//g'` +VERSION=`grep __version__ sarracenia/_version.py | cut -c15- | sed -e 's/"//g'` sed 's/__version__/'$VERSION'/; s/__pyversion__/'$PYVERSION'/;' win_installer.cfg # NSIS packaging diff --git a/setup.py b/setup.py index 816c9c966..73579eafb 100755 --- a/setup.py +++ b/setup.py @@ -100,7 +100,7 @@ def read(*parts): 'python-magic-bin; sys_platform=="win32"' ], - extras_requires = features + extras_require = features )