@@ -103,8 +103,6 @@ def _venv_path(self, env_dir, name):
103103 vars = {
104104 'base' : env_dir ,
105105 'platbase' : env_dir ,
106- 'installed_base' : env_dir ,
107- 'installed_platbase' : env_dir ,
108106 }
109107 return sysconfig .get_path (name , scheme = 'venv' , vars = vars )
110108
@@ -175,9 +173,20 @@ def create_if_needed(d):
175173 context .python_dir = dirname
176174 context .python_exe = exename
177175 binpath = self ._venv_path (env_dir , 'scripts' )
178- incpath = self ._venv_path (env_dir , 'include' )
179176 libpath = self ._venv_path (env_dir , 'purelib' )
180177
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+
181190 context .inc_path = incpath
182191 create_if_needed (incpath )
183192 context .lib_path = libpath
0 commit comments