77
88NAME = 'pyexcel-webio'
99AUTHOR = 'C.W.'
10- VERSION = '0.1.3 '
10+ VERSION = '0.1.4 '
1111EMAIL = 'wangc_2011@hotmail.com'
1212LICENSE = 'New BSD'
1313DESCRIPTION = (
1414 'A generic request and response interface for pyexcel web extensions.' +
1515 ''
1616)
1717URL = '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
1919FILES = ['README.rst' , 'CHANGELOG.rst' ]
2020KEYWORDS = [
2121 'http'
4949]
5050
5151INSTALL_REQUIRES = [
52- 'pyexcel>=0.5.5 ' ,
52+ 'pyexcel>=0.5.6 ' ,
5353]
5454
5555
5656PACKAGES = find_packages (exclude = ['ez_setup' , 'examples' , 'tests' ])
5757EXTRAS_REQUIRE = {
5858}
59+ # You do not need to read beyond this line
5960PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi' .format (
6061 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__ ))
6468
6569
6670class PublishCommand (Command ):
@@ -83,17 +87,36 @@ def finalize_options(self):
8387 def run (self ):
8488 try :
8589 self .status ('Removing previous builds...' )
86- rmtree (os .path .join (here , 'dist' ))
90+ rmtree (os .path .join (HERE , 'dist' ))
8791 except OSError :
8892 pass
8993
9094 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 )
93103
94104 sys .exit ()
95105
96106
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+
97120def read_files (* files ):
98121 """Read files into setup"""
99122 text = ""
@@ -154,7 +177,6 @@ def filter_out_test_code(file_handle):
154177 include_package_data = True ,
155178 zip_safe = False ,
156179 classifiers = CLASSIFIERS ,
157- setup_requires = ['gease' ],
158180 cmdclass = {
159181 'publish' : PublishCommand ,
160182 }
0 commit comments