Skip to content

Commit 42936f4

Browse files
authored
Revert "fix: expand some variables when constructing paths" (#846)
Reverts #844
1 parent 8fe8bca commit 42936f4

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

docs/changelog.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Fixes:
2727
* Warn if cmake/ninja in build system requirements by @henryiii in #803
2828
* Detect manual generator setting for `get_requires_*` by @henryiii in #840
2929
* Support nested and local gitignores by @henryiii in #827
30-
* Expand variables in some paths (mostly helps tests) by @henryiii in #842
3130

3231
Internal:
3332

src/scikit_build_core/program_search.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import contextlib
44
import json
5-
import os.path
65
import shutil
76
import subprocess
87
from pathlib import Path
@@ -53,7 +52,7 @@ def _get_cmake_path(*, module: bool = True) -> Generator[Path, None, None]:
5352
for candidate in candidates:
5453
cmake_path = shutil.which(candidate)
5554
if cmake_path is not None:
56-
yield Path(os.path.expandvars(cmake_path))
55+
yield Path(cmake_path)
5756

5857

5958
def _get_ninja_path(*, module: bool = True) -> Generator[Path, None, None]:
@@ -72,7 +71,7 @@ def _get_ninja_path(*, module: bool = True) -> Generator[Path, None, None]:
7271
for candidate in candidates:
7372
ninja_path = shutil.which(candidate)
7473
if ninja_path is not None:
75-
yield Path(os.path.expandvars(ninja_path))
74+
yield Path(ninja_path)
7675

7776

7877
def get_cmake_program(cmake_path: Path) -> Program:
@@ -157,7 +156,7 @@ def get_make_programs() -> Generator[Path, None, None]:
157156
for candidate in candidates:
158157
make_path = shutil.which(candidate)
159158
if make_path is not None:
160-
yield Path(os.path.expandvars(make_path))
159+
yield Path(make_path)
161160

162161

163162
def best_program(

tests/test_cmake_config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import os
4-
import os.path
54
import shutil
65
from pathlib import Path
76
from typing import TYPE_CHECKING
@@ -16,7 +15,7 @@
1615
if TYPE_CHECKING:
1716
from collections.abc import Generator
1817

19-
DIR = Path(os.path.expandvars(__file__)).parent.resolve()
18+
DIR = Path(__file__).parent.resolve()
2019

2120

2221
def configure_args(config: CMaker, *, init: bool = False) -> Generator[str, None, None]:

0 commit comments

Comments
 (0)