You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vyper's compiler scripts should be installed via entry_points and made available as vyper.cli
Abstract
Using entry_points instead of scripts removes the need for if __name__ == "main": within Vyper's command-line scripts. Placing the functionality within a main() method simplifies writing unit tests. Migrating the scripts to vyper/cli allows them to be imported and accessed by other packages.
3rd party tooling written in python should be able to access the full range of the compiler's functionality without relying on a subprocess call to reach bin/vyper
Specification
modify setup.py
replace if __name__ == "main": with def main(): in all bin scripts
move the bin folder to vyper/cli, add .py suffix to files
Backwards Compatibility
Should not cause any issues as scripts will still be invoked via the same commands, and the bin folder was not previously available to import as a package.
Simple Summary
Vyper's compiler scripts should be installed via
entry_points
and made available asvyper.cli
Abstract
Using
entry_points
instead ofscripts
removes the need forif __name__ == "main":
within Vyper's command-line scripts. Placing the functionality within amain()
method simplifies writing unit tests. Migrating the scripts tovyper/cli
allows them to be imported and accessed by other packages.entry_points
also provides better cross-platform compatibility, and it's use is recommended overscripts
within the PyPA docs.Motivation
bin/vyper
Specification
setup.py
if __name__ == "main":
withdef main():
in allbin
scriptsbin
folder tovyper/cli
, add.py
suffix to filesBackwards Compatibility
Should not cause any issues as scripts will still be invoked via the same commands, and the
bin
folder was not previously available to import as a package.Copyright
Copyright and related rights waived via CC0
The text was updated successfully, but these errors were encountered: