Skip to content

Commit

Permalink
fix: double add
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Sep 27, 2024
1 parent 947dc23 commit c411392
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 1 addition & 2 deletions ape_vyper/compiler/_versions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 5 additions & 2 deletions ape_vyper/compiler/_versions/vyper_04.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions tests/functional/test_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": ["*"]
Expand Down

0 comments on commit c411392

Please sign in to comment.