forked from tomvandeneede/p2pp
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.py
More file actions
149 lines (134 loc) · 4.33 KB
/
setup.py
File metadata and controls
149 lines (134 loc) · 4.33 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
import sys
import os
from version import Version, __author__, __email__
if sys.platform == "darwin":
from setuptools import setup
import sysconfig
import shutil
import os
import platform
# Clean build directories if they exist
if os.path.exists('build'):
shutil.rmtree('build')
if os.path.exists('dist'):
shutil.rmtree('dist')
APP = ['P2PP.py']
DATA_FILES = ['p2pp.ui', 'p2ppconf.ui', "SendError.ui", "p3browser.ui"]
OPTIONS = {
'argv_emulation': False,
"iconfile": "icons/icon.icns",
"includes": [
'PyQt5.QtWidgets',
'PyQt5.QtGui',
'PyQt5.QtCore',
'PyQt5.QtWebEngineWidgets',
'PyQt5.QtWebEngine',
'PyQt5.QtWebEngineCore'
],
"excludes": [
"tkinter",
"matplotlib",
"numpy",
"_tkinter",
"PIL"
],
'packages': ['PyQt5'],
'strip': False,
'optimize': 0,
'arch': 'universal2',
'plist': {
'CFBundleName': 'P2PP',
'CFBundleDisplayName': 'P2PP',
'CFBundleIdentifier': "com.p2pp.app",
'CFBundleVersion': "1.0.0",
'CFBundleShortVersionString': "1.0.0",
'NSHighResolutionCapable': True,
'LSMinimumSystemVersion': '11.0',
'LSArchitecturePriority': ['arm64', 'x86_64']
}
}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app']
)
if sys.platform.startswith('linux'):
from setuptools import setup, find_packages
import configparser
import os
# Create a temporary config file with the correct format
temp_config = configparser.ConfigParser()
temp_config['sdist_dsc'] = {
'package': 'p2pp',
'maintainer': 'Tom Van den Eede <P2PP@pandora.be>',
'build_depends': 'python3-setuptools, python3-all, debhelper (>= 9)',
'depends': 'python3-qt5 (>= 5.15.0), python3-qtwebengine5 (>= 5.15.0)'
}
setup(
name="p2pp",
version=Version,
description="P2PP - Palette 2 Post Processing tool for Prusa Slicer",
author=__author__,
author_email=__email__,
packages=find_packages(),
package_data={
'p2pp': ['*.ui'],
'': ['version.py']
},
install_requires=[
'PyQt5>=5.15.0',
'PyQtWebEngine>=5.15.0',
'requests>=2.31.0',
'packaging>=23.2'
],
data_files=[
('share/applications', ['p2pp.desktop']),
('share/icons/hicolor/128x128/apps', ['icons/icon.ico']),
('share/p2pp', [
'p2pp.ui',
'p2ppconf.ui',
'SendError.ui',
'p3browser.ui'
])
],
entry_points={
'gui_scripts': [
'p2pp=p2pp:main',
],
}
)
if sys.platform == "win32":
import sys
import version
from cx_Freeze import setup, Executable
includefiles = ["p2pp.ui", 'p2ppconf.ui', "icons/icon.ico", "SendError.ui", "p3browser.ui"]
excludes = ["tkinter"]
includes = ['PyQt5.QtWidgets', 'PyQt5.QtGui', 'PyQt5.Qt', 'PyQt5', 'PyQt5.QtCore', 'PyQt5.QtWebEngineWidgets']
build_exe_options = {"packages": ["os"], 'include_files': includefiles, "excludes": excludes, "includes": includes}
# Simplified MSI options with correct directory structure
bdist_msi_options = {
"upgrade_code": "{2E1D0F3B-768A-4E44-9D1C-85A4F8673C80}",
"add_to_path": False,
"initial_target_dir": r"[ProgramFilesFolder]\P2PP",
"directories": [
("ProgramMenuFolder", "TARGETDIR", "ProgramMenuFolder")
]
}
setup(name="p2pp",
version=version.Version,
description="P2PP - Palette 2 Post Processing tool for Prusa Slicer",
options={
"build_exe": build_exe_options,
"bdist_msi": bdist_msi_options
},
executables=[Executable("p2pp.py",
base="Win32GUI",
icon="icons/icon.ico",
target_name="P2PP")]
)