Simple Summary
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.
entry_points also provides better cross-platform compatibility, and it's use is recommended over scripts within the PyPA docs.
Motivation
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.
Copyright
Copyright and related rights waived via CC0
Simple Summary
Vyper's compiler scripts should be installed via
entry_pointsand made available asvyper.cliAbstract
Using
entry_pointsinstead ofscriptsremoves 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/cliallows them to be imported and accessed by other packages.entry_pointsalso provides better cross-platform compatibility, and it's use is recommended overscriptswithin the PyPA docs.Motivation
bin/vyperSpecification
setup.pyif __name__ == "main":withdef main():in allbinscriptsbinfolder tovyper/cli, add.pysuffix to filesBackwards Compatibility
Should not cause any issues as scripts will still be invoked via the same commands, and the
binfolder was not previously available to import as a package.Copyright
Copyright and related rights waived via CC0