Skip to content

Commit b2198b8

Browse files
authored
Update python templates (#372)
* Fix pyproject.toml for ai template * Add "uv run start" capability * Add "uv run typecheck" capability (with pyright dev-dep) These are all ways to simplify running the project for users and agents.
1 parent 65ea1a1 commit b2198b8

File tree

15 files changed

+99
-27
lines changed

15 files changed

+99
-27
lines changed
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Python Teams AI Bot
22

3-
This is a minimal Microsoft Teams ai bot template using [microsoft-teams](https://github.com/microsoft/teams.py).
3+
This is a minimal Microsoft Teams ai agent template using [microsoft-teams](https://github.com/microsoft/teams.py).
44

55
## Structure
66

@@ -11,7 +11,4 @@ This is a minimal Microsoft Teams ai bot template using [microsoft-teams](https:
1111
## Getting Started
1212

1313
1. Install [uv](https://github.com/astral-sh/uv).
14-
2. Run:
15-
```
16-
uv venv && uv sync && uv run src/main.py
17-
```
14+
2. Run `uv run start`

packages/cli/templates/python/ai/pyproject.toml renamed to packages/cli/templates/python/ai/pyproject.toml.hbs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "ai-bot"
2+
name = "{{ toKebabCase name }}"
33
version = "0.1.0"
44
description = "A Microsoft Teams AI bot using teams.py and OpenAI"
55
authors = [{ name = "Your Name", email = "you@example.com" }]
@@ -12,4 +12,20 @@ dependencies = [
1212
"microsoft.teams.ai",
1313
"microsoft.teams.openai",
1414
"microsoft-teams-devtools"
15-
]
15+
]
16+
17+
[dependency-groups]
18+
dev = [
19+
"pyright>=1.1.406",
20+
]
21+
22+
[project.scripts]
23+
start = "src.main:main"
24+
typecheck = "pyright.cli:entrypoint"
25+
26+
[build-system]
27+
requires = ["hatchling"]
28+
build-backend = "hatchling.build"
29+
30+
[tool.hatch.build.targets.wheel]
31+
packages = ["src"]

packages/cli/templates/python/ai/src/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,9 @@ async def handle_message(ctx):
3030
await ctx.send(result.response.content)
3131

3232

33-
if __name__ == "__main__":
33+
def main():
3434
asyncio.run(app.start())
35+
36+
37+
if __name__ == "__main__":
38+
main()

packages/cli/templates/python/echo/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,4 @@ This is a minimal Microsoft Teams echo bot template using [microsoft-teams](http
1111
## Getting Started
1212

1313
1. Install [uv](https://github.com/astral-sh/uv).
14-
2. Run:
15-
```
16-
uv venv && uv sync && uv run src/main.py
17-
```
14+
2. Run `uv run start`

0 commit comments

Comments
 (0)