mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Update the setup.py script for the new split repositories.
This commit is contained in:
parent
1646007e9c
commit
41cb0dc17e
1 changed files with 15 additions and 14 deletions
29
setup.py
29
setup.py
|
@ -7,22 +7,21 @@ import re
|
||||||
import shutil
|
import shutil
|
||||||
import site
|
import site
|
||||||
|
|
||||||
includes = ['sip', 'ctypes', 'UM', 'PyQt5.QtNetwork', 'PyQt5._QOpenGLFunctions_2_0', 'serial', 'Arcus', 'google', 'google.protobuf', 'google.protobuf.descriptor', 'xml.etree', 'xml.etree.ElementTree']
|
includes = ['sip', 'ctypes', 'UM', 'PyQt5.QtNetwork', 'PyQt5._QOpenGLFunctions_2_0', 'serial', 'Arcus', 'google', 'google.protobuf', 'google.protobuf.descriptor', 'xml.etree', 'xml.etree.ElementTree', 'src']
|
||||||
# Include all the UM modules in the includes. As py2exe fails to properly find all the dependencies due to the plugin architecture.
|
# Include all the UM modules in the includes. As py2exe fails to properly find all the dependencies due to the plugin architecture.
|
||||||
for dirpath, dirnames, filenames in os.walk('../UM'):
|
for dirpath, dirnames, filenames in os.walk(os.path.dirname(UM.__file__)):
|
||||||
if '__' in dirpath:
|
if '__' in dirpath:
|
||||||
continue
|
continue
|
||||||
dirpath = dirpath.split(os.path.sep)
|
module_path = dirpath.replace(os.path.dirname(UM.__file__), 'UM')
|
||||||
dirpath[0] = 'UM'
|
module_path = module_path.split(os.path.sep)
|
||||||
module_name = '.'.join(dirpath)
|
module_name = '.'.join(module_path)
|
||||||
if os.path.isfile('../' + os.path.sep.join(dirpath) + '/__init__.py'):
|
if os.path.isfile(dirpath + '/__init__.py'):
|
||||||
includes += [module_name]
|
includes += [module_name]
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
if '__' in filename or not filename.endswith('.py'):
|
if '__' in filename or not filename.endswith('.py'):
|
||||||
continue
|
continue
|
||||||
includes += [module_name + '.' + os.path.splitext(filename)[0]]
|
includes += [module_name + '.' + os.path.splitext(filename)[0]]
|
||||||
|
|
||||||
|
|
||||||
print('Removing previous distribution package')
|
print('Removing previous distribution package')
|
||||||
shutil.rmtree('dist', True)
|
shutil.rmtree('dist', True)
|
||||||
|
|
||||||
|
@ -32,19 +31,21 @@ setup(name="Cura",
|
||||||
author_email="d.braam@ultimaker.com",
|
author_email="d.braam@ultimaker.com",
|
||||||
url="http://software.ultimaker.com/",
|
url="http://software.ultimaker.com/",
|
||||||
license="GNU AFFERO GENERAL PUBLIC LICENSE (AGPL)",
|
license="GNU AFFERO GENERAL PUBLIC LICENSE (AGPL)",
|
||||||
scripts=["printer.py", "PrinterApplication.py"],
|
scripts=["printer.py"],
|
||||||
#windows=[{"script": "printer.py", "dest_name": "Cura"}],
|
#windows=[{"script": "printer.py", "dest_name": "Cura"}],
|
||||||
console=[{"script": "printer.py"}],
|
console=[{"script": "printer.py"}],
|
||||||
options={"py2exe": {"skip_archive": False, "includes": includes}})
|
options={"py2exe": {"skip_archive": False, "includes": includes}})
|
||||||
|
|
||||||
print('Coping Cura plugins.')
|
print('Coping Cura plugins.')
|
||||||
shutil.copytree('../plugins', 'dist/plugins')
|
shutil.copytree(os.path.dirname(UM.__file__) + '/../plugins', 'dist/plugins')
|
||||||
print('Coping Cura qml.')
|
for path in os.listdir('plugins'):
|
||||||
shutil.copytree('qml', 'dist/qml')
|
shutil.copytree('plugins/' + path, 'dist/plugins/' + path)
|
||||||
print('Coping resources.')
|
print('Coping resources.')
|
||||||
shutil.copytree('../resources', 'dist/resources')
|
shutil.copytree(os.path.dirname(UM.__file__) + '/../resources', 'dist/resources')
|
||||||
print('Coping resources.')
|
shutil.copytree('resources/qml', 'dist/resources/qml')
|
||||||
shutil.copytree('../UM/Qt/qml/UM', 'dist/qml/UM')
|
shutil.copytree('resources/themes', 'dist/resources/themes')
|
||||||
|
print('Coping Uranium QML.')
|
||||||
|
shutil.copytree(os.path.dirname(UM.__file__) + '/Qt/qml/UM', 'dist/qml/UM')
|
||||||
for site_package in site.getsitepackages():
|
for site_package in site.getsitepackages():
|
||||||
qt_origin_path = os.path.join(site_package, 'PyQt5')
|
qt_origin_path = os.path.join(site_package, 'PyQt5')
|
||||||
if os.path.isdir(qt_origin_path):
|
if os.path.isdir(qt_origin_path):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue