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

♻️ Implement Dunder __interface__ Method and Remove userdoc and devdoc Sanity Check #235

Merged
merged 7 commits into from
Apr 15, 2024

Conversation

charles-cooper
Copy link
Contributor

@charles-cooper charles-cooper commented Apr 14, 2024

🕓 Changelog

This PR refactors the existing module-friendly contracts to use the new dunder method __interface__ (see vyperlang/vyper#3919), which allows you to export all functions of a module without specifying the individual functions.

We apply the following rules:

  • Library modules keep the individual list exports syntax due to explicitness (application developers can thus identify faster what is exported within a library module),
  • Mocks might use it if more than one external function is exported. We do not use it in mock contracts if critical code comments for exported functions would be lost.

Furthermore, we remove the userdoc and devdoc compilation script & CI pipeline since it's now computed as part of the standard compilation pipeline (vyperlang/vyper#3946).

🐶 Cute Animal Picture

image

vyper v0.4.0rc2 adds the `.__interface__` shorthand for exporting all
the functions in a module. refactor to use this shorthand, saving some
typing and eye-strain :)
@charles-cooper charles-cooper changed the base branch from main to modules April 14, 2024 12:31
@pcaversaccio pcaversaccio self-assigned this Apr 15, 2024
@pcaversaccio pcaversaccio self-requested a review April 15, 2024 08:15
@pcaversaccio pcaversaccio added the refactor/cleanup ♻️ Code refactorings and cleanups label Apr 15, 2024
@pcaversaccio pcaversaccio added this to the 0.1.0 milestone Apr 15, 2024
@pcaversaccio pcaversaccio changed the title refactor: change some export lists to use .__interface__ ♻️ Implement Dunder __interface__ Method Apr 15, 2024
@pcaversaccio pcaversaccio added the documentation 📖 Improvements or additions to documentation label Apr 15, 2024
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
@pcaversaccio pcaversaccio changed the title ♻️ Implement Dunder __interface__ Method ♻️ Implement Dunder __interface__ Method and Remove userdoc and devdoc Sanity Check Apr 15, 2024
@pcaversaccio pcaversaccio added the ci/cd 👷‍♂️ CI/CD configurations label Apr 15, 2024
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
@pcaversaccio pcaversaccio merged commit b5126de into pcaversaccio:modules Apr 15, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd 👷‍♂️ CI/CD configurations documentation 📖 Improvements or additions to documentation refactor/cleanup ♻️ Code refactorings and cleanups
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants