7
7
8
8
NAME = 'pyexcel-xlsx'
9
9
AUTHOR = 'C.W.'
10
- VERSION = '0.5.1 '
10
+ VERSION = '0.5.2 '
11
11
12
12
LICENSE = 'New BSD'
13
13
DESCRIPTION = (
16
16
''
17
17
)
18
18
URL = 'https://github.com/pyexcel/pyexcel-xlsx'
19
- DOWNLOAD_URL = '%s/archive/0.5.1 .tar.gz' % URL
19
+ DOWNLOAD_URL = '%s/archive/0.5.2 .tar.gz' % URL
20
20
FILES = ['README.rst' , 'CHANGELOG.rst' ]
21
21
KEYWORDS = [
22
22
'xlsx'
40
40
41
41
INSTALL_REQUIRES = [
42
42
'openpyxl>=2.4.4' ,
43
- 'pyexcel-io>=0.5.0 ' ,
43
+ 'pyexcel-io>=0.5.3 ' ,
44
44
]
45
45
46
46
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-xlsx v0.5.1 ' +
53
- "Find 0.5.1 in changelog for more details" )
54
- here = os .path .abspath (os .path .dirname (__file__ ))
53
+ GS_COMMAND = ('gs pyexcel-xlsx v0.5.2 ' +
54
+ "Find 0.5.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