1
1
#!/usr/bin/env python3
2
2
3
3
# Template by pypi-mobans
4
- import os
5
- import sys
6
4
import codecs
7
5
import locale
6
+ import os
8
7
import platform
8
+ import sys
9
9
from shutil import rmtree
10
10
11
- from setuptools import Command , setup , find_packages
11
+ from setuptools import Command , find_packages , setup
12
+
12
13
13
14
# Work around mbcs bug in distutils.
14
15
# http://bugs.python.org/issue10945
18
19
try :
19
20
lc = locale .getlocale ()
20
21
pf = platform .system ()
21
- if pf != ' Windows' and lc == (None , None ):
22
- locale .setlocale (locale .LC_ALL , ' C.UTF-8' )
22
+ if pf != " Windows" and lc == (None , None ):
23
+ locale .setlocale (locale .LC_ALL , " C.UTF-8" )
23
24
except (ValueError , UnicodeError , locale .Error ):
24
- locale .setlocale (locale .LC_ALL , ' en_US.UTF-8' )
25
+ locale .setlocale (locale .LC_ALL , " en_US.UTF-8" )
25
26
26
- NAME = ' pyexcel-xlsx'
27
- AUTHOR = ' C.W.'
28
- VERSION = ' 0.5.7'
29
-
30
- LICENSE = ' New BSD'
27
+ NAME = " pyexcel-xlsx"
28
+ AUTHOR = " C.W."
29
+ VERSION = " 0.5.8"
30
+
31
+ LICENSE = " New BSD"
31
32
DESCRIPTION = (
32
- ' A wrapper library to read, manipulate and write data in xlsx and xlsm' +
33
- ' format'
33
+ " A wrapper library to read, manipulate and write data in xlsx and xlsm" +
34
+ " format"
34
35
)
35
- URL = ' https://github.com/pyexcel/pyexcel-xlsx'
36
- DOWNLOAD_URL = ' %s/archive/0.5.7 .tar.gz' % URL
37
- FILES = [' README.rst' , ' CHANGELOG.rst' ]
36
+ URL = " https://github.com/pyexcel/pyexcel-xlsx"
37
+ DOWNLOAD_URL = " %s/archive/0.5.8 .tar.gz" % URL
38
+ FILES = [" README.rst" , " CHANGELOG.rst" ]
38
39
KEYWORDS = [
39
- ' python' ,
40
+ " python" ,
40
41
'xlsx'
41
42
]
42
43
43
44
CLASSIFIERS = [
44
- 'Topic :: Software Development :: Libraries' ,
45
- 'Programming Language :: Python' ,
46
- 'Intended Audience :: Developers' ,
47
- 'Programming Language :: Python :: 2.6' ,
48
- 'Programming Language :: Python :: 2.7' ,
49
- 'Programming Language :: Python :: 3.3' ,
50
- 'Programming Language :: Python :: 3.4' ,
51
- 'Programming Language :: Python :: 3.5' ,
52
- 'Programming Language :: Python :: 3.6' ,
45
+ "Topic :: Software Development :: Libraries" ,
46
+ "Programming Language :: Python" ,
47
+ "Intended Audience :: Developers" ,
48
+ "Programming Language :: Python :: 2.6" ,
49
+ "Programming Language :: Python :: 2.7" ,
50
+ "Programming Language :: Python :: 3.3" ,
51
+ "Programming Language :: Python :: 3.4" ,
52
+ "Programming Language :: Python :: 3.5" ,
53
+ "Programming Language :: Python :: 3.6" ,
54
+
55
+ "Programming Language :: Python :: 3.7" ,
56
+
57
+ "Programming Language :: Python :: 3.8" ,
58
+
53
59
'Programming Language :: Python :: Implementation :: PyPy'
54
60
]
55
61
56
62
INSTALL_REQUIRES = [
57
- ' openpyxl>=2.5.0,<2.6.0' ,
58
- ' pyexcel-io>=0.5.3' ,
63
+ " openpyxl>=2.6.1" ,
64
+ " pyexcel-io>=0.5.3" ,
59
65
]
60
66
SETUP_COMMANDS = {}
61
67
62
68
63
- PACKAGES = find_packages (exclude = [' ez_setup' , ' examples' , ' tests' ])
69
+ PACKAGES = find_packages (exclude = [" ez_setup" , " examples" , " tests" ])
64
70
EXTRAS_REQUIRE = {
65
71
}
66
72
# You do not need to read beyond this line
67
- PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi' .format (
68
- sys .executable )
69
- GS_COMMAND = ('gs pyexcel-xlsx v0.5.7 ' +
70
- "Find 0.5.7 in changelog for more details" )
71
- NO_GS_MESSAGE = ('Automatic github release is disabled. ' +
72
- 'Please install gease to enable it.' )
73
+ PUBLISH_COMMAND = "{0} setup.py sdist bdist_wheel upload -r pypi" .format (sys .executable )
74
+ GS_COMMAND = ("gs pyexcel-xlsx v0.5.8 " +
75
+ "Find 0.5.8 in changelog for more details" )
76
+ NO_GS_MESSAGE = ("Automatic github release is disabled. " +
77
+ "Please install gease to enable it." )
73
78
UPLOAD_FAILED_MSG = (
74
79
'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND )
75
80
HERE = os .path .abspath (os .path .dirname (__file__ ))
78
83
class PublishCommand (Command ):
79
84
"""Support setup.py upload."""
80
85
81
- description = ' Build and publish the package on github and pypi'
86
+ description = " Build and publish the package on github and pypi"
82
87
user_options = []
83
88
84
89
@staticmethod
85
90
def status (s ):
86
91
"""Prints things in bold."""
87
- print (' \033 [1m{0}\033 [0m' .format (s ))
92
+ print (" \033 [1m{0}\033 [0m" .format (s ))
88
93
89
94
def initialize_options (self ):
90
95
pass
@@ -94,28 +99,28 @@ def finalize_options(self):
94
99
95
100
def run (self ):
96
101
try :
97
- self .status (' Removing previous builds...' )
98
- rmtree (os .path .join (HERE , ' dist' ))
99
- rmtree (os .path .join (HERE , ' build' ))
100
- rmtree (os .path .join (HERE , ' pyexcel_xlsx.egg-info' ))
102
+ self .status (" Removing previous builds..." )
103
+ rmtree (os .path .join (HERE , " dist" ))
104
+ rmtree (os .path .join (HERE , " build" ))
105
+ rmtree (os .path .join (HERE , " pyexcel_xlsx.egg-info" ))
101
106
except OSError :
102
107
pass
103
108
104
- self .status (' Building Source and Wheel (universal) distribution...' )
109
+ self .status (" Building Source and Wheel (universal) distribution..." )
105
110
run_status = True
106
111
if has_gease ():
107
112
run_status = os .system (GS_COMMAND ) == 0
108
113
else :
109
114
self .status (NO_GS_MESSAGE )
110
115
if run_status :
111
116
if os .system (PUBLISH_COMMAND ) != 0 :
112
- self .status (UPLOAD_FAILED_MSG % PUBLISH_COMMAND )
117
+ self .status (UPLOAD_FAILED_MSG )
113
118
114
119
sys .exit ()
115
120
116
121
117
122
SETUP_COMMANDS .update ({
118
- ' publish' : PublishCommand
123
+ " publish" : PublishCommand
119
124
})
120
125
121
126
@@ -144,7 +149,7 @@ def read_files(*files):
144
149
def read (afile ):
145
150
"""Read a file into setup"""
146
151
the_relative_file = os .path .join (HERE , afile )
147
- with codecs .open (the_relative_file , 'r' , ' utf-8' ) as opened_file :
152
+ with codecs .open (the_relative_file , "r" , " utf-8" ) as opened_file :
148
153
content = filter_out_test_code (opened_file )
149
154
content = "" .join (list (content ))
150
155
return content
@@ -153,11 +158,11 @@ def read(afile):
153
158
def filter_out_test_code (file_handle ):
154
159
found_test_code = False
155
160
for line in file_handle .readlines ():
156
- if line .startswith (' .. testcode:' ):
161
+ if line .startswith (" .. testcode:" ):
157
162
found_test_code = True
158
163
continue
159
164
if found_test_code is True :
160
- if line .startswith (' ' ):
165
+ if line .startswith (" " ):
161
166
continue
162
167
else :
163
168
empty_line = line .strip ()
@@ -167,14 +172,14 @@ def filter_out_test_code(file_handle):
167
172
found_test_code = False
168
173
yield line
169
174
else :
170
- for keyword in [' |version|' , ' |today|' ]:
175
+ for keyword in [" |version|" , " |today|" ]:
171
176
if keyword in line :
172
177
break
173
178
else :
174
179
yield line
175
180
176
181
177
- if __name__ == ' __main__' :
182
+ if __name__ == " __main__" :
178
183
setup (
179
184
test_suite = "tests" ,
180
185
name = NAME ,
@@ -188,7 +193,7 @@ def filter_out_test_code(file_handle):
188
193
license = LICENSE ,
189
194
keywords = KEYWORDS ,
190
195
extras_require = EXTRAS_REQUIRE ,
191
- tests_require = [' nose' ],
196
+ tests_require = [" nose" ],
192
197
install_requires = INSTALL_REQUIRES ,
193
198
packages = PACKAGES ,
194
199
include_package_data = True ,
0 commit comments