Skip to content

Commit 6e0efe8

Browse files
committed
🤝 synchronize setup.py too
1 parent be718ba commit 6e0efe8

File tree

3 files changed

+56
-51
lines changed

3 files changed

+56
-51
lines changed
File renamed without changes.

Diff for: .moban.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ configuration:
44
targets:
55
- Pipfile: Pipfile.jj2
66
- README.rst: custom_README.rst.jj2
7-
- setup.py: setup.py
7+
- setup.py: custom_setup.py.jj2
88
- "docs/source/conf.py": "docs/source/conf.py.jj2"
99
- .travis.yml: custom_travis.yml.jj2
1010
- MANIFEST.in: MANIFEST.in.jj2

Diff for: setup.py

+55-50
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#!/usr/bin/env python3
22

33
# Template by pypi-mobans
4-
import os
5-
import sys
64
import codecs
75
import locale
6+
import os
87
import platform
8+
import sys
99
from shutil import rmtree
1010

11-
from setuptools import Command, setup, find_packages
11+
from setuptools import Command, find_packages, setup
12+
1213

1314
# Work around mbcs bug in distutils.
1415
# http://bugs.python.org/issue10945
@@ -18,58 +19,62 @@
1819
try:
1920
lc = locale.getlocale()
2021
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")
2324
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")
2526

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"
3132
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"
3435
)
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"]
3839
KEYWORDS = [
39-
'python',
40+
"python",
4041
'xlsx'
4142
]
4243

4344
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+
5359
'Programming Language :: Python :: Implementation :: PyPy'
5460
]
5561

5662
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",
5965
]
6066
SETUP_COMMANDS = {}
6167

6268

63-
PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests'])
69+
PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests"])
6470
EXTRAS_REQUIRE = {
6571
}
6672
# 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.")
7378
UPLOAD_FAILED_MSG = (
7479
'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND)
7580
HERE = os.path.abspath(os.path.dirname(__file__))
@@ -78,13 +83,13 @@
7883
class PublishCommand(Command):
7984
"""Support setup.py upload."""
8085

81-
description = 'Build and publish the package on github and pypi'
86+
description = "Build and publish the package on github and pypi"
8287
user_options = []
8388

8489
@staticmethod
8590
def status(s):
8691
"""Prints things in bold."""
87-
print('\033[1m{0}\033[0m'.format(s))
92+
print("\033[1m{0}\033[0m".format(s))
8893

8994
def initialize_options(self):
9095
pass
@@ -94,28 +99,28 @@ def finalize_options(self):
9499

95100
def run(self):
96101
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"))
101106
except OSError:
102107
pass
103108

104-
self.status('Building Source and Wheel (universal) distribution...')
109+
self.status("Building Source and Wheel (universal) distribution...")
105110
run_status = True
106111
if has_gease():
107112
run_status = os.system(GS_COMMAND) == 0
108113
else:
109114
self.status(NO_GS_MESSAGE)
110115
if run_status:
111116
if os.system(PUBLISH_COMMAND) != 0:
112-
self.status(UPLOAD_FAILED_MSG % PUBLISH_COMMAND)
117+
self.status(UPLOAD_FAILED_MSG)
113118

114119
sys.exit()
115120

116121

117122
SETUP_COMMANDS.update({
118-
'publish': PublishCommand
123+
"publish": PublishCommand
119124
})
120125

121126

@@ -144,7 +149,7 @@ def read_files(*files):
144149
def read(afile):
145150
"""Read a file into setup"""
146151
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:
148153
content = filter_out_test_code(opened_file)
149154
content = "".join(list(content))
150155
return content
@@ -153,11 +158,11 @@ def read(afile):
153158
def filter_out_test_code(file_handle):
154159
found_test_code = False
155160
for line in file_handle.readlines():
156-
if line.startswith('.. testcode:'):
161+
if line.startswith(".. testcode:"):
157162
found_test_code = True
158163
continue
159164
if found_test_code is True:
160-
if line.startswith(' '):
165+
if line.startswith(" "):
161166
continue
162167
else:
163168
empty_line = line.strip()
@@ -167,14 +172,14 @@ def filter_out_test_code(file_handle):
167172
found_test_code = False
168173
yield line
169174
else:
170-
for keyword in ['|version|', '|today|']:
175+
for keyword in ["|version|", "|today|"]:
171176
if keyword in line:
172177
break
173178
else:
174179
yield line
175180

176181

177-
if __name__ == '__main__':
182+
if __name__ == "__main__":
178183
setup(
179184
test_suite="tests",
180185
name=NAME,
@@ -188,7 +193,7 @@ def filter_out_test_code(file_handle):
188193
license=LICENSE,
189194
keywords=KEYWORDS,
190195
extras_require=EXTRAS_REQUIRE,
191-
tests_require=['nose'],
196+
tests_require=["nose"],
192197
install_requires=INSTALL_REQUIRES,
193198
packages=PACKAGES,
194199
include_package_data=True,

0 commit comments

Comments
 (0)