From cc4b9c1564d6ffd31c3b3ccdd4c8bf921debb814 Mon Sep 17 00:00:00 2001 From: antazoey Date: Fri, 5 Jan 2024 15:54:02 -0600 Subject: [PATCH] feat: allow contracts-folder (with hyphen) in ape-config.yaml (#1820) --- src/ape/managers/config.py | 4 +++- tests/functional/test_config.py | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ape/managers/config.py b/src/ape/managers/config.py index 4750fe7ad3..721ffc0f36 100644 --- a/src/ape/managers/config.py +++ b/src/ape/managers/config.py @@ -190,7 +190,9 @@ def _plugin_configs(self) -> Dict[str, PluginConfig]: self.dependencies = configs["dependencies"] # NOTE: It is okay for this directory not to exist at this point. - contracts_folder = user_config.pop("contracts_folder", None) + contracts_folder = user_config.pop( + "contracts_folder", user_config.pop("contracts-folder", None) + ) contracts_folder = ( (self.PROJECT_FOLDER / Path(contracts_folder)).expanduser().resolve() if contracts_folder diff --git a/tests/functional/test_config.py b/tests/functional/test_config.py index 9c5d632d57..32e4108c3f 100644 --- a/tests/functional/test_config.py +++ b/tests/functional/test_config.py @@ -284,3 +284,8 @@ def test_load_does_not_call_project_manager(temp_config, config): assert path.name not in [x.name for x in config.contracts_folder.parents] finally: config.project_manager.path = orig + + +def test_contracts_folder_with_hyphen(temp_config): + with temp_config({"contracts-folder": "src"}) as project: + assert project.contracts_folder.name == "src"