77
88NAME = 'pyexcel-xlsx'
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-xlsx'
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' , 'CHANGELOG.rst' ]
2121KEYWORDS = [
2222 'xlsx'
4040
4141INSTALL_REQUIRES = [
4242 'openpyxl>=2.4.4' ,
43- 'pyexcel-io>=0.5.0 ' ,
43+ 'pyexcel-io>=0.5.3 ' ,
4444]
4545
4646
4747PACKAGES = find_packages (exclude = ['ez_setup' , 'examples' , 'tests' ])
4848EXTRAS_REQUIRE = {
4949}
50+ # You do not need to read beyond this line
5051PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi' .format (
5152 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__ ))
5559
5660
5761class PublishCommand (Command ):
@@ -74,17 +78,36 @@ def finalize_options(self):
7478 def run (self ):
7579 try :
7680 self .status ('Removing previous builds...' )
77- rmtree (os .path .join (here , 'dist' ))
81+ rmtree (os .path .join (HERE , 'dist' ))
7882 except OSError :
7983 pass
8084
8185 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 )
8494
8595 sys .exit ()
8696
8797
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+
88111def read_files (* files ):
89112 """Read files into setup"""
90113 text = ""
@@ -145,7 +168,6 @@ def filter_out_test_code(file_handle):
145168 include_package_data = True ,
146169 zip_safe = False ,
147170 classifiers = CLASSIFIERS ,
148- setup_requires = ['gease' ],
149171 cmdclass = {
150172 'publish' : PublishCommand ,
151173 }
0 commit comments