-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
fix: make .extract_manifest()
also compile if needed
#2248
Conversation
Some manual testing showing it working as well: In [7]: project.manifest.contract_types = {}
In [8]: mani_pedi = project.extract_manifest()
INFO (ape-vyper): Compiling using Vyper compiler '0.4.0'.
Input:
contracts/Token.vy
In [9]: mani_pedi = project.extract_manifest()
In [10]: mani_pedi = project.extract_manifest() |
|
src/ape/managers/project.py
Outdated
try: | ||
self.load_contracts() | ||
except CompilerError as err: | ||
logger.debug(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be higher? Maybe warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps! I am just worried about dependencies trying to extract manifests from that aren't meant to be compiled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i suppose they could just .manifest
in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to warning but added a comment. let me know if that makes sense, along with my concerns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps! I am just worried about dependencies trying to extract manifests from that aren't meant to be compiled.
Wonder if it makes more sense as like .enrich_manifest
or .fully_compiled_manifest
, or something
src/ape/managers/project.py
Outdated
@@ -2461,7 +2461,7 @@ def extract_manifest(self) -> PackageManifest: | |||
sources = dict(self.sources) | |||
contract_types = { | |||
n: ct | |||
for n, ct in (self.manifest.contract_types or {}).items() | |||
for n, ct in self.load_contracts().items() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so now load_contracts and extract manifest outputs the results i need?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can delete the .load_contracts()
line, yes (once 0.8.14 is out).
However, it also doesn't hurt to have it.
What I did
pre 0.8. this happened, and I don't see why it should not happen, so making it happen again.
(here you go @Ninjagod1251 )
How I did it
How to verify it
Checklist