99
1010NAME = 'pyexcel-xls'
1111AUTHOR = 'C.W.'
12- VERSION = '0.5.1 '
12+ VERSION = '0.5.2 '
1313EMAIL = 'wangc_2011@hotmail.com'
1414LICENSE = 'New BSD'
1515DESCRIPTION = (
1818 ''
1919)
2020URL = 'https://github.com/pyexcel/pyexcel-xls'
21- DOWNLOAD_URL = '%s/archive/0.5.1 .tar.gz' % URL
21+ DOWNLOAD_URL = '%s/archive/0.5.2 .tar.gz' % URL
2222FILES = ['README.rst' , 'CHANGELOG.rst' ]
2323KEYWORDS = [
2424 'xls' ,
4343]
4444
4545INSTALL_REQUIRES = [
46- 'pyexcel-io>=0.5.0 ' ,
46+ 'pyexcel-io>=0.5.3 ' ,
4747 'xlrd' ,
4848 'xlwt' ,
4949]
5252PACKAGES = find_packages (exclude = ['ez_setup' , 'examples' , 'tests' ])
5353EXTRAS_REQUIRE = {
5454}
55+ # You do not need to read beyond this line
5556PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi' .format (
5657 sys .executable )
57- GS_COMMAND = ('gs pyexcel-xls v0.5.1 ' +
58- "Find 0.5.1 in changelog for more details" )
59- here = os .path .abspath (os .path .dirname (__file__ ))
58+ GS_COMMAND = ('gs pyexcel-xls v0.5.2 ' +
59+ "Find 0.5.2 in changelog for more details" )
60+ NO_GS_MESSAGE = ('Automatic github release is disabled. ' +
61+ 'Please install gease to enable it.' )
62+ UPLOAD_FAILED_MSG = ('Upload failed. please run "%s" yourself.' )
63+ HERE = os .path .abspath (os .path .dirname (__file__ ))
6064
6165
6266class PublishCommand (Command ):
@@ -79,17 +83,36 @@ def finalize_options(self):
7983 def run (self ):
8084 try :
8185 self .status ('Removing previous builds...' )
82- rmtree (os .path .join (here , 'dist' ))
86+ rmtree (os .path .join (HERE , 'dist' ))
8387 except OSError :
8488 pass
8589
8690 self .status ('Building Source and Wheel (universal) distribution...' )
87- if os .system (GS_COMMAND ) == 0 :
88- os .system (PUBLISH_COMMAND )
91+ run_status = True
92+ if has_gease ():
93+ run_status = os .system (GS_COMMAND ) == 0
94+ else :
95+ self .status (NO_GS_MESSAGE )
96+ if run_status :
97+ if os .system (PUBLISH_COMMAND ) != 0 :
98+ self .status (UPLOAD_FAILED_MSG % PUBLISH_COMMAND )
8999
90100 sys .exit ()
91101
92102
103+ def has_gease ():
104+ """
105+ test if github release command is installed
106+
107+ visit http://github.com/moremoban/gease for more info
108+ """
109+ try :
110+ import gease # noqa
111+ return True
112+ except ImportError :
113+ return False
114+
115+
93116def read_files (* files ):
94117 """Read files into setup"""
95118 text = ""
@@ -150,7 +173,6 @@ def filter_out_test_code(file_handle):
150173 include_package_data = True ,
151174 zip_safe = False ,
152175 classifiers = CLASSIFIERS ,
153- setup_requires = ['gease' ],
154176 cmdclass = {
155177 'publish' : PublishCommand ,
156178 }
0 commit comments