From c4113928299cccee69c83463c46f6f42bf216890 Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Fri, 27 Sep 2024 14:08:27 -0500 Subject: [PATCH] fix: double add --- ape_vyper/compiler/_versions/base.py | 3 +-- ape_vyper/compiler/_versions/vyper_04.py | 7 +++++-- tests/functional/test_compiler.py | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ape_vyper/compiler/_versions/base.py b/ape_vyper/compiler/_versions/base.py index 96ef244..1c98581 100644 --- a/ape_vyper/compiler/_versions/base.py +++ b/ape_vyper/compiler/_versions/base.py @@ -190,8 +190,7 @@ def get_settings( optimization = False selection_dict = self._get_selection_dictionary(selection, project=pm) - search_paths = [*getsitepackages()] - search_paths.append(".") + search_paths = [*getsitepackages(), "."] version_settings[settings_key] = { "optimize": optimization, diff --git a/ape_vyper/compiler/_versions/vyper_04.py b/ape_vyper/compiler/_versions/vyper_04.py index e674567..9d6632a 100644 --- a/ape_vyper/compiler/_versions/vyper_04.py +++ b/ape_vyper/compiler/_versions/vyper_04.py @@ -31,12 +31,15 @@ def get_settings( project: Optional[ProjectManager] = None, ) -> dict: pm = project or self.local_project - settings = super().get_settings(version, source_paths, compiler_data, project=pm) + enable_decimals = self.api.get_config(project=pm).enable_decimals if enable_decimals is None: enable_decimals = False - settings["enable_decimals"] = enable_decimals + settings = super().get_settings(version, source_paths, compiler_data, project=pm) + for settings_set in settings.values(): + settings_set["enable_decimals"] = enable_decimals + return settings def _get_sources_dictionary( diff --git a/tests/functional/test_compiler.py b/tests/functional/test_compiler.py index 6521a0f..5a96323 100644 --- a/tests/functional/test_compiler.py +++ b/tests/functional/test_compiler.py @@ -784,16 +784,16 @@ def test_get_compiler_settings(project, compiler): assert vyper2_settings[Version("0.2.16")]["true%berlin"]["outputSelection"] == { "contracts/passing_contracts/older_version.vy": ["*"] } - assert "enable_decimals" not in vyper2_settings[Version("0.2.16")] + assert "enable_decimals" not in vyper2_settings[Version("0.2.16")]["true%berlin"] assert vyper3_settings[Version("0.3.7")]["true%paris"]["optimize"] is True assert vyper3_settings[Version("0.3.7")]["true%paris"]["evmVersion"] == "paris" assert vyper3_settings[Version("0.3.7")]["true%paris"]["outputSelection"] == { "contracts/passing_contracts/non_payable_default.vy": ["*"] } - assert "enable_decimals" not in vyper3_settings[Version("0.3.7")] + assert "enable_decimals" not in vyper3_settings[Version("0.3.7")]["true%paris"] - assert vyper4_settings[Version("0.4.0")]["enable_decimals"] is True + assert vyper4_settings[Version("0.4.0")]["gas%shanghai"]["enable_decimals"] is True assert vyper4_settings[Version("0.4.0")]["gas%shanghai"]["optimize"] == "gas" assert vyper4_settings[Version("0.4.0")]["gas%shanghai"]["outputSelection"] == { "contracts/passing_contracts/zero_four.vy": ["*"]