Skip to content

Commit fe1a168

Browse files
author
Kaali
committed
Add new requiremnts.txt for smooth packaging on OSX
1 parent b2eb568 commit fe1a168

File tree

71 files changed

+183
-294
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+183
-294
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
block_cipher = None
4+
5+
import distutils
6+
if distutils.distutils_path.endswith('__init__.py'):
7+
distutils.distutils_path = os.path.dirname(distutils.distutils_path)
8+
9+
10+
a = Analysis(['application.py'],
11+
pathex=['/Users/kaali/Programs/datapod-backend-layer/Application'],
12+
binaries=[],
13+
datas=[],
14+
hiddenimports=['_striptime'],
15+
hookspath=['pyinstaller_hooks'],
16+
runtime_hooks=[],
17+
excludes=[],
18+
win_no_prefer_redirects=False,
19+
win_private_assemblies=False,
20+
cipher=block_cipher,
21+
noarchive=False)
22+
pyz = PYZ(a.pure, a.zipped_data,
23+
cipher=block_cipher)
24+
exe = EXE(pyz,
25+
a.scripts,
26+
a.binaries,
27+
a.zipfiles,
28+
a.datas,
29+
[],
30+
name='Datapod',
31+
debug=False,
32+
bootloader_ignore_signals=False,
33+
strip=False,
34+
upx=True,
35+
upx_exclude=[],
36+
runtime_tmpdir=None,
37+
console=False )
38+
app = BUNDLE(exe,
39+
name='Datapod.app',
40+
icon=None,
41+
bundle_identifier=None)

Application/Datapod_OSX.spec

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
block_cipher = None
4+
5+
import distutils
6+
if distutils.distutils_path.endswith('__init__.py'):
7+
distutils.distutils_path = os.path.dirname(distutils.distutils_path)
8+
a = Analysis(['application.py'],
9+
pathex=['/Users/kaali/Programs/datapod-backend-layer/Application'],
10+
binaries=[],
11+
datas=[],
12+
hiddenimports=['engineio.async_eventlet', '_striptime', 'engineio.async_gevent'],
13+
hookspath=['pyinstaller_hooks'],
14+
runtime_hooks=[],
15+
excludes=[],
16+
win_no_prefer_redirects=False,
17+
win_private_assemblies=False,
18+
cipher=block_cipher,
19+
noarchive=False)
20+
pyz = PYZ(a.pure, a.zipped_data,
21+
cipher=block_cipher)
22+
exe = EXE(pyz,
23+
a.scripts,
24+
a.binaries,
25+
a.zipfiles,
26+
a.datas,
27+
[],
28+
name='Datapod_OSX',
29+
debug=False,
30+
bootloader_ignore_signals=False,
31+
strip=False,
32+
upx=True,
33+
upx_exclude=[],
34+
runtime_tmpdir=None,
35+
console=False , icon='datapod.ico')
36+
app = BUNDLE(exe,
37+
name='Datapod_OSX.app',
38+
icon='datapod.ico',
39+
bundle_identifier=None)
-1 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
-1 Bytes
Binary file not shown.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
block_cipher = None
4+
import distutils
5+
if distutils.distutils_path.endswith('__init__.py'):
6+
distutils.distutils_path = os.path.dirname(distutils.distutils_path)
7+
8+
a = Analysis(['../application.py'],
9+
pathex=['/Users/kaali/Programs/datapod-backend-layer/Application/Executables'],
10+
binaries=[],
11+
datas=[],
12+
hiddenimports=['_striptime'],
13+
hookspath=['../pyinstaller_hooks'],
14+
runtime_hooks=[],
15+
excludes=[],
16+
win_no_prefer_redirects=False,
17+
win_private_assemblies=False,
18+
cipher=block_cipher,
19+
noarchive=False)
20+
pyz = PYZ(a.pure, a.zipped_data,
21+
cipher=block_cipher)
22+
exe = EXE(pyz,
23+
a.scripts,
24+
a.binaries,
25+
a.zipfiles,
26+
a.datas,
27+
[],
28+
name='Datapodmac',
29+
debug=False,
30+
bootloader_ignore_signals=False,
31+
strip=False,
32+
upx=True,
33+
upx_exclude=[],
34+
runtime_tmpdir=None,
35+
console=False , icon='datapod.ico')
36+
app = BUNDLE(exe,
37+
name='Datapodmac.app',
38+
icon='datapod.ico',
39+
bundle_identifier=None)

Application/Executables/build.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
import os
3+
import platform
4+
import subprocess
5+
from loguru import logger
6+
import shutil
7+
def os_command_output(command:str, final_message:str) -> str:
8+
9+
process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
10+
while True:
11+
line = process.stdout.readline()
12+
if not line:
13+
logger.success(final_message)
14+
break
15+
yield line.decode().split("\r")[0]
16+
17+
18+
19+
def build_app():
20+
21+
if platform.system() == "Linux":
22+
logger.info("Removing build directory")
23+
shutil.rmtree("build")
24+
backup_command = f"pyi-makespec --hidden-import _strptime --additional-hooks-dir pyinstaller_hooks --onefile --console --name Datapod --icon datapod.ico application.py"
25+
26+
for out in os_command_output(backup_command, "Making Spec file completed"):
27+
logger.info(out)
28+
#backup_command = f"tar --create --lzma --no-check-device --verbose --listed-incremental={self.user_index} -f {temp.name} {self.raw_data_path}"
29+
command = "pyinstaller Datapod.spec"
30+
for out in os_command_output(command, "Build Complete"):
31+
logger.info(out)
32+
33+
elif platform.system() == "Darwin":
34+
pass
35+
#backup_command = f"gtar --create --lzma --no-check-device --verbose --listed-incremental={self.user_index} -f {temp.name} {self.raw_data_path}"
36+
else:
37+
raise Exception("The platform is not available for this os distribution")
38+
39+
40+
if __name__ == "__main__":
41+
build_app()
42+
73 Bytes
Binary file not shown.
-1 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)