7
7
8
8
NAME = 'pyexcel-webio'
9
9
AUTHOR = 'C.W.'
10
- VERSION = '0.1.3 '
10
+ VERSION = '0.1.4 '
11
11
12
12
LICENSE = 'New BSD'
13
13
DESCRIPTION = (
14
14
'A generic request and response interface for pyexcel web extensions.' +
15
15
''
16
16
)
17
17
URL = 'https://github.com/pyexcel/pyexcel-webio'
18
- DOWNLOAD_URL = '%s/archive/0.1.3 .tar.gz' % URL
18
+ DOWNLOAD_URL = '%s/archive/0.1.4 .tar.gz' % URL
19
19
FILES = ['README.rst' , 'CHANGELOG.rst' ]
20
20
KEYWORDS = [
21
21
'http'
49
49
]
50
50
51
51
INSTALL_REQUIRES = [
52
- 'pyexcel>=0.5.5 ' ,
52
+ 'pyexcel>=0.5.6 ' ,
53
53
]
54
54
55
55
56
56
PACKAGES = find_packages (exclude = ['ez_setup' , 'examples' , 'tests' ])
57
57
EXTRAS_REQUIRE = {
58
58
}
59
+ # You do not need to read beyond this line
59
60
PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi' .format (
60
61
sys .executable )
61
- GS_COMMAND = ('gs pyexcel-webio v0.1.3 ' +
62
- "Find 0.1.3 in changelog for more details" )
63
- here = os .path .abspath (os .path .dirname (__file__ ))
62
+ GS_COMMAND = ('gs pyexcel-webio v0.1.4 ' +
63
+ "Find 0.1.4 in changelog for more details" )
64
+ NO_GS_MESSAGE = ('Automatic github release is disabled. ' +
65
+ 'Please install gease to enable it.' )
66
+ UPLOAD_FAILED_MSG = ('Upload failed. please run "%s" yourself.' )
67
+ HERE = os .path .abspath (os .path .dirname (__file__ ))
64
68
65
69
66
70
class PublishCommand (Command ):
@@ -83,17 +87,36 @@ def finalize_options(self):
83
87
def run (self ):
84
88
try :
85
89
self .status ('Removing previous builds...' )
86
- rmtree (os .path .join (here , 'dist' ))
90
+ rmtree (os .path .join (HERE , 'dist' ))
87
91
except OSError :
88
92
pass
89
93
90
94
self .status ('Building Source and Wheel (universal) distribution...' )
91
- if os .system (GS_COMMAND ) == 0 :
92
- os .system (PUBLISH_COMMAND )
95
+ run_status = True
96
+ if has_gease ():
97
+ run_status = os .system (GS_COMMAND ) == 0
98
+ else :
99
+ self .status (NO_GS_MESSAGE )
100
+ if run_status :
101
+ if os .system (PUBLISH_COMMAND ) != 0 :
102
+ self .status (UPLOAD_FAILED_MSG % PUBLISH_COMMAND )
93
103
94
104
sys .exit ()
95
105
96
106
107
+ def has_gease ():
108
+ """
109
+ test if github release command is installed
110
+
111
+ visit http://github.com/moremoban/gease for more info
112
+ """
113
+ try :
114
+ import gease # noqa
115
+ return True
116
+ except ImportError :
117
+ return False
118
+
119
+
97
120
def read_files (* files ):
98
121
"""Read files into setup"""
99
122
text = ""
@@ -154,7 +177,6 @@ def filter_out_test_code(file_handle):
154
177
include_package_data = True ,
155
178
zip_safe = False ,
156
179
classifiers = CLASSIFIERS ,
157
- setup_requires = ['gease' ],
158
180
cmdclass = {
159
181
'publish' : PublishCommand ,
160
182
}
0 commit comments