File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,6 +160,11 @@ def finalize_options(self):
160160 if isinstance (self .include_dirs , str ):
161161 self .include_dirs = self .include_dirs .split (os .pathsep )
162162
163+ # If in a virtualenv, add its include directory
164+ # Issue 16116
165+ if sys .exec_prefix != sys .base_exec_prefix :
166+ self .include_dirs .append (os .path .join (sys .exec_prefix , 'include' ))
167+
163168 # Put the Python "system" include dir at the end, so that
164169 # any local include dirs take precedence.
165170 self .include_dirs .append (py_include )
@@ -190,6 +195,8 @@ def finalize_options(self):
190195 # must be the *native* platform. But we don't really support
191196 # cross-compiling via a binary install anyway, so we let it go.
192197 self .library_dirs .append (os .path .join (sys .exec_prefix , 'libs' ))
198+ if sys .base_exec_prefix != sys .prefix : # Issue 16116
199+ self .library_dirs .append (os .path .join (sys .base_exec_prefix , 'libs' ))
193200 if self .debug :
194201 self .build_temp = os .path .join (self .build_temp , "Debug" )
195202 else :
Original file line number Diff line number Diff line change @@ -59,6 +59,9 @@ Core and Builtins
5959Library
6060-------
6161
62+ - Issue #16116: Fix include and library paths to be correctwhen building C
63+ extensions in venvs.
64+
6265- Issue #16245: Fix the value of a few entities in html.entities.html5.
6366
6467- Issue #16301: Fix the localhost verification in urllib/request.py for file://
You can’t perform that action at this time.
0 commit comments