7
7
8
8
NAME = 'pyexcel-xlsxw'
9
9
AUTHOR = 'C.W.'
10
- VERSION = '0.4.1 '
10
+ VERSION = '0.4.2 '
11
11
EMAIL = 'wangc_2011@hotmail.com'
12
12
LICENSE = 'New BSD'
13
13
DESCRIPTION = (
14
14
'A wrapper library to write data in xlsx and xlsm format' +
15
15
''
16
16
)
17
17
URL = 'https://github.com/pyexcel/pyexcel-xlsxw'
18
- DOWNLOAD_URL = '%s/archive/0.4.1 .tar.gz' % URL
18
+ DOWNLOAD_URL = '%s/archive/0.4.2 .tar.gz' % URL
19
19
FILES = ['README.rst' , 'CHANGELOG.rst' ]
20
20
KEYWORDS = [
21
21
'xlsx'
47
47
PACKAGES = find_packages (exclude = ['ez_setup' , 'examples' , 'tests' ])
48
48
EXTRAS_REQUIRE = {
49
49
}
50
+ # You do not need to read beyond this line
50
51
PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi' .format (
51
52
sys .executable )
52
- GS_COMMAND = ('gs pyexcel-xlsxw v0.4.1 ' +
53
- "Find 0.4.1 in changelog for more details" )
54
- here = os .path .abspath (os .path .dirname (__file__ ))
53
+ GS_COMMAND = ('gs pyexcel-xlsxw v0.4.2 ' +
54
+ "Find 0.4.2 in changelog for more details" )
55
+ NO_GS_MESSAGE = ('Automatic github release is disabled. ' +
56
+ 'Please install gease to enable it.' )
57
+ UPLOAD_FAILED_MSG = ('Upload failed. please run "%s" yourself.' )
58
+ HERE = os .path .abspath (os .path .dirname (__file__ ))
55
59
56
60
57
61
class PublishCommand (Command ):
@@ -74,17 +78,36 @@ def finalize_options(self):
74
78
def run (self ):
75
79
try :
76
80
self .status ('Removing previous builds...' )
77
- rmtree (os .path .join (here , 'dist' ))
81
+ rmtree (os .path .join (HERE , 'dist' ))
78
82
except OSError :
79
83
pass
80
84
81
85
self .status ('Building Source and Wheel (universal) distribution...' )
82
- if os .system (GS_COMMAND ) == 0 :
83
- os .system (PUBLISH_COMMAND )
86
+ run_status = True
87
+ if has_gease ():
88
+ run_status = os .system (GS_COMMAND ) == 0
89
+ else :
90
+ self .status (NO_GS_MESSAGE )
91
+ if run_status :
92
+ if os .system (PUBLISH_COMMAND ) != 0 :
93
+ self .status (UPLOAD_FAILED_MSG % PUBLISH_COMMAND )
84
94
85
95
sys .exit ()
86
96
87
97
98
+ def has_gease ():
99
+ """
100
+ test if github release command is installed
101
+
102
+ visit http://github.com/moremoban/gease for more info
103
+ """
104
+ try :
105
+ import gease # noqa
106
+ return True
107
+ except ImportError :
108
+ return False
109
+
110
+
88
111
def read_files (* files ):
89
112
"""Read files into setup"""
90
113
text = ""
@@ -145,7 +168,6 @@ def filter_out_test_code(file_handle):
145
168
include_package_data = True ,
146
169
zip_safe = False ,
147
170
classifiers = CLASSIFIERS ,
148
- setup_requires = ['gease' ],
149
171
cmdclass = {
150
172
'publish' : PublishCommand ,
151
173
}
0 commit comments