From 6881f415a9a20321af7c809080fc0469e27079db Mon Sep 17 00:00:00 2001 From: Nelson Elhage Date: Tue, 11 Feb 2025 11:26:44 -0800 Subject: [PATCH] `compile`: read `git_remote` from the `[scm]` section The example configuration (`doc/benchmark.conf.sample`) and the configuration in `test_commands.py` both expect it to be there. Add a fallback in case anyone has existing configurations with it set under `[config]`. --- pyperformance/compile.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyperformance/compile.py b/pyperformance/compile.py index d7ccc3f8..e02d608f 100644 --- a/pyperformance/compile.py +++ b/pyperformance/compile.py @@ -797,7 +797,12 @@ def getint(section, key, default=None): # [scm] conf.repo_dir = getfile('scm', 'repo_dir') conf.update = getboolean('scm', 'update', True) - conf.git_remote = getstr('config', 'git_remote', default='remotes/origin') + try: + conf.git_remote = getstr('scm', 'git_remote') + except KeyError: + # This key used to live under `config`. Fall back there + # for backwards-compatibility. + conf.git_remote = getstr('config', 'git_remote', default='remotes/origin') # [compile] conf.directory = getfile('compile', 'bench_dir')