Skip to content

Commit

Permalink
Reintroduce variables
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed Sep 17, 2024
1 parent 7f44951 commit f08333c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion tests/test_versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def test_npm_version_for_04_release():
with pytest.raises(UnexpectedVersionError) as excinfo:
detect_vyper_version_from_source("# pragma version ^0.4.1")

assert str(excinfo.value) == (
expected_msg = (
"Please use the pypi-style version specifier for vyper versions >= 0.4.0 (hint: ~=0.4.1)"
)
assert str(excinfo.value) == expected_msg
6 changes: 2 additions & 4 deletions vvm/utils/versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ def _detect_version_specifier(source_code: str) -> Specifier:
specifier, version_str = match.groups()
if specifier in ("~", "^"): # convert from npm-style to pypi-style
if Version(version_str) >= Version("0.4.0"):
raise UnexpectedVersionError(
f"Please use the pypi-style version specifier "
f"for vyper versions >= 0.4.0 (hint: ~={version_str})"
)
error = f"Please use the pypi-style version specifier for vyper versions >= 0.4.0 (hint: ~={version_str})"
raise UnexpectedVersionError(error)
# for v0.x, both specifiers are equivalent
specifier = "~=" # finds compatible versions

Expand Down

0 comments on commit f08333c

Please sign in to comment.