Skip to content

Commit

Permalink
fix: Dependency with additional headers fails to install
Browse files Browse the repository at this point in the history
Fixes #2573

Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Jan 19, 2024
1 parent abbbfc2 commit 4011c27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions news/2573.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the wrong installation destination for header files when installing build requirements.
6 changes: 3 additions & 3 deletions src/pdm/environments/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def get_paths(self, dist_name: str | None = None) -> dict[str, str]:
replace_vars = None
kind = "user" if not is_venv and self.project.global_config["global_project.user_site"] else "default"
paths = get_sys_config_paths(str(self.interpreter.executable), replace_vars, kind=kind)
if not dist_name and not is_venv:
dist_name = "UNKNOWN"
if is_venv and self.prefix is None:
if is_venv:
python_xy = f"python{self.interpreter.identifier}"
paths["include"] = os.path.join(paths["data"], "include", "site", python_xy)
elif not dist_name:
dist_name = "UNKNOWN"
if dist_name:
paths["include"] = os.path.join(paths["include"], dist_name)
paths["prefix"] = paths["data"]
Expand Down

0 comments on commit 4011c27

Please sign in to comment.