У меня в основном 2 скрипты, управляющие CLI: main.py и cli.py
Код: Выделить всё
main.pyКод: Выделить всё
from src.cli import SearchFunction
import fire
def main_entrypoint():
fire.Fire(SearchFunction)
if __name__ == "__main__":
main_entrypoint()
Код: Выделить всё
class SecEdgarScraperCli:
@staticmethod
def text_search(
*keywords: str,
type: Optional[str] = None,
group: Optional[str] = None, # NEW ARGUMENT
) -> None:
"""
Perform a custom text search on the XXX website and save the results.
:param keywords: List of keywords to search for
:param type: Type of search
:param group: group to search # NEW ARGUMENT
"""
if True:
do_things()
Код: Выделить всё
poetry run edgar-tool text_search keywords to search for --type "type_1" --group "group_1"
Вместо этого используется прямое выполнение :
Код: Выделить всё
python main.py text_search keywords to search for --type "type_1" --group "group_1"
Код: Выделить всё
ERROR: Could not consume arg: --group
Код: Выделить всё
rm -r __pycache__
Почему это происходит? Как сделать так, чтобы прямое выполнение обновлялось с учетом внесенных правок?
Подробнее здесь: https://stackoverflow.com/questions/785 ... -execution