-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: cache manifest to disk between compilations * fix: fixing some issues with manifest cache on disk Test plan: Made an ape project with one dep and one vyper contract. Ran `ape console`. First `project.contracts` lookup caused compilation. Subsequent lookups used the cache. Changing contract contents triggered a re-compile of only the changed contract. Adding a new contract triggered a compilation of just the one new file. Deleting a file caused the contract to disappear from `project.contracts`. * fix: use `with` to avoid leaking open file in eth_pm compiler Saw this warning while compiling JSON eth_pm packages. $ ( rm -rf .build/ ; ape console ) In [1]: contracts = project.contracts INFO: Compiling 'contracts/contract.vy' INFO: Compiling 'contracts/escrow.json' /src/ape/src/ape_pm/compiler.py:23: ResourceWarning: unclosed file <_io.TextIOWrapper name='/src/ape/example-ignore/contracts/escrow.json' mode='r' encoding='UTF-8'> data = json.load(path.open()) ResourceWarning: Enable tracemalloc to get the object allocation traceback * refactor: remove unused `ProjectManager.manifest` property This property is unused and when I was experimenting in the console its existence confused me. It's using `self.sources` to build the `PackageManifest`, which is `List[Path]` when it should be `Dict[str, Source]`. I also think it's confusing to have a `manifest` and `cached_manifest` property. I'll add this property back if its needed. * fix: give Source a `compute_checksum` method and use it Needed this to fix these mypy errors: src/ape/managers/project.py:116: error: Item "None" of "Optional[Checksum]" has no attribute "algorithm" src/ape/managers/project.py:118: error: Item "None" of "Optional[Checksum]" has no attribute "hash" * refactor: code review feedback * refactor: detect deleted ethpm JSON files via new sourcePath attribute * refactor: isort a few files flagged by CI * refactor: code review feedback Instead of duplicating checksum logic in `Source.compute_checksum`, use the `compute_checksum` util function. Fix isort issues (older version of isort was classifying requests as a first party package). Co-authored-by: Just some guy <[email protected]>
- Loading branch information
1 parent
69eb861
commit 894c786
Showing
10 changed files
with
211 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
from .contract import Bytecode, Compiler, ContractType | ||
from .contract import Bytecode, Checksum, Compiler, ContractType, Source | ||
from .manifest import PackageManifest, PackageMeta | ||
|
||
__all__ = [ | ||
"Bytecode", | ||
"Checksum", | ||
"Compiler", | ||
"ContractType", | ||
"PackageManifest", | ||
"PackageMeta", | ||
"Source", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.