Keep configs in ~/.config/build-release/ and tool state in ~/.local/state/build-release/, under XDG_* where set
CI / tests (pull_request) Successful in 6m34s

This commit is contained in:
2026-12-03 18:56:28 +01:00
parent 20c83f861f
commit 1ca2c8efe0
142 changed files with 1095 additions and 933 deletions
+4 -4
View File
@@ -46,19 +46,19 @@ class Features(typing.NamedTuple):
found: list[Feature]
def read_features(home: pathlib.Path, kind: Kind) -> Features | Failure:
def read_features(home: pathlib.Path, env: typing.Mapping[str, str], kind: Kind) -> Features | Failure:
"""The features of the current directory's project, or its data sources where kind is DATA_SOURCE, read from the folder its
config names."""
folder = features_folder(home)
folder = features_folder(home, env)
if isinstance(folder, Failure):
return folder
found = features(folder, kind)
return found if isinstance(found, Failure) else Features(folder, found)
def features_folder(home: pathlib.Path) -> pathlib.Path | Failure:
def features_folder(home: pathlib.Path, env: typing.Mapping[str, str]) -> pathlib.Path | Failure:
"""The folder the config of the current directory's project names as `bench-tasks`."""
config = located(None, home)
config = located(None, home, env)
if isinstance(config, Failure):
return config
return config.paths.get(BENCH_TASKS) or Failure(f"{config.folder / CONFIG} sets no `{BENCH_TASKS}`, the folder of the tasks to bench, as `project-config --help` describes it")