Skip to content

Move to microsoft_teams namespace#226

Merged
heyitsaamir merged 8 commits into
mainfrom
aamirj/moveToDiffNamespace
Dec 5, 2025
Merged

Move to microsoft_teams namespace#226
heyitsaamir merged 8 commits into
mainfrom
aamirj/moveToDiffNamespace

Conversation

@heyitsaamir

@heyitsaamir heyitsaamir commented Nov 27, 2025

Copy link
Copy Markdown
Collaborator

This PR moves our packages from microsoft.teams.* namespace to microsoft_teams.* namespace.

The OSS team at Microsoft has guidance to avoid using microsoft namespace 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:

  1. We move all our packages from microsoft/teams/* structure to microsoft_teams structure.
  2. We keep the microsoft/teams/* structure with a shimmed init file to avoid breaking folks. We issue a warning when these imports are made and encourage folks to go to microsoft_teams.

@heyitsaamir
heyitsaamir marked this pull request as ready for review December 1, 2025 19:35
Copilot AI review requested due to automatic review settings December 1, 2025 19:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.* to microsoft_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.

Comment thread packages/apps/src/microsoft/teams/apps/__init__.py Outdated
Comment thread packages/api/src/microsoft/teams/api/__init__.py Outdated
Comment thread packages/ai/src/microsoft/teams/ai/__init__.py Outdated
Comment thread packages/a2aprotocol/src/microsoft/teams/a2a/__init__.py Outdated
Comment thread examples/botbuilder/src/bots/__init__.py

@lilyydu lilyydu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@heyitsaamir
heyitsaamir merged commit 94e6e5d into main Dec 5, 2025
6 checks passed
@heyitsaamir
heyitsaamir deleted the aamirj/moveToDiffNamespace branch December 5, 2025 00:07
@heyitsaamir heyitsaamir mentioned this pull request Dec 9, 2025
heyitsaamir added a commit that referenced this pull request Dec 9, 2025
## 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)
heyitsaamir added a commit that referenced this pull request Dec 9, 2025
I missed some in #226 . These wrap those up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants