Skip to content

Commit

Permalink
feat: allow contracts-folder (with hyphen) in ape-config.yaml (#1820)
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey authored Jan 5, 2024
1 parent 3c86b54 commit cc4b9c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ape/managers/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions tests/functional/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit cc4b9c1

Please sign in to comment.