Skip to content

Commit

Permalink
chore: isor
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Dec 12, 2023
1 parent 5f6cd59 commit db07b95
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ape_vyper/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from evm_trace.enums import CALL_OPCODES
from packaging.specifiers import InvalidSpecifier, SpecifierSet
from packaging.version import Version
from pydantic import field_validator
from pydantic import field_serializer, field_validator
from vvm import compile_standard as vvm_compile_standard
from vvm.exceptions import VyperError # type: ignore

Expand Down Expand Up @@ -74,6 +74,13 @@ class VyperConfig(PluginConfig):
def validate_version(cls, value):
return SpecifierSet(_version_to_specifier(value)) if isinstance(value, str) else value

@field_serializer("version")
def serialize_version(self, value: Optional[SpecifierSet], _info) -> Optional[str]:
if version := value:
return str(version)

return None


def _install_vyper(version: Version):
try:
Expand Down

0 comments on commit db07b95

Please sign in to comment.