Skip to content

Commit 51bf175

Browse files
committed
Revert back normalizing platformio.*_dir option
1 parent 1e2c37c commit 51bf175

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

platformio/project/options.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ def validate_dir(path):
8787
return path
8888
if path.startswith("~"):
8989
path = fs.expanduser(path)
90-
return path
91-
# return os.path.abspath(path)
90+
return os.path.abspath(path)
9291

9392

9493
def get_default_core_dir():

tests/project/test_config.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,10 @@ def test_get_value(config):
354354
"--help",
355355
]
356356
# test relative dir
357-
assert config.get("platformio", "src_dir") == "source"
357+
assert config.get("platformio", "src_dir") == os.path.abspath(
358+
os.path.join(os.getcwd(), "source")
359+
)
360+
358361
# renamed option
359362
assert config.get("env:extra_1", "lib_install") == ["574"]
360363
assert config.get("env:extra_1", "lib_deps") == ["574"]
@@ -651,7 +654,7 @@ def test_nested_interpolation(tmp_path: Path):
651654
"""
652655
[platformio]
653656
build_dir = /tmp/pio-$PROJECT_HASH
654-
data_dir = $PROJECT_DIR/assets
657+
data_dir = /$PROJECT_DIR/assets
655658
656659
[env:myenv]
657660
build_flags = -D UTIME=${UNIX_TIME}
@@ -665,7 +668,7 @@ def test_nested_interpolation(tmp_path: Path):
665668
"""
666669
)
667670
config = ProjectConfig(str(project_conf))
668-
assert config.get("platformio", "data_dir") == "$PROJECT_DIR/assets"
671+
assert config.get("platformio", "data_dir") == "/$PROJECT_DIR/assets"
669672
assert config.get("env:myenv", "build_flags")[0][-10:].isdigit()
670673
testing_command = config.get("env:myenv", "test_testing_command")
671674
assert "$" not in " ".join(testing_command)

0 commit comments

Comments
 (0)