77
88NAME = 'pyexcel-odsr'
99AUTHOR = 'C.W.'
10- VERSION = '0.5.1 '
10+ VERSION = '0.5.2 '
11111212LICENSE = 'New BSD'
1313DESCRIPTION = (
1616 ''
1717)
1818URL = 'https://github.com/pyexcel/pyexcel-odsr'
19- DOWNLOAD_URL = '%s/archive/0.5.1 .tar.gz' % URL
19+ DOWNLOAD_URL = '%s/archive/0.5.2 .tar.gz' % URL
2020FILES = ['README.rst' , 'CONTRIBUTORS.rst' , 'CHANGELOG.rst' ]
2121KEYWORDS = [
2222 'excel' ,
4040]
4141
4242INSTALL_REQUIRES = [
43- 'pyexcel-io>=0.5.0 ' ,
43+ 'pyexcel-io>=0.5.3 ' ,
4444 'lxml>=3.2' ,
4545]
4646
4747
4848PACKAGES = find_packages (exclude = ['ez_setup' , 'examples' , 'tests' ])
4949EXTRAS_REQUIRE = {
5050}
51+ # You do not need to read beyond this line
5152PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi' .format (
5253 sys .executable )
53- GS_COMMAND = ('gs pyexcel-odsr v0.5.1 ' +
54- "Find 0.5.1 in changelog for more details" )
55- here = os .path .abspath (os .path .dirname (__file__ ))
54+ GS_COMMAND = ('gs pyexcel-odsr v0.5.2 ' +
55+ "Find 0.5.2 in changelog for more details" )
56+ NO_GS_MESSAGE = ('Automatic github release is disabled. ' +
57+ 'Please install gease to enable it.' )
58+ UPLOAD_FAILED_MSG = ('Upload failed. please run "%s" yourself.' )
59+ HERE = os .path .abspath (os .path .dirname (__file__ ))
5660
5761
5862class PublishCommand (Command ):
@@ -75,17 +79,36 @@ def finalize_options(self):
7579 def run (self ):
7680 try :
7781 self .status ('Removing previous builds...' )
78- rmtree (os .path .join (here , 'dist' ))
82+ rmtree (os .path .join (HERE , 'dist' ))
7983 except OSError :
8084 pass
8185
8286 self .status ('Building Source and Wheel (universal) distribution...' )
83- if os .system (GS_COMMAND ) == 0 :
84- os .system (PUBLISH_COMMAND )
87+ run_status = True
88+ if has_gease ():
89+ run_status = os .system (GS_COMMAND ) == 0
90+ else :
91+ self .status (NO_GS_MESSAGE )
92+ if run_status :
93+ if os .system (PUBLISH_COMMAND ) != 0 :
94+ self .status (UPLOAD_FAILED_MSG % PUBLISH_COMMAND )
8595
8696 sys .exit ()
8797
8898
99+ def has_gease ():
100+ """
101+ test if github release command is installed
102+
103+ visit http://github.com/moremoban/gease for more info
104+ """
105+ try :
106+ import gease # noqa
107+ return True
108+ except ImportError :
109+ return False
110+
111+
89112def read_files (* files ):
90113 """Read files into setup"""
91114 text = ""
@@ -146,7 +169,6 @@ def filter_out_test_code(file_handle):
146169 include_package_data = True ,
147170 zip_safe = False ,
148171 classifiers = CLASSIFIERS ,
149- setup_requires = ['gease' ],
150172 cmdclass = {
151173 'publish' : PublishCommand ,
152174 }
0 commit comments