3
3
from __future__ import (absolute_import , division , print_function ,
4
4
unicode_literals )
5
5
from distutils .core import setup
6
- import glob
6
+ from glob import glob
7
7
import os
8
8
import sys
9
9
@@ -23,13 +23,15 @@ def __version_to_list(version):
23
23
ver_list .append (n )
24
24
return ver_list
25
25
26
+
26
27
def __check_min_version (min_ver , ver ):
27
28
"""Check whether ver is greater or equal to min_ver
28
29
"""
29
30
min_ver_list = __version_to_list (min_ver )
30
31
ver_list = __version_to_list (ver )
31
32
return min_ver_list <= ver_list
32
33
34
+
33
35
def __check_python_version ():
34
36
"""Check the minimum Python version
35
37
"""
@@ -39,6 +41,7 @@ def __check_python_version():
39
41
% (version .python_min_ver , pyver ), file = sys .stderr )
40
42
sys .exit (1 )
41
43
44
+
42
45
def __check_git_version ():
43
46
"""Check the minimum GIT version
44
47
"""
@@ -49,46 +52,6 @@ def __check_git_version():
49
52
% (version .git_min_ver , gitver ), file = sys .stderr )
50
53
sys .exit (1 )
51
54
52
- def __run_setup ():
53
- setup (name = 'stgit' ,
54
- version = version .version ,
55
- license = 'GPLv2' ,
56
- author = 'Catalin Marinas' ,
57
- author_email = '[email protected] ' ,
58
- url = 'http://www.procode.org/stgit/' ,
59
- download_url = 'http://repo.or.cz/stgit.git' ,
60
- description = 'Stacked GIT' ,
61
- long_description = 'Push/pop utility on top of GIT' ,
62
- scripts = ['stg' ],
63
- packages = list (map (str , ['stgit' , 'stgit.commands' , 'stgit.lib' ])),
64
- data_files = [
65
- ('share/stgit/templates' , glob .glob ('templates/*.tmpl' )),
66
- ('share/stgit/examples' , glob .glob ('examples/*.tmpl' )),
67
- ('share/stgit/examples' , ['examples/gitconfig' ]),
68
- ('share/stgit/contrib' , ['contrib/stgbashprompt.sh' ]),
69
- ('share/stgit/completion' , ['stgit-completion.bash' ])
70
- ],
71
- classifiers = [
72
- 'Development Status :: 5 - Production/Stable' ,
73
- 'Environment :: Console' ,
74
- 'Intended Audience :: Developers' ,
75
- 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)'
76
- 'Natural Language :: English' ,
77
- 'Operating System :: OS Independent' ,
78
- 'Programming Language :: Python' ,
79
- 'Programming Language :: Python :: 2' ,
80
- 'Programming Language :: Python :: 2.6' ,
81
- 'Programming Language :: Python :: 2.7' ,
82
- 'Programming Language :: Python :: 3' ,
83
- 'Programming Language :: Python :: 3.3' ,
84
- 'Programming Language :: Python :: 3.4' ,
85
- 'Programming Language :: Python :: 3.5' ,
86
- 'Programming Language :: Python :: 3.6' ,
87
- 'Programming Language :: Python :: Implementation :: CPython' ,
88
- 'Programming Language :: Python :: Implementation :: PyPy' ,
89
- 'Topic :: Software Development :: Version Control' ,
90
- ])
91
-
92
55
93
56
# Check the minimum versions required
94
57
__check_python_version ()
@@ -101,13 +64,52 @@ def __run_setup():
101
64
102
65
# generate the python command list
103
66
with open ('stgit/commands/cmdlist.py' , 'w' ) as f :
104
- commands .py_commands (commands .get_commands (allow_cached = False ), f )
67
+ commands .py_commands (commands .get_commands (allow_cached = False ), f )
105
68
106
69
# generate the bash completion script
107
70
with open ('stgit-completion.bash' , 'w' ) as f :
108
71
completion .write_completion (f )
109
72
110
- __run_setup ()
73
+ setup (
74
+ name = 'stgit' ,
75
+ version = version .version ,
76
+ license = 'GPLv2' ,
77
+ author = 'Catalin Marinas' ,
78
+
79
+ url = 'http://www.procode.org/stgit/' ,
80
+ download_url = 'http://repo.or.cz/stgit.git' ,
81
+ description = 'Stacked GIT' ,
82
+ long_description = 'Push/pop utility on top of GIT' ,
83
+ scripts = ['stg' ],
84
+ packages = list (map (str , ['stgit' , 'stgit.commands' , 'stgit.lib' ])),
85
+ data_files = [
86
+ ('share/stgit/templates' , glob ('templates/*.tmpl' )),
87
+ ('share/stgit/examples' , glob ('examples/*.tmpl' )),
88
+ ('share/stgit/examples' , ['examples/gitconfig' ]),
89
+ ('share/stgit/contrib' , ['contrib/stgbashprompt.sh' ]),
90
+ ('share/stgit/completion' , ['stgit-completion.bash' ]),
91
+ ],
92
+ classifiers = [
93
+ 'Development Status :: 5 - Production/Stable' ,
94
+ 'Environment :: Console' ,
95
+ 'Intended Audience :: Developers' ,
96
+ 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)'
97
+ 'Natural Language :: English' ,
98
+ 'Operating System :: OS Independent' ,
99
+ 'Programming Language :: Python' ,
100
+ 'Programming Language :: Python :: 2' ,
101
+ 'Programming Language :: Python :: 2.6' ,
102
+ 'Programming Language :: Python :: 2.7' ,
103
+ 'Programming Language :: Python :: 3' ,
104
+ 'Programming Language :: Python :: 3.3' ,
105
+ 'Programming Language :: Python :: 3.4' ,
106
+ 'Programming Language :: Python :: 3.5' ,
107
+ 'Programming Language :: Python :: 3.6' ,
108
+ 'Programming Language :: Python :: Implementation :: CPython' ,
109
+ 'Programming Language :: Python :: Implementation :: PyPy' ,
110
+ 'Topic :: Software Development :: Version Control' ,
111
+ ],
112
+ )
111
113
112
114
# restore the old mask
113
115
os .umask (old_mask )
0 commit comments