ENH,BLD: console_script entrypoint
Opened this issue · 0 comments
westurner commented
-
main.py: with
console_script
entrypoints, you can generate a bin/scriptname.py script given a (testable) namedmain()
callable:def main(argv=None): argv = argv if argv is not None else [] RETURN_OK = 0 return RETURN_OK def test_main(args): retcode = main(["-h"]) assert retcode retcode = main(["--help"]) assert retcode retcode = main(["--test"]) # subprocess.call(["pytest", "--cov=", "--cov-report=term-missing", path='.'])
-
https://github.com/lexiq-legal/pydantic_schemaorg/blob/main/pyproject.toml
-
- This is w/ optparse, which doesn't support argparse things like auto bash-completion and sphinx docs, but does just return
(opts, args)
: https://github.com/westurner/dotvim/blob/9a2876d459be52710d0ce9c5bcedfe26fc3c9d42/snippets-ulti/python.snippets#L117-L120
- This is w/ optparse, which doesn't support argparse things like auto bash-completion and sphinx docs, but does just return