This repository has been archived by the owner on Dec 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
freezing.spec
61 lines (52 loc) · 1.71 KB
/
freezing.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# -*- mode: python -*-
import glob
import jedi
import parso
block_cipher = None
def get_file_list(root_path, package_path, extensions):
files = []
for directory_info in os.walk(os.path.join(root_path, package_path)):
directory_path = directory_info[0]
rel_path = os.path.relpath(directory_path, root_path)
for extension in extensions:
for file in glob.glob(os.path.join(directory_path, extension)):
files.append((file, rel_path))
return files
def get_binaries():
binaries = []
site_packages_path = os.path.dirname(os.path.dirname(os.path.abspath(jedi.__file__)))
print(site_packages_path)
binaries.extend(get_file_list(site_packages_path, 'jedi', ['*.py']))
binaries.extend(get_file_list(site_packages_path, 'parso', ['*.py', '*.txt']))
return binaries
a = Analysis(['run.py'],
pathex=['./'],
binaries=[],
datas=get_binaries(),
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
[],
exclude_binaries=True,
name='SourcetrailPythonIndexer',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='SourcetrailPythonIndexer')