forked from ninja-ide/ninja-ide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
138 lines (107 loc) · 4.42 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
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
#!/usr/bin/env python
#-*-coding:utf-8-*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
###############################################################################
# DOCS
###############################################################################
"""Setup for Ninja-ide (http://www.ninja-ide.org)
NINJA-IDE is a cross-platform integrated development environment (IDE).
NINJA-IDE runs on Linux/X11, Mac OS X and Windows desktop operating systems,
and allows developers to create applications for several purposes using all the
tools and utilities of NINJA-IDE, making the task of writing software easier
and more enjoyable.
"""
###############################################################################
# IMPORTS
###############################################################################
import sys
from setuptools import setup, find_packages
import ninja_ide
###############################################################################
# VALIDATE THE NEEDED MODULES
###############################################################################
# This modules can't be easy installed
# Syntax: [(module, url of the tutorial)...]
if sys.platform == 'win32':
NEEDED_MODULES = [("PyQt4",
"http://www.riverbankcomputing.co.uk/software/pyqt/intro"),
('win32con', "http://sourceforge.net/projects/pywin32/files/pywin32/")]
else:
NEEDED_MODULES = [("PyQt4",
"http://www.riverbankcomputing.co.uk/software/pyqt/intro"), ]
for mn, urlm in NEEDED_MODULES:
try:
__import__(mn)
except ImportError:
print("Module '%s' not found. For more details: '%s'.\n" % (mn, urlm))
sys.exit(1)
dependencies = []
if sys.platform == 'darwin':
dependencies.append("macfsevents")
elif sys.platform == 'linux2':
dependencies.append("pyinotify")
###############################################################################
# PRE-SETUP
###############################################################################
# Common
params = {
"name": ninja_ide.__prj__,
"version": ninja_ide.__version__,
"description": ninja_ide.__doc__,
"author": ninja_ide.__author__,
"author_email": ninja_ide.__mail__,
"url": ninja_ide.__url__,
"license": ninja_ide.__license__,
"keywords": "ide python ninja development",
"classifiers": ["Development Status :: Development Status :: 4 - Beta",
"Topic :: Utilities",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2"],
# Ninja need:
"install_requires": dependencies,
# include all resources
"include_package_data": True,
"package_data": {'': ['*.png', '*.gif', '*.jpg', '*.json', '*.qss',
'*.js', '*.html', '*.css', '*.qm']},
# include ninja pkg and setup the run script
"packages": find_packages() + [
'ninja_ide/addins',
'ninja_ide/addins/syntax',
'ninja_ide/addins/theme',
'ninja_ide/addins/lang',
'ninja_ide/doc',
'ninja_ide/doc/css',
'ninja_ide/doc/img',
'ninja_ide/doc/js',
'ninja_ide/doc/js/libs',
'ninja_ide/img'],
#auto create scripts
"entry_points": {
'console_scripts': [
'ninja-ide = ninja_ide:setup_and_run',
],
'gui_scripts': [
'ninja-ide = ninja_ide:setup_and_run',
]
}
}
###############################################################################
# SETUP
###############################################################################
setup(**params)
###############################################################################
# MAIN
###############################################################################
if __name__ == '__main__':
print(__doc__)