autocommand
autocommand copied to clipboard
Autocommand turns a python function into a CLI program
Hello, Attempting to package this for Guix I encountered the following error: ``` starting phase `check' ============================= test session starts ============================== platform linux -- Python 3.9.9, pytest-6.2.5, py-1.10.0, pluggy-0.13.1 --...
Currently, if one creates a command in Python and one interrupts it with Ctrl+C, it prints a full traceback and exits with a status 1. I'm inclined to think autocommand/automain...
The use of the logging module is pretty harmless, because when left uninitialized, most of its operations are no-ops. This issue proposes to add various messages at the DEBUG, INFO,...
Sometimes, when a default behavior is for a boolean switch to be True, the user will type in this: @autocommand(__name__) def main(no_do_thing=False): pass Instead of this: @autocommand(__name__) def main(do_thing=True): pass...
Here's the basic idea: ``` @autocommand(__name__) class Cmd: def __init__(self, ...): ... @subcommand def subcommand1(...): ... @subcommand def subcommand2(...): ... ``` The global arguments will be extracted from the class's...
[argcomplete](https://github.com/kislyuk/argcomplete) is a library that enables shell completion in argparse-enabled Python projects. As long as we're automatically creating and running an argparse parser, we may as well add support for...
Add variadic options (for instance, `cmd -v` vs `cmd -vvv`). Syntax idea: ``` def main(verbose: int =False) ```
Setuptools 69 [enforces the correct use of PEP 621 for `project.dynamic`. ](https://setuptools.pypa.io/en/latest/history.html#deprecations-and-removals) Fixes #28
During reading the [pip-run](https://github.com/jaraco/pip-run) code, I raised an eyebrow upon seeing this: https://github.com/jaraco/pip-run/blob/f5c50a4c2a84bc43ed090820d44f2d4bac6cb0c6/pip_run/read-deps.py#L21 Thanks to `typing.Annotated` being present, there is a modern, type-safe way to do it, like here: https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#add-query-to-annotated-in-the-q-parameter