Skip to content

Commit bd9a3e0

Browse files
committed
STYLE: conform setup.py to use .format string formatting
1 parent a9e4731 commit bd9a3e0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

setup.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ def is_platform_mac():
4848
'install_requires': [
4949
'python-dateutil >= 2' if PY3 else 'python-dateutil',
5050
'pytz >= 2011k',
51-
'numpy >= %s' % min_numpy_ver,
51+
'numpy >= {numpy_ver}'.format(numpy_ver=min_numpy_ver),
5252
],
53-
'setup_requires': ['numpy >= %s' % min_numpy_ver],
53+
'setup_requires': ['numpy >= {numpy_ver}'.format(numpy_ver=min_numpy_ver)],
5454
'zip_safe': False,
5555
}
5656

@@ -342,8 +342,9 @@ def run(self):
342342
else:
343343
for pyxfile in self._pyxfiles:
344344
cfile = pyxfile[:-3] + 'c'
345-
msg = "C-source file '%s' not found." % (cfile) +\
346-
" Run 'setup.py cython' before sdist."
345+
msg = ("C-source file '{source}' not found.\n"
346+
"Run 'setup.py cython' before sdist.".format(
347+
source=cfile))
347348
assert os.path.isfile(cfile), msg
348349
sdist_class.run(self)
349350

@@ -359,10 +360,10 @@ def check_cython_extensions(self, extensions):
359360
for src in ext.sources:
360361
if not os.path.exists(src):
361362
print("{}: -> [{}]".format(ext.name, ext.sources))
362-
raise Exception("""Cython-generated file '%s' not found.
363+
raise Exception("""Cython-generated file '{src}' not found.
363364
Cython is required to compile pandas from a development branch.
364365
Please install Cython or download a release package of pandas.
365-
""" % src)
366+
""".format(src=src))
366367

367368
def build_extensions(self):
368369
self.check_cython_extensions(self.extensions)
@@ -623,7 +624,7 @@ def pxd(name):
623624

624625
include = data.get('include', common_include)
625626

626-
obj = Extension('pandas.%s' % name,
627+
obj = Extension('pandas.{name}'.format(name=name),
627628
sources=sources,
628629
depends=data.get('depends', []),
629630
include_dirs=include,

0 commit comments

Comments
 (0)