Skip to content

Use entry_points instead of scripts #1574

@iamdefinitelyahuman

Description

@iamdefinitelyahuman

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions