Skip to content

Commit

Permalink
Win app: try declaring the icon explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanDunfield committed Jan 16, 2025
1 parent f6bf85d commit e5b4fe6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
14 changes: 12 additions & 2 deletions doc_src/add_doc_to_wheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import tempfile
import glob
import shutil
from zipfile import Zipfile

doc_zipfile = os.path.abspath(sys.argv[1])
wheel_names = glob.glob(sys.argv[2] + '/snappy-*.whl')
Expand All @@ -23,16 +24,25 @@ def normalize(path):
for wheel_path in wheel_names:
python = sys.executable
tmp_dir = tempfile.mkdtemp()
subprocess.check_call([python, '-m', 'wheel', 'unpack', '--dest', tmp_dir, wheel_path])
pkg, version = os.path.basename(wheel_path).split('-')[:2]
wheel_dir = os.path.join(tmp_dir, pkg + '-' + version)
# We don't use `wheel` here because it will refuse to unpack
# wheels with bad hashes, which as of 2025-01-16 happens with the
# GitHub macos-13 runner.
subprocess.check_call(['unzip', '-q', wheel_path, '-d', wheel_dir])
target = os.path.join(wheel_dir, pkg)
target_doc_dir = os.path.join(target, 'doc')
if os.path.exists(target_doc_dir):
print('Deleting existing docs...')
shutil.rmtree(target_doc_dir)
else:
os.mkdir(target_doc_dir)

print('Unpacking docs..')
subprocess.check_call(['unzip', '-q', doc_zipfile, '-d', target])
with zipfile.


subprocess.check_call(['unzip', '-q', doc_zipfile, '-d', target_doc_dir])
subprocess.check_call([python, '-m', 'wheel', 'pack', '--dest', tmp_dir, wheel_dir])
new_whl = glob.glob(os.path.join(tmp_dir, pkg + '-' + version + '*.whl'))[0]
if normalize(new_whl) != normalize(wheel_path):
Expand Down
4 changes: 3 additions & 1 deletion windows_exe/SnapPy_dbg.spec
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ exe = EXE(pyz,
debug=True,
strip=False,
upx=True,
console=True)
console=True,
icon='SnapPy.ico')

coll = COLLECT(exe,
a.binaries,
a.zipfiles,
Expand Down
4 changes: 3 additions & 1 deletion windows_exe/SnapPy_py3.spec
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ exe = EXE(pyz,
debug=False,
strip=False,
upx=True,
console=False )
console=False,
icon='SnapPy.ico')

coll = COLLECT(exe,
a.binaries,
a.zipfiles,
Expand Down

0 comments on commit e5b4fe6

Please sign in to comment.