diff --git a/doc/source/whatsnew/v0.19.1.txt b/doc/source/whatsnew/v0.19.1.txt index 147ff8795eb00..835b10525b044 100644 --- a/doc/source/whatsnew/v0.19.1.txt +++ b/doc/source/whatsnew/v0.19.1.txt @@ -44,6 +44,7 @@ Bug Fixes +- Source installs from PyPI will now work without ``cython`` installed, as in previous version (:issue:`14204`) - ``pd.merge()`` will raise ``ValueError`` with non-boolean parameters in passed boolean type arguments (:issue:`14434`) diff --git a/setup.py b/setup.py index 846e2b7fa2d88..fdf24585576bc 100755 --- a/setup.py +++ b/setup.py @@ -125,25 +125,25 @@ def is_platform_mac(): class build_ext(_build_ext): def build_extensions(self): - if not cython: - raise ImportError('Building pandas requires cython') - - for pxifile in _pxifiles: - # build pxifiles first, template extention must be .pxi.in - assert pxifile.endswith('.pxi.in') - outfile = pxifile[:-3] - - if (os.path.exists(outfile) and - os.stat(pxifile).st_mtime < os.stat(outfile).st_mtime): - # if .pxi.in is not updated, no need to output .pxi - continue + # if builing from c files, don't need to + # generate template output + if cython: + for pxifile in _pxifiles: + # build pxifiles first, template extention must be .pxi.in + assert pxifile.endswith('.pxi.in') + outfile = pxifile[:-3] + + if (os.path.exists(outfile) and + os.stat(pxifile).st_mtime < os.stat(outfile).st_mtime): + # if .pxi.in is not updated, no need to output .pxi + continue - with open(pxifile, "r") as f: - tmpl = f.read() - pyxcontent = tempita.sub(tmpl) + with open(pxifile, "r") as f: + tmpl = f.read() + pyxcontent = tempita.sub(tmpl) - with open(outfile, "w") as f: - f.write(pyxcontent) + with open(outfile, "w") as f: + f.write(pyxcontent) numpy_incl = pkg_resources.resource_filename('numpy', 'core/include')