7 from distutils
.core
import setup
9 # Look for modules in the root
10 srcdir
= os
.path
.dirname(os
.path
.abspath(__file__
))
12 from extras
import cmdclass
13 from cola
import version
17 _check_python_version()
24 def _check_python_version():
25 """Check the minimum Python version
27 pyver
= platform
.python_version()
28 if not version
.check('python', pyver
):
29 print >> sys
.stderr
, ('Python version %s or newer required. '
30 'Found %s' % (version
.get('python'), pyver
))
34 def _setup_environment():
35 """Adds win32/ to our path for windows only"""
36 if sys
.platform
!= 'win32':
38 path
= os
.environ
['PATH']
39 win32
= os
.path
.join(srcdir
, 'win32')
40 os
.environ
['PATH'] = win32
+ os
.pathsep
+ path
43 def _check_git_version():
44 """Check the minimum GIT version
46 git_version
= version
.git_version()
47 if not version
.check('git', git_version
):
48 print >> sys
.stderr
, ('GIT version %s or newer required. '
49 'Found %s' % (version
.get('git'), git_version
))
53 def _check_pyqt_version():
54 """Check the minimum PyQt version
58 from PyQt4
import QtCore
59 pyqtver
= QtCore
.PYQT_VERSION_STR
60 if version
.check('pyqt', pyqtver
):
64 print >> sys
.stderr
, ('PyQt4 version %s or newer required. '
65 'Found %s' % (version
.get('pyqt'), pyqtver
))
70 """Runs distutils.setup()"""
77 if sys
.platform
== 'win32':
81 'win32/py2exe-setup.py',
82 'win32/py2exe-setup.cmd',
85 setup(name
= 'git-cola',
86 version
= version
.version(),
87 description
= 'The highly caffeinated git GUI',
89 author
= 'The git-cola community',
90 author_email
= 'git-cola@googlegroups.com',
91 url
= 'http://git-cola.github.com/',
92 long_description
= 'A sleek and powerful git GUI',
95 data_files
= cola_data_files())
98 def cola_data_files():
100 _app_path('share/git-cola/icons', '*.png'),
101 _app_path('share/git-cola/icons', '*.svg'),
102 _app_path('share/applications', '*.desktop'),
103 _app_path('share/doc/git-cola', '*.txt'),
104 _app_path('share/doc/git-cola', '*.html'),
106 _package('cola.classic'),
107 _package('cola.dag'),
108 _package('cola.main'),
109 _package('cola.merge'),
110 _package('cola.models'),
111 _package('cola.prefs'),
112 _package('cola.stash'),
113 _package('cola.widgets'),
116 data
.extend([_app_path(localedir
, 'git-cola.mo')
117 for localedir
in glob('share/locale/*/LC_MESSAGES')])
119 if sys
.platform
== 'darwin':
120 data
.append(_app_path('share/git-cola/bin', 'ssh-askpass-darwin'))
122 data
.append(_app_path('share/git-cola/bin', 'ssh-askpass'))
126 def _package(package
, subdir
=None):
127 subdirs
= package
.split('.')
128 app_dir
= os
.path
.join('share', 'git-cola', 'lib', *subdirs
)
130 subdirs
.insert(0, subdir
)
131 src_dir
= os
.path
.join(*subdirs
)
132 return (app_dir
, glob(os
.path
.join(src_dir
, '*.py')))
135 def _app_path(dirname
, entry
):
136 return (dirname
, glob(os
.path
.join(dirname
, entry
)))
139 if __name__
== '__main__':