-
Notifications
You must be signed in to change notification settings - Fork 77
/
setup.py
77 lines (65 loc) · 2.72 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
import versioneer
from setuptools import setup, find_packages
import platform
# To use a consistent encoding
from codecs import open
from os import path, environ
cur_dir = path.abspath(path.dirname(__file__))
with open(path.join(cur_dir, "requirements.txt"), "r") as f:
requirements = f.read().split()
dev_requirements = []
with open(path.join(cur_dir, "dev-requirements.txt"), "r") as f:
dev_requirements = f.read().split()
with open(path.join(cur_dir, "README.md"), "r", encoding="utf-8") as f:
long_description = f.read()
# Remove the 'optional' requirements
optional = ("PyQt5", "PySide", "psutil", "pcaspy", "pyepics")
for package in optional:
if package in requirements:
requirements.remove(package)
extras_require = {"PySide": ["PySide"], "pyepics": ["pyepics"], "perf": ["psutil"], "dev": dev_requirements}
if "CONDA_PREFIX" not in environ:
extras_require["PyQt5"] = ["PyQt5"]
else:
print("******************************************************************")
print("* WARNING *")
print("******************************************************************")
print("Installing at an Anaconda Environment, to avoid naming conflicts ")
print("make sure you do:")
print("conda install pyqt=5")
print("******************************************************************")
print("For more info please check: ")
print("https://github.com/ContinuumIO/anaconda-issues/issues/1554")
print("******************************************************************")
extras_require["all"] = sorted(set(sum(extras_require.values(), [])))
# Preference for PyQt5 if you select ALL...
extras_require["all"].remove("PySide")
entry_style = "gui_scripts"
if platform.system() == "Windows":
entry_style = "console_scripts"
setup(
name="pydm",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
# Author details
author="SLAC National Accelerator Laboratory",
packages=find_packages(),
package_dir={"pydm": "pydm", "pydm_launcher": "pydm_launcher"},
description="Python Display Manager",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/slaclab/pydm",
entry_points={entry_style: ["pydm=pydm_launcher.main:main"]},
license="BSD",
install_requires=requirements,
extras_require=extras_require,
include_package_data=True,
classifiers=[
"License :: OSI Approved :: BSD License",
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
],
)