Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vyper 0.4.0 draft #1787

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
831c2fc
chore: bump vyper
BobTheBuidler Jul 11, 2024
ae22709
chore: update requirements.txt
BobTheBuidler Jul 11, 2024
5edb051
fix: remove root_path kwarg
BobTheBuidler Jul 11, 2024
de3309b
chore: force long method
BobTheBuidler Jul 11, 2024
1a55395
chore: disable if branch
BobTheBuidler Jul 11, 2024
7ac6ab5
fix: raise naked exc
BobTheBuidler Jul 11, 2024
b73b7eb
chore: use custom vvm
BobTheBuidler Jul 11, 2024
91b7bf6
fix: stringify versions
BobTheBuidler Jul 11, 2024
1d73e20
chore: print stuff
BobTheBuidler Jul 11, 2024
faadb16
chore: print more
BobTheBuidler Jul 11, 2024
565cd07
Update vyper.py
BobTheBuidler Jul 11, 2024
9306b75
Update vyper.py
BobTheBuidler Jul 11, 2024
569a362
Update vyper.py
BobTheBuidler Jul 11, 2024
ecbc162
Update vyper.py
BobTheBuidler Jul 11, 2024
c57ae76
Update vyper.py
BobTheBuidler Jul 11, 2024
5c9a9f5
Update vyper.py
BobTheBuidler Jul 11, 2024
97060d8
Update vyper.py
BobTheBuidler Aug 16, 2024
5142f4b
Update vyper.py
BobTheBuidler Aug 16, 2024
93c161a
Update vyper.py
BobTheBuidler Aug 16, 2024
88227c3
Update vyper.py
BobTheBuidler Aug 16, 2024
84837ac
Update vyper.py
BobTheBuidler Aug 16, 2024
ffa5626
Update vyper.py
BobTheBuidler Aug 16, 2024
cf75523
Update vyper.py
BobTheBuidler Aug 16, 2024
df84896
Update vyper.py
BobTheBuidler Aug 16, 2024
1224906
Update vyper.py
BobTheBuidler Aug 16, 2024
dcdd39f
Update vyper.py
BobTheBuidler Aug 16, 2024
4fa83d8
Update vyper.py
BobTheBuidler Aug 16, 2024
ca4e3b1
Update utils.py
BobTheBuidler Aug 16, 2024
951caa0
Update vyper.py
BobTheBuidler Aug 16, 2024
68577b4
Update utils.py
BobTheBuidler Aug 16, 2024
42da50f
Merge branch 'eth-brownie:master' into master
BobTheBuidler Aug 16, 2024
425fb40
chore: cleanup
BobTheBuidler Aug 16, 2024
8fce5fa
revert kwarg removal
BobTheBuidler Aug 16, 2024
1e005d6
Update vyper.py
BobTheBuidler Aug 16, 2024
f2a339f
Update vyper.py
BobTheBuidler Aug 16, 2024
846d952
chore: cleanup
BobTheBuidler Aug 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions brownie/project/compiler/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

def expand_source_map(source_map_str: str) -> List:
# Expands the compressed sourceMap supplied by solc into a list of lists

if isinstance(source_map_str, dict):
source_map_str = source_map_str["pc_pos_map_compressed"]
if not isinstance(source_map_str, str):
raise TypeError(source_map_str) from None

source_map: List = [_expand_row(i) if i else None for i in source_map_str.split(";")]
for i, value in enumerate(source_map[1:], 1):
if value is None:
Expand Down
14 changes: 7 additions & 7 deletions brownie/project/compiler/vyper.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ def set_vyper_version(version: Union[str, Version]) -> str:
version = Version(version)
if version != Version(vyper.__version__):
try:
vvm.set_vyper_version(version, silent=True)
vvm.set_vyper_version(str(version), silent=True)
except vvm.exceptions.VyperNotInstalled:
install_vyper(version)
vvm.set_vyper_version(version, silent=True)
vvm.set_vyper_version(str(version), silent=True)
_active_version = version
return str(_active_version)

Expand Down Expand Up @@ -82,13 +82,13 @@ def get_abi(contract_source: str, name: str) -> Dict:

def _get_vyper_version_list() -> Tuple[List, List]:
global AVAILABLE_VYPER_VERSIONS
installed_versions = vvm.get_installed_vyper_versions()
installed_versions = [Version(str(v)) for v in vvm.get_installed_vyper_versions()]
lib_version = Version(vyper.__version__)
if lib_version not in installed_versions:
installed_versions.append(lib_version)
if AVAILABLE_VYPER_VERSIONS is None:
try:
AVAILABLE_VYPER_VERSIONS = vvm.get_installable_vyper_versions()
AVAILABLE_VYPER_VERSIONS = [Version(str(v)) for v in vvm.get_installable_vyper_versions()]
except ConnectionError:
if not installed_versions:
raise ConnectionError("Vyper not installed and cannot connect to GitHub")
Expand Down Expand Up @@ -237,12 +237,12 @@ def compile_from_input_json(
outputs.remove("devdoc")
if version == Version(vyper.__version__):
try:
return vyper_json.compile_json(input_json, root_path=allow_paths)
return vyper_json.compile_json(input_json)
except VyperException as exc:
raise exc.with_traceback(None)
else:
try:
return vvm.compile_standard(input_json, base_path=allow_paths, vyper_version=version)
return vvm.compile_standard(input_json, base_path=allow_paths, vyper_version=str(version))
except vvm.exceptions.VyperError as exc:
raise CompilerError(exc, "vyper")

Expand Down Expand Up @@ -292,7 +292,7 @@ def _generate_coverage_data(
) -> Tuple:
if not opcodes_str:
return {}, {}, {}

source_map = deque(expand_source_map(source_map_str))
opcodes = deque(opcodes_str.split(" "))

Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ rlp
semantic-version<3
tqdm<5
vvm==0.1.0 # 0.2.0 switches from semantic-version to packaging.version and things break
vyper>=0.3.8,<0.4
vyper>=0.4.0,<0.5
web3>=6,<7
wrapt>=1.12.1,<2
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ typing-extensions==4.9.0
# web3
urllib3==2.2.1
# via requests
vvm==0.1.0
vvm==0.2.1
# via -r requirements.in
vyper==0.3.10
vyper==0.4.0
# via -r requirements.in
wcwidth==0.2.13
# via prompt-toolkit
Expand Down
Loading