Move to microsoft_teams namespace#226
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the package namespace from microsoft.teams.* to microsoft_teams.* to align with Microsoft OSS guidance. The dotted namespace structure creates potential conflicts when multiple packages share the microsoft directory in the Python import path. The underscore-based namespace provides better isolation and avoids import failures from namespace clobbering.
Key changes:
- All internal imports updated from
microsoft.teams.*tomicrosoft_teams.* - Backward compatibility shims added in old namespace locations with deprecation warnings
- Package build configurations updated to include both namespaces during transition period
Reviewed changes
Copilot reviewed 78 out of 445 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
packages/*/src/microsoft_teams/*/__init__.py |
New namespace package initialization files |
packages/*/src/microsoft/teams/*/__init__.py |
Backward compatibility shims with deprecation warnings and module aliasing |
packages/*/src/microsoft_teams/**/*.py |
Import statements updated to use new namespace |
packages/*/pyproject.toml |
Build targets updated to include both old and new namespace directories |
packages/*/tests/**/*.py |
Test imports updated to new namespace |
examples/**/src/**/*.py |
Example code updated to use new namespace |
.pre-commit-config.yaml |
Pre-commit hooks updated to exclude compatibility shims from validation |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
lilyydu
left a comment
There was a problem hiding this comment.
Thank you for following & updating! There's a few file conflicts but that might just be from the rename?
are you going to be queueing the SDK doc changes for this update also?
## Release 2.0.0a7 ### Changes - update react and react-dom to 19.2.1 (#233) - Move to microsoft_teams namespace (#226) - Simplify setting http response after activity processing (#218) - Add TeamsChannelAccount type for Teams-specific APIs (#230) - Updating mcpplugin reference in README.md (#229) - Bring back bot builder example (#225) - Fix choices_data alias to use "choices.data" instead of "choicesData" (#224) - [docs] botbuilder package README fixes (#223) - Fix calling AI functions with no parameters (#221)
I missed some in #226 . These wrap those up.
This PR moves our packages from
microsoft.teams.*namespace tomicrosoft_teams.*namespace.The OSS team at Microsoft has guidance to avoid using
microsoftnamespace for import names. (TLDR: the main reason is that that opens our package up to other packages also using the same namespace, even 3p packages, which leads to potential for breakage and clobbering since python treats these namespaces as file paths. So our packages would be in microsoft/teams, but a different package could be in microsoft/foo, sharing the microsoft directory. This could potentially lead to import failures and other potential issues).In this PR:
microsoft_teams.