@@ -103,8 +103,6 @@ def _venv_path(self, env_dir, name):
103
103
vars = {
104
104
'base' : env_dir ,
105
105
'platbase' : env_dir ,
106
- 'installed_base' : env_dir ,
107
- 'installed_platbase' : env_dir ,
108
106
}
109
107
return sysconfig .get_path (name , scheme = 'venv' , vars = vars )
110
108
@@ -175,9 +173,20 @@ def create_if_needed(d):
175
173
context .python_dir = dirname
176
174
context .python_exe = exename
177
175
binpath = self ._venv_path (env_dir , 'scripts' )
178
- incpath = self ._venv_path (env_dir , 'include' )
179
176
libpath = self ._venv_path (env_dir , 'purelib' )
180
177
178
+ # PEP 405 says venvs should create a local include directory.
179
+ # See https://peps.python.org/pep-0405/#include-files
180
+ # XXX: This directory is not exposed in sysconfig or anywhere else, and
181
+ # doesn't seem to be utilized by modern packaging tools. We keep it
182
+ # for backwards-compatibility, and to follow the PEP, but I would
183
+ # recommend against using it, as most tooling does not pass it to
184
+ # compilers. Instead, until we standardize a site-specific include
185
+ # directory, I would recommend installing headers as package data,
186
+ # and providing some sort of API to get the include directories.
187
+ # Example: https://numpy.org/doc/2.1/reference/generated/numpy.get_include.html
188
+ incpath = os .path .join (env_dir , 'Include' if os .name == 'nt' else 'include' )
189
+
181
190
context .inc_path = incpath
182
191
create_if_needed (incpath )
183
192
context .lib_path = libpath
0 commit comments