Skip to content

fix[tool]: fix output bundle construction #4654

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented May 22, 2025

this fixes output bundle construction when there is a semantic error during compilation.

What I did

fix #4526

How I did it

How to verify it

Commit message

Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

this fixes output bundle construction when there is a semantic error
during compilation.
@@ -25,7 +25,7 @@
from vyper.utils import OrderedSet

if TYPE_CHECKING:
from vyper.semantics.analysis.base import ImportInfo, ModuleInfo
from vyper.semantics.analysis.base import ModuleInfo

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'ModuleInfo' may not be defined if module
vyper.semantics.analysis.base
is imported before module
vyper.semantics.types.module
, as the
definition
of ModuleInfo occurs after the cyclic
import
of vyper.semantics.types.module.
@charles-cooper charles-cooper marked this pull request as ready for review May 23, 2025 10:37
@charles-cooper charles-cooper changed the title refactor reachable imports to live on ImportAnalyzer fix[tool]: fix output bundle construction May 23, 2025
Copy link

codecov bot commented May 23, 2025

Codecov Report

Attention: Patch coverage is 96.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.79%. Comparing base (2cb4a87) to head (3f26d25).

Files with missing lines Patch % Lines
vyper/semantics/types/module.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4654   +/-   ##
=======================================
  Coverage   92.79%   92.79%           
=======================================
  Files         131      131           
  Lines       18939    18928   -11     
  Branches     3289     3283    -6     
=======================================
- Hits        17574    17565    -9     
+ Misses        934      932    -2     
  Partials      431      431           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ast_dict = {
"contract_name": str(compiler_data.contract_path),
"ast": ast_to_dict(compiler_data.vyper_module),
"imports": [ast_to_dict(ast) for ast in imported_modules],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this misses json interfaces, maybe let's leave a comment/raise an issue

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, i'll leave a comment.

@cyberthirst
Copy link
Collaborator

math doesn't show up in import for -f ast

import math

def foo():
    d: decimal = math.sqrt(2.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

-f archive fails for non-compiling contracts
2 participants