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

refactor!: project system refactors #1960

Merged
merged 18 commits into from
May 28, 2024
Merged

Conversation

antazoey
Copy link
Member

@antazoey antazoey commented Mar 11, 2024

What I did

fixes: #1113
fixes: #660

required this PR: ApeWorX/ape-solidity#134
ape-vyper needs the same but havent done yet.

btw, just about everything is probably broken still, but i got all project system kinda working, so opening so no one think i just ghosted, because this has been a lot of refactoring

from ape import project, Project

# Still refer to the root project.
project.MyNFT

# Refer to projects from other locations.
other_project = Project("../path/to/other/project")
other_project.MyContractThere

# Use manifests as project.
manifest_project = Project.from_manifest("../path/to/manifest.json")
manifest_project.SomeContractThere

# Dependencies are better now.
# Install directly from Python if you care to (CLI + a config is still much better).
project.dependencies.install({"name": "apetrace", "github": "antazoey/ApeTrace", "ref": "main"})

# Refer to dependencies anywhere, even if they are not listed from this project.
# Note: listing is required for ape-solidity remappings to work though.
dependency = project.dependencies.get_dependency("apetrace", "main")

# Access dependency projects the exact same as regular projects:
dependency.project.ContractFromDependency

How I did it

How to verify it

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

@antazoey antazoey force-pushed the refactor/project branch 4 times, most recently from acd34ba to 3da1910 Compare March 12, 2024 19:11
@antazoey antazoey force-pushed the refactor/project branch 7 times, most recently from 27f76a0 to 8b8be57 Compare March 19, 2024 21:53
@antazoey
Copy link
Member Author

antazoey commented Mar 20, 2024

  • figure out how to put back ContractType separation

So right now on this PR, the notion of the separated ContractType artifact .jsons from the .build folder has been removed.
Mostly because it very annoying to work with.. the contract types need to be managed in 2 spots.

My idea is to output ABIs to a subfolder in .build, maybe if and only if you configure Ape to do so, and the source of truth remains in the manifest, and the ABIs just get places (and replaced) upon ever compilation via looking at all types in the manifest after compilation finishes. This way, users can still host these files and they are even smaller and they are unrelated to the rest of Ape... but am open to other ideas or even just putting back as-is. And by making it config driven, it becomes opt-in and most centered to the idea of minimization.

@antazoey antazoey force-pushed the refactor/project branch 8 times, most recently from 764152e to 8b56ea4 Compare March 27, 2024 20:17
@antazoey antazoey force-pushed the refactor/project branch 4 times, most recently from b55e936 to 50e4670 Compare April 2, 2024 17:11
@antazoey antazoey force-pushed the refactor/project branch 2 times, most recently from dc88821 to 48cbf01 Compare April 12, 2024 17:43
@NotPeopling2day NotPeopling2day changed the base branch from main to feat/08 April 16, 2024 01:10
@antazoey antazoey force-pushed the refactor/project branch 3 times, most recently from adcf956 to ef9b1fa Compare May 23, 2024 22:22
@antazoey antazoey force-pushed the refactor/project branch 7 times, most recently from e2f01b8 to cacf1e7 Compare May 24, 2024 18:49
:caption: Plugin Python Reference
:maxdepth: 1

methoddocs/ape_accounts.md
Copy link
Member Author

@antazoey antazoey May 24, 2024

Choose a reason for hiding this comment

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

@dtdang See how I am taking ape-accounts out of above and making a new section here for Plugin Python Reference? I want us to try and do this for core right now with all the core plugins. I had to make some changes in the core plugins to get it to work though, had to add __all__ = in the init, also some other docs files for the auto-modding

@antazoey antazoey marked this pull request as ready for review May 24, 2024 21:17
Copy link
Member

@fubuloubu fubuloubu left a comment

Choose a reason for hiding this comment

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

image

@antazoey antazoey merged commit 0081bac into ApeWorX:feat/08 May 28, 2024
13 checks passed
@antazoey antazoey deleted the refactor/project branch May 28, 2024 12:59
antazoey added a commit that referenced this pull request May 28, 2024
antazoey added a commit that referenced this pull request May 28, 2024
antazoey added a commit that referenced this pull request May 28, 2024
antazoey added a commit that referenced this pull request May 28, 2024
antazoey added a commit that referenced this pull request May 29, 2024
antazoey added a commit that referenced this pull request May 29, 2024
antazoey added a commit that referenced this pull request May 31, 2024
antazoey added a commit that referenced this pull request May 31, 2024
antazoey added a commit to antazoey/ape that referenced this pull request May 31, 2024
antazoey added a commit that referenced this pull request May 31, 2024
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.

Load a Project from a Manifest Convert CompilerAPI.compile method to consume and produce iterators
2 participants