Skip to content

Commit 192b1cd

Browse files
chris-b1jreback
authored andcommitted
BLD: don't require cython on sdist install
closes #14475 closes #14204
1 parent fe2ebc1 commit 192b1cd

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

doc/source/whatsnew/v0.19.1.txt

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ Bug Fixes
4545

4646
- Bug in ``RangeIndex.intersection`` when result is a empty set (:issue:`14364`).
4747

48+
49+
- Source installs from PyPI will now work without ``cython`` installed, as in previous versions (:issue:`14204`)
50+
4851
- ``pd.merge()`` will raise ``ValueError`` with non-boolean parameters in passed boolean type arguments (:issue:`14434`)
4952

5053

setup.py

+17-17
Original file line numberDiff line numberDiff line change
@@ -125,25 +125,25 @@ def is_platform_mac():
125125
class build_ext(_build_ext):
126126
def build_extensions(self):
127127

128-
if not cython:
129-
raise ImportError('Building pandas requires cython')
130-
131-
for pxifile in _pxifiles:
132-
# build pxifiles first, template extention must be .pxi.in
133-
assert pxifile.endswith('.pxi.in')
134-
outfile = pxifile[:-3]
135-
136-
if (os.path.exists(outfile) and
137-
os.stat(pxifile).st_mtime < os.stat(outfile).st_mtime):
138-
# if .pxi.in is not updated, no need to output .pxi
139-
continue
128+
# if builing from c files, don't need to
129+
# generate template output
130+
if cython:
131+
for pxifile in _pxifiles:
132+
# build pxifiles first, template extention must be .pxi.in
133+
assert pxifile.endswith('.pxi.in')
134+
outfile = pxifile[:-3]
135+
136+
if (os.path.exists(outfile) and
137+
os.stat(pxifile).st_mtime < os.stat(outfile).st_mtime):
138+
# if .pxi.in is not updated, no need to output .pxi
139+
continue
140140

141-
with open(pxifile, "r") as f:
142-
tmpl = f.read()
143-
pyxcontent = tempita.sub(tmpl)
141+
with open(pxifile, "r") as f:
142+
tmpl = f.read()
143+
pyxcontent = tempita.sub(tmpl)
144144

145-
with open(outfile, "w") as f:
146-
f.write(pyxcontent)
145+
with open(outfile, "w") as f:
146+
f.write(pyxcontent)
147147

148148
numpy_incl = pkg_resources.resource_filename('numpy', 'core/include')
149149

0 commit comments

Comments
 (0)