-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathsetup.py
97 lines (78 loc) · 2.58 KB
/
setup.py
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
import os
import sys
import platform
from setuptools import setup, find_packages
import util
if os.name != "nt":
print("""
\nThe binaries distributed with this version are Windows only,
- If you are on linux, look at
github.com/pyqt/python-qt5/wiki/Compiling-PyQt5-on-Ubuntu-12.04.
- If you are on OS X, look at the OSX specific port:
github.com/pyqt/python-qt5-mavericks
""")
sys.exit()
if "64bit" not in platform.architecture():
print("""
\nThe binaries distributed wtih this version are for the
64-bit version of Python only.
""")
sys.exit()
def get_version():
repo_dir = os.path.dirname(__file__)
sys.path.insert(0, repo_dir)
import PyQt5
return PyQt5.__version__
def get_package_data():
"""Include all files from all sub-directories"""
package_data = dict()
package_data['PyQt5'] = list()
for subdir in ("doc/", "examples/", "include/",
"mkspecs/", "plugins/", "qml/",
"qsci/", "sip/", "translations/", "uic/"):
abspath = os.path.abspath("PyQt5/" + subdir)
for root, dirs, files in os.walk(abspath):
for f in files:
fpath = os.path.join(root, f)
relpath = os.path.relpath(fpath, abspath)
relpath = relpath.replace("\\", "/")
package_data['PyQt5'].append(subdir + relpath)
package_data['PyQt5'].extend(["*.exe",
"*.dll",
"*.pyd",
"*.conf",
"*.api",
"*.qm",
"*.bat"])
return package_data
def get_data_files():
return [('', ['qt.conf'])]
def get_readme():
with open('README.txt') as f:
readme = f.read()
return readme
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities'
]
setup(
name='python-qt5',
version=get_version(),
description='PyQt5',
long_description=get_readme(),
author='Marcus Ottosson',
author_email='marcus@abstractfactory.com',
url='https://github.com/pyqt/python-qt5',
license='GPLv3',
packages=find_packages(),
zip_safe=False,
classifiers=classifiers,
package_data=get_package_data(),
data_files=get_data_files()
)