Split out of #16 (item 7).
Problem
config2py/tools.py get_configs_local_store decides "folder path vs app name" with os.path.sep in config_src. Consequences:
- An existing relative directory without a separator (e.g.
"configs") is treated as an app name, and a folder ~/.config/configs/configs is created instead.
- On Windows, where
os.path.sep == "\\", a forward-slash path such as "C:/work/configs" is also treated as an app name.
Why this was not changed here
The Windows half cannot be tested in a Linux cloud VM, and changing the classification of existing inputs moves where dependents read and write their configs. Labelled needs-local.
Proposed plan
- Treat
config_src as a path when it is a pathlib.Path, or os.path.isabs(config_src), or it contains os.sep or os.altsep. Keep plain names as app names.
- Optionally add a keyword-only
kind: Literal["auto", "path", "app"] = "auto" for explicitness.
- Tests:
Path inputs, absolute paths, altsep handling (run on Windows CI via test_on_windows), and the current behaviour for bare names unchanged.
Split out of #16 (item 7).
Problem
config2py/tools.pyget_configs_local_storedecides "folder path vs app name" withos.path.sep in config_src. Consequences:"configs") is treated as an app name, and a folder~/.config/configs/configsis created instead.os.path.sep == "\\", a forward-slash path such as"C:/work/configs"is also treated as an app name.Why this was not changed here
The Windows half cannot be tested in a Linux cloud VM, and changing the classification of existing inputs moves where dependents read and write their configs. Labelled
needs-local.Proposed plan
config_srcas a path when it is apathlib.Path, oros.path.isabs(config_src), or it containsos.seporos.altsep. Keep plain names as app names.kind: Literal["auto", "path", "app"] = "auto"for explicitness.Pathinputs, absolute paths,altsephandling (run on Windows CI viatest_on_windows), and the current behaviour for bare names unchanged.