-
Notifications
You must be signed in to change notification settings - Fork 8
/
setup.py
84 lines (71 loc) · 2.1 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
import glob
import json
import os
# Use setuptools compulsorily, as the distutils doesn't work out well for the
# installation procedure. The 'install_requires' and 'data_files' have better
# support in setuptools.
from setuptools import setup
try:
# only necessary for the windows build
import py2exe
kwargs.update({'console': ["odml-gui"]})
except ImportError:
py2exe = None
with open(os.path.join("odmlui", "info.json")) as infofile:
infodict = json.load(infofile)
VERSION = infodict["VERSION"]
AUTHOR = infodict["AUTHOR"]
CONTACT = infodict["CONTACT"]
HOMEPAGE = infodict["HOMEPAGE"]
CLASSIFIERS = infodict["CLASSIFIERS"]
class PackageNotFoundError(Exception):
pass
# Check required non-python dependencies for native install,
# Anaconda and virtualenv environments.
README = "README.md"
dep_str = "Non-Python dependency missing, please check the %s file." % README
try:
import gi
import pygtkcompat
pygtkcompat.enable()
pygtkcompat.enable_gtk(version="3.0")
import gtk
import gobject
except (ImportError, ValueError) as err:
err_str = ("\n Error: %s\n\n %s" % (err, dep_str))
raise PackageNotFoundError(err_str)
with open(README) as f:
description_text = f.read()
packages = [
"odmlui",
"odmlui.dnd",
"odmlui.treemodel"
]
install_req = ["odml>=1.5.1"]
data_files = [("share/pixmaps", glob.glob(os.path.join("images", "*"))),
("share/odmlui", ["LICENSE"])]
setup(
name="odML-UI",
version=VERSION,
description="odML Editor",
author=AUTHOR,
author_email=CONTACT,
url=HOMEPAGE,
packages=packages,
test_suite="test",
options={
"py2exe": {
"packages": "odml",
"includes": "cairo, pango, pangocairo, atk, "
"gobject, gio, lxml, gzip, enum34",
}
},
install_requires=install_req,
include_package_data=True,
data_files=data_files,
long_description=description_text,
long_description_content_type="text/markdown",
classifiers=CLASSIFIERS,
license="BSD",
entry_points={"gui_scripts": ["odmlui = odmlui.__main__:run []"]}
)