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

feat: add --exclude-compiler flag to ape compile command #2494

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

0xthedance
Copy link
Contributor

What I did

Add a new flag to the ape compile command that allows to specify a compiler to be excluded from the compilation:

ape compile  --exclude-compiler

fixes: #2259

How I did it

Before invoking compiler's compile method , the code checks if exclude-compiler parameter matches the current compiler. If it does, the method skips that compiler and moves to the next one.

How to verify it

If you think is correct I could proceed with the tests.

  • [x ] All changes are completed
  • Change is covered in tests
  • Documentation is complete

@@ -42,6 +42,11 @@ def _include_dependencies_callback(ctx, param, value):
help="Also compile dependencies",
callback=_include_dependencies_callback,
)
@click.option(
Copy link
Member

Choose a reason for hiding this comment

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

This may also be useful in the ape pm compile command. We could potentially add this to the ape.cli.options module so it can be re-used.

@@ -42,6 +42,11 @@ def _include_dependencies_callback(ctx, param, value):
help="Also compile dependencies",
callback=_include_dependencies_callback,
)
@click.option(
"--exclude-compiler",
type=click.Choice(["solidity", "vyper"], case_sensitive=False),
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be a click.Choice. There are more compilers besides solidity and vyper. With Ape's plugin system, there isn't a fixed number of compilers.

A normal str type is just find.

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.

Easier ways to exclude CompilerAPIs from ape compile command
2 participants