Skip to content

Commit

Permalink
got windows binary generation working again.
Browse files Browse the repository at this point in the history
  • Loading branch information
petersilva committed Aug 5, 2023
1 parent 3f47b06 commit 2b82bfd
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 6 deletions.
49 changes: 44 additions & 5 deletions generate-win-installer.sh
Original file line number Diff line number Diff line change
@@ -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 <module>
# 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
Expand All @@ -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
Expand All @@ -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 ..

Expand All @@ -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.tem >win_installer.cfg
# NSIS packaging
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def read(*parts):
'python-magic-bin; sys_platform=="win32"'

],
extras_requires = features
extras_require = features
)


Expand Down

0 comments on commit 2b82bfd

Please sign in to comment.