From cbdb653a35a93cc4de6b733b7725a9346d01e4da Mon Sep 17 00:00:00 2001 From: Pavan Kumar Sunkara Date: Tue, 3 Jun 2025 09:47:17 +0530 Subject: [PATCH] Finalise template --- README.md | 7 +++++-- app/update.py | 8 +++++++- pyproject.toml | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d1a8ad5..aaf31c4 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # bot-python Starter kit for Python bot for Automa -Please read the [Bot Development](https://docs.automa.app/bot-development) docs to understand how this bot works. +Please read the [Bot Development](https://docs.automa.app/bot-development) docs to understand how an [Automa][automa] bot works and how to develop it. -* `/automa` endpoint is the receiver for the webhook from [Automa](https://automa.app) +* `/automa` endpoint is the receiver for the webhook from [Automa][automa] * `update` function in `app/update.py` is the logic responsible for updating code. * `AUTOMA_WEBHOOK_SECRET` environment variable is available to be set instead of hard-coding it. @@ -35,3 +35,6 @@ uv run pytest * Uses [uv](https://docs.astral.sh/uv/) as a package manager. * Uses [fastapi](https://fastapi.tiangolo.com/) as a server. +* Need [git](https://git-scm.org) to be installed in production. + +[automa]: https://automa.app diff --git a/app/update.py b/app/update.py index 649277d..1453bd1 100644 --- a/app/update.py +++ b/app/update.py @@ -1,4 +1,10 @@ -def update(folder: str): +from automa.bot import CodeFolder + + +def update(folder: CodeFolder): """ Update code in the specified folder. """ + + # If adding a new file, use the following: + # folder.add("example.py") diff --git a/pyproject.toml b/pyproject.toml index a549cf1..207da07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ requires-python = ">=3.11" classifiers = ["Private :: Do Not Upload"] dependencies = [ - "automa-bot~=0.1.4", + "automa-bot~=0.2.0", "fastapi-cli~=0.0.7", "fastapi~=0.115.11", "pydantic-settings~=2.8.1", @@ -15,7 +15,7 @@ dependencies = [ ] [dependency-groups] -dev = ["httpx~=0.28.1", "pytest-cov~=6.0.0", "pytest~=8.3.5", "ruff~=0.11.2"] +dev = ["httpx~=0.28.1", "pytest~=8.3.5", "ruff~=0.11.2"] [tool.pytest.ini_options] pythonpath = "."