Skip to content

Commit

Permalink
Merge pull request #72 from CadQuery/adam-urbanczyk-spec-cleanup
Browse files Browse the repository at this point in the history
Cleanup of the pyinstaller spec file
  • Loading branch information
adam-urbanczyk authored Jul 23, 2019
2 parents 402434d + a60cfc6 commit df0c201
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
5 changes: 3 additions & 2 deletions cq_editor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ def check_gtihub_for_updates(parent,

if newer:
title='Updates available'
text=f'There are newer versions of {github_proj} available on github:'\
'\n'.join(newer)
text=f'There are newer versions of {github_proj} ' \
f'available on github:\n' + '\n'.join(newer)

else:
title='No updates available'
text=f'You are already using the latest version of {github_proj}'
Expand Down
11 changes: 2 additions & 9 deletions cq_editor/widgets/cq_object_inspector.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
from PyQt5.QtWidgets import QTreeWidget, QTreeWidgetItem, QAction
from PyQt5.QtCore import Qt, pyqtSlot, pyqtSignal

from OCC.AIS import AIS_ColoredShape, AIS_Line, AIS_Plane
from OCC.Quantity import Quantity_NOC_RED as RED
from OCC.Quantity import Quantity_NOC_GREEN as GREEN
from OCC.Quantity import Quantity_NOC_BLUE1 as BLUE
from OCC.Geom import Geom_CylindricalSurface, Geom_Plane, Geom_Circle,\
Geom_TrimmedCurve, Geom_Axis1Placement, Geom_Axis2Placement, Geom_Line
from OCC.gp import gp_Trsf, gp_Vec, gp_Ax3, gp_Dir, gp_Pnt, gp_Ax1, gp_Pln

from OCC.BRepBuilderAPI import BRepBuilderAPI_MakeFace
from OCC.Core.AIS import AIS_ColoredShape
from OCC.Core.gp import gp_Ax3

from cadquery import Vector

Expand Down
14 changes: 7 additions & 7 deletions pyinstaller.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,24 @@ from path import Path

block_cipher = None

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

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

with open('dummy','wb'):
pass

a = Analysis(['run.py'],
pathex=['/home/adam/cq/CQ-editor'],
binaries=[],
datas=[('dummy', 'spyder/utils'),
(spyder_fonts ,'spyder/fonts'),
datas=[(spyder_data ,'spyder'),
(parso_grammar, 'parso/python'),
(oce_dir , 'oce')],
hiddenimports=['ipykernel.datapub'],
hookspath=[],
runtime_hooks=['pyinstaller/pyi_rth_occ.py'],
runtime_hooks=['pyinstaller/pyi_rth_occ.py',
'pyinstaller/pyi_rth_fontconfig.py'],
excludes=['_tkinter',],
win_no_prefer_redirects=False,
win_private_assemblies=False,
Expand All @@ -45,6 +42,9 @@ exe = EXE(pyz,
upx=True,
console=True,
icon='icons/cadquery_logo_dark.ico')

exclude = ('libGL','libEGL','libbsd')
a.binaries = TOC([x for x in a.binaries if not x[0].startswith(exclude)])

coll = COLLECT(exe,
a.binaries,
Expand Down
6 changes: 6 additions & 0 deletions pyinstaller/pyi_rth_fontconfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import os
import sys

if sys.platform.startswith('linux'):
os.environ['FONTCONFIG_FILE'] = '/etc/fonts/fonts.conf'
os.environ['FONTCONFIG_PATH'] = '/etc/fonts/'

0 comments on commit df0c201

Please sign in to comment.