Skip to content

Commit

Permalink
STYLE: conform setup.py to use .format string formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jreback committed Dec 3, 2017
1 parent a9e4731 commit bd9a3e0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def is_platform_mac():
'install_requires': [
'python-dateutil >= 2' if PY3 else 'python-dateutil',
'pytz >= 2011k',
'numpy >= %s' % min_numpy_ver,
'numpy >= {numpy_ver}'.format(numpy_ver=min_numpy_ver),
],
'setup_requires': ['numpy >= %s' % min_numpy_ver],
'setup_requires': ['numpy >= {numpy_ver}'.format(numpy_ver=min_numpy_ver)],
'zip_safe': False,
}

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

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

def build_extensions(self):
self.check_cython_extensions(self.extensions)
Expand Down Expand Up @@ -623,7 +624,7 @@ def pxd(name):

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

obj = Extension('pandas.%s' % name,
obj = Extension('pandas.{name}'.format(name=name),
sources=sources,
depends=data.get('depends', []),
include_dirs=include,
Expand Down

0 comments on commit bd9a3e0

Please sign in to comment.