Skip to content

Commit 07ade1a

Browse files
Copilotheyitsaamir
andauthored
Update Python CLI template imports to use underscore notation (#417)
Python packages with dots in their names must be imported using underscores. The CLI templates were using the incorrect dot notation (`microsoft.teams.*`) instead of the required underscore notation (`microsoft_teams.*`). ## Changes Updated import statements in all three Python CLI templates: **Before:** ```python from microsoft.teams.api import MessageActivity from microsoft.teams.apps import App from microsoft.teams.devtools import DevToolsPlugin ``` **After:** ```python from microsoft_teams.api import MessageActivity from microsoft_teams.apps import App from microsoft_teams.devtools import DevToolsPlugin ``` ## Files Modified - `packages/cli/templates/python/ai/src/main.py` - Updated 4 imports (ai, apps, devtools, openai) - `packages/cli/templates/python/echo/src/main.py` - Updated 3 imports (api, apps, devtools) - `packages/cli/templates/python/graph/src/main.py` - Updated 2 imports (api, apps) <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > For python cli templates, all imports must change from microsoft.teams.* to microsoft_teams.*. So for eg. microsoft.teams.apps changes to microsoft_teams.apps. Can you make those changes please? </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: heyitsaamir <48929123+heyitsaamir@users.noreply.github.com>
1 parent 3757371 commit 07ade1a

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import os
33

44
from dotenv import load_dotenv
5-
from microsoft.teams.ai import ChatPrompt
6-
from microsoft.teams.apps import App
7-
from microsoft.teams.devtools import DevToolsPlugin
8-
from microsoft.teams.openai import OpenAICompletionsAIModel
5+
from microsoft_teams.ai import ChatPrompt
6+
from microsoft_teams.apps import App
7+
from microsoft_teams.devtools import DevToolsPlugin
8+
from microsoft_teams.openai import OpenAICompletionsAIModel
99

1010
# Load variables from a .env file (if present) so os.environ.get() will pick them up.
1111
# Developers should copy `sample.env` -> `.env` to provide local values.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import asyncio
22
import re
33

4-
from microsoft.teams.api import MessageActivity, TypingActivityInput
5-
from microsoft.teams.apps import ActivityContext, App
6-
from microsoft.teams.devtools import DevToolsPlugin
4+
from microsoft_teams.api import MessageActivity, TypingActivityInput
5+
from microsoft_teams.apps import ActivityContext, App
6+
from microsoft_teams.devtools import DevToolsPlugin
77

88
app = App(plugins=[DevToolsPlugin()])
99

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import logging
88
import os
99

10-
from microsoft.teams.api import MessageActivity
11-
from microsoft.teams.apps import ActivityContext, App, SignInEvent
10+
from microsoft_teams.api import MessageActivity
11+
from microsoft_teams.apps import ActivityContext, App, SignInEvent
1212

1313
logger = logging.getLogger(__name__)
1414

0 commit comments

Comments
 (0)