Skip to content

Commit df0c201

Browse files
Merge pull request #72 from CadQuery/adam-urbanczyk-spec-cleanup
Cleanup of the pyinstaller spec file
2 parents 402434d + a60cfc6 commit df0c201

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

cq_editor/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ def check_gtihub_for_updates(parent,
118118

119119
if newer:
120120
title='Updates available'
121-
text=f'There are newer versions of {github_proj} available on github:'\
122-
'\n'.join(newer)
121+
text=f'There are newer versions of {github_proj} ' \
122+
f'available on github:\n' + '\n'.join(newer)
123+
123124
else:
124125
title='No updates available'
125126
text=f'You are already using the latest version of {github_proj}'

cq_editor/widgets/cq_object_inspector.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
from PyQt5.QtWidgets import QTreeWidget, QTreeWidgetItem, QAction
22
from PyQt5.QtCore import Qt, pyqtSlot, pyqtSignal
33

4-
from OCC.AIS import AIS_ColoredShape, AIS_Line, AIS_Plane
5-
from OCC.Quantity import Quantity_NOC_RED as RED
6-
from OCC.Quantity import Quantity_NOC_GREEN as GREEN
7-
from OCC.Quantity import Quantity_NOC_BLUE1 as BLUE
8-
from OCC.Geom import Geom_CylindricalSurface, Geom_Plane, Geom_Circle,\
9-
Geom_TrimmedCurve, Geom_Axis1Placement, Geom_Axis2Placement, Geom_Line
10-
from OCC.gp import gp_Trsf, gp_Vec, gp_Ax3, gp_Dir, gp_Pnt, gp_Ax1, gp_Pln
11-
12-
from OCC.BRepBuilderAPI import BRepBuilderAPI_MakeFace
4+
from OCC.Core.AIS import AIS_ColoredShape
5+
from OCC.Core.gp import gp_Ax3
136

147
from cadquery import Vector
158

pyinstaller.spec

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,24 @@ from path import Path
55

66
block_cipher = None
77

8-
spyder_fonts = Path(site.getsitepackages()[-1]) / 'spyder/fonts'
8+
spyder_data = Path(site.getsitepackages()[-1]) / 'spyder'
99
parso_grammar = Path(site.getsitepackages()[-1]) / 'parso/python/grammar36.txt'
1010

1111
if sys.platform == 'linux':
1212
oce_dir = Path(sys.prefix) / 'share' / 'oce-0.18'
1313
else:
1414
oce_dir = Path(sys.prefix) / 'Library' / 'share' / 'oce'
1515

16-
with open('dummy','wb'):
17-
pass
18-
1916
a = Analysis(['run.py'],
2017
pathex=['/home/adam/cq/CQ-editor'],
2118
binaries=[],
22-
datas=[('dummy', 'spyder/utils'),
23-
(spyder_fonts ,'spyder/fonts'),
19+
datas=[(spyder_data ,'spyder'),
2420
(parso_grammar, 'parso/python'),
2521
(oce_dir , 'oce')],
2622
hiddenimports=['ipykernel.datapub'],
2723
hookspath=[],
28-
runtime_hooks=['pyinstaller/pyi_rth_occ.py'],
24+
runtime_hooks=['pyinstaller/pyi_rth_occ.py',
25+
'pyinstaller/pyi_rth_fontconfig.py'],
2926
excludes=['_tkinter',],
3027
win_no_prefer_redirects=False,
3128
win_private_assemblies=False,
@@ -45,6 +42,9 @@ exe = EXE(pyz,
4542
upx=True,
4643
console=True,
4744
icon='icons/cadquery_logo_dark.ico')
45+
46+
exclude = ('libGL','libEGL','libbsd')
47+
a.binaries = TOC([x for x in a.binaries if not x[0].startswith(exclude)])
4848

4949
coll = COLLECT(exe,
5050
a.binaries,

pyinstaller/pyi_rth_fontconfig.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import os
2+
import sys
3+
4+
if sys.platform.startswith('linux'):
5+
os.environ['FONTCONFIG_FILE'] = '/etc/fonts/fonts.conf'
6+
os.environ['FONTCONFIG_PATH'] = '/etc/fonts/'

0 commit comments

Comments
 (0)