99
1010NAME = 'pyexcel-ods3'
1111AUTHOR = 'C.W.'
12- VERSION = '0.5.1 '
12+ VERSION = '0.5.2 '
13131414LICENSE = 'New BSD'
1515DESCRIPTION = (
1616 'A wrapper library to read, manipulate and write data in ods format' +
1717 ''
1818)
1919URL = 'https://github.com/pyexcel/pyexcel-ods3'
20- DOWNLOAD_URL = '%s/archive/0.5.1 .tar.gz' % URL
20+ DOWNLOAD_URL = '%s/archive/0.5.2 .tar.gz' % URL
2121FILES = ['README.rst' , 'CHANGELOG.rst' ]
2222KEYWORDS = [
2323 'ods'
3939]
4040
4141INSTALL_REQUIRES = [
42- 'pyexcel-io>=0.5.0 ' ,
42+ 'pyexcel-io>=0.5.3 ' ,
4343 'lxml' ,
4444 'pyexcel-ezodf>=0.3.3' ,
4545]
5050PACKAGES = find_packages (exclude = ['ez_setup' , 'examples' , 'tests' ])
5151EXTRAS_REQUIRE = {
5252}
53+ # You do not need to read beyond this line
5354PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi' .format (
5455 sys .executable )
55- GS_COMMAND = ('gs pyexcel-ods3 v0.5.1 ' +
56- "Find 0.5.1 in changelog for more details" )
57- here = os .path .abspath (os .path .dirname (__file__ ))
56+ GS_COMMAND = ('gs pyexcel-ods3 v0.5.2 ' +
57+ "Find 0.5.2 in changelog for more details" )
58+ NO_GS_MESSAGE = ('Automatic github release is disabled. ' +
59+ 'Please install gease to enable it.' )
60+ UPLOAD_FAILED_MSG = ('Upload failed. please run "%s" yourself.' )
61+ HERE = os .path .abspath (os .path .dirname (__file__ ))
5862
5963
6064class PublishCommand (Command ):
@@ -77,17 +81,36 @@ def finalize_options(self):
7781 def run (self ):
7882 try :
7983 self .status ('Removing previous builds...' )
80- rmtree (os .path .join (here , 'dist' ))
84+ rmtree (os .path .join (HERE , 'dist' ))
8185 except OSError :
8286 pass
8387
8488 self .status ('Building Source and Wheel (universal) distribution...' )
85- if os .system (GS_COMMAND ) == 0 :
86- os .system (PUBLISH_COMMAND )
89+ run_status = True
90+ if has_gease ():
91+ run_status = os .system (GS_COMMAND ) == 0
92+ else :
93+ self .status (NO_GS_MESSAGE )
94+ if run_status :
95+ if os .system (PUBLISH_COMMAND ) != 0 :
96+ self .status (UPLOAD_FAILED_MSG % PUBLISH_COMMAND )
8797
8898 sys .exit ()
8999
90100
101+ def has_gease ():
102+ """
103+ test if github release command is installed
104+
105+ visit http://github.com/moremoban/gease for more info
106+ """
107+ try :
108+ import gease # noqa
109+ return True
110+ except ImportError :
111+ return False
112+
113+
91114def read_files (* files ):
92115 """Read files into setup"""
93116 text = ""
@@ -148,7 +171,6 @@ def filter_out_test_code(file_handle):
148171 include_package_data = True ,
149172 zip_safe = False ,
150173 classifiers = CLASSIFIERS ,
151- setup_requires = ['gease' ],
152174 cmdclass = {
153175 'publish' : PublishCommand ,
154176 }
0 commit comments