Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions build-macos.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import os
import py2app
import shutil

from distutils.core import setup
from setuptools import setup

def tree(src):
return [(root, map(lambda f: os.path.join(root, f), files))
for (root, dirs, files) in os.walk(os.path.normpath(src))]

data_files = []
for (root, dirs, files) in os.walk(os.path.normpath(src)):
files_list = [os.path.join(root, f) for f in files]
if files_list:
data_files.append((root, files_list))
return data_files

if os.path.exists('build'):
shutil.rmtree('build')

if os.path.exists('dist/index.app'):
shutil.rmtree('dist/index.app')

ENTRY_POINT = ['src/index.py']

DATA_FILES = tree('gui')

OPTIONS = {
'argv_emulation': False,
'strip': False,
Expand All @@ -26,11 +27,11 @@ def tree(src):
'plist': {
'NSRequiresAquaSystemAppearance': False
},
'resources': DATA_FILES
}

setup(
app=ENTRY_POINT,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
setuptools
setuptools<71.0.2
pywebview
pyinstaller; sys_platform != 'darwin'
py2app; sys_platform == 'darwin'
py2app; sys_platform == 'darwin'