3 from __future__
import absolute_import
, division
, unicode_literals
5 # Hacktastic hack to fix python's stupid ascii default encoding, which
6 # breaks inside distutils when installing from utf-8 paths.
9 # pylint: disable=reload-builtin
11 sys
.setdefaultencoding('utf-8')
12 except NameError: # Python3
18 from distutils
.core
import setup
20 # Look for modules in the root
21 srcdir
= os
.path
.dirname(os
.path
.abspath(__file__
))
23 from extras
import cmdclass
25 here
= os
.path
.dirname(__file__
)
26 version
= os
.path
.join(here
, 'cola', '_version.py')
28 exec(open(version
).read(), scope
)
29 version
= scope
['VERSION']
33 """Runs distutils.setup()"""
40 if sys
.platform
== 'win32':
41 scripts
.append('contrib/win32/cola')
43 setup(name
='git-cola',
45 description
='The highly caffeinated git GUI',
46 long_description
='A sleek and powerful git GUI',
48 author
='David Aguilar',
49 author_email
='davvid@gmail.com',
50 url
='https://git-cola.github.io/',
54 data_files
= cola_data_files())
56 def cola_data_files():
58 _app_path('share/git-cola/bin', '*'),
59 _app_path('share/git-cola/icons', '*.png'),
60 _app_path('share/git-cola/icons', '*.svg'),
61 _app_path('share/applications', '*.desktop'),
62 _app_path('share/doc/git-cola', '*.rst'),
63 _app_path('share/doc/git-cola', '*.html'),
65 _package('cola.models'),
66 _package('cola.widgets'),
69 data
.extend([_app_path(localedir
, 'git-cola.mo')
70 for localedir
in glob('share/locale/*/LC_MESSAGES')])
74 def _package(package
, subdir
=None):
75 subdirs
= package
.split('.')
76 app_dir
= os
.path
.join('share', 'git-cola', 'lib', *subdirs
)
78 subdirs
.insert(0, subdir
)
79 src_dir
= os
.path
.join(*subdirs
)
80 return (app_dir
, glob(os
.path
.join(src_dir
, '*.py')))
83 def _app_path(dirname
, entry
):
84 return (dirname
, glob(os
.path
.join(dirname
, entry
)))
87 if __name__
== '__main__':