8000 BUG: sysconfig attributes/distutils issue · tylerjereddy/numpy@c830c2f · GitHub
[go: up one dir, main page]

Skip to content

Commit c830c2f

Browse files
committed
BUG: sysconfig attributes/distutils issue
* numpygh-17223 started the `distutils` modernization process because of the various upstream stuff going on (thanks) * that set of changes caused build issues with NumPy pre-release wheels + SciPy `master`: https://travis-ci.org/github/scipy/scipy/builds/725002838 * I was able to patch two separate issues and confirm that this feature branch restores the SciPy build locally: 1) in one case, `distutils.sysconfig.get_python_inc` was replaced with `distutils.get_python_inc`, which does not exist (probably a typo) 2) a bit more serious; even `sysconfig.get_python_inc` does not appear to exist; the closest match I could find (and that worked) was `sysconfig.get_path()` with options for general and platform-specific header paths as needed * I'm not claiming that these stdlib replacements are perfect either (the prefix case may still be slightly different?), but it does prevent the SciPy build break originally introduced as a start
1 parent c6dc7f6 commit c830c2f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

numpy/distutils/system_info.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,13 +2499,12 @@ def __init__(self):
24992499
except AttributeError:
25002500
pass
25012501

2502-
include_dirs.append(distutils.get_python_inc(
2503-
prefix=os.sep.join(prefix)))
2502+
include_dirs.append(sysconfig.get_path('include'))
25042503
except ImportError:
25052504
pass
2506-
py_incl_dir = sysconfig.get_python_inc()
2505+
py_incl_dir = sysconfig.get_path('include')
25072506
include_dirs.append(py_incl_dir)
2508-
py_pincl_dir = sysconfig.get_python_inc(plat_specific=True)
2507+
py_pincl_dir = sysconfig.get_path('platinclude')
25092508
if py_pincl_dir not in include_dirs:
25102509
include_dirs.append(py_pincl_dir)
25112510
for d in default_include_dirs:
@@ -2632,8 +2631,8 @@ def calc_info(self):
26322631
break
26332632
if not src_dir:
26342633
return
2635-
py_incl_dirs = [sysconfig.get_python_inc()]
2636-
py_pincl_dir = sysconfig.get_python_inc(plat_specific=True)
2634+
py_incl_dirs = [sysconfig.get_path('include')]
2635+
py_pincl_dir = sysconfig.get_path('platinclude')
26372636
if py_pincl_dir not in py_incl_dirs:
26382637
py_incl_dirs.append(py_pincl_dir)
26392638
srcs_dir = os.path.join(src_dir, 'libs', 'python', 'src')

0 commit comments

Comments
 (0)
0