Python: Replace wildcard imports with explicit imports (#3908)

* Python: Replace wildcard imports with explicit imports

- Replace all 'from ... import *' with explicit symbol imports
- Add __all__ declarations to namespace packages for re-exports
- Update CODING_STANDARD.md to prohibit wildcard imports
- Maintain exported API and preserve all functionality

fixes #3605

* Refine wildcard guidance example text

* Simplify explicit exports without self-aliases
This commit is contained in:
Eduard van Valkenburg
2026-02-13 15:02:36 +01:00
committed by GitHub
Unverified
parent a39fd69f76
commit 4452997e8d
6 changed files with 378 additions and 25 deletions
@@ -1,4 +1,28 @@
# Copyright (c) Microsoft. All rights reserved.
# Import and re-export from the actual implementation
from agent_framework_lab_gaia import * # noqa: F403
from agent_framework_lab_gaia import (
GAIA,
Evaluation,
Evaluator,
GAIATelemetryConfig,
Prediction,
Task,
TaskResult,
TaskRunner,
gaia_scorer,
viewer_main,
)
__all__ = [
"GAIA",
"Evaluation",
"Evaluator",
"GAIATelemetryConfig",
"Prediction",
"Task",
"TaskResult",
"TaskRunner",
"gaia_scorer",
"viewer_main",
]
@@ -1,4 +1,6 @@
# Copyright (c) Microsoft. All rights reserved.
# Import and re-export from the actual implementation
from agent_framework_lab_lightning import * # noqa: F403
from agent_framework_lab_lightning import AgentFrameworkTracer
__all__ = ["AgentFrameworkTracer"]
@@ -1,4 +1,20 @@
# Copyright (c) Microsoft. All rights reserved.
# Import and re-export from the actual implementation
from agent_framework_lab_tau2 import * # noqa: F403
from agent_framework_lab_tau2 import (
ASSISTANT_AGENT_ID,
ORCHESTRATOR_ID,
USER_SIMULATOR_ID,
TaskRunner,
patch_env_set_state,
unpatch_env_set_state,
)
__all__ = [
"ASSISTANT_AGENT_ID",
"ORCHESTRATOR_ID",
"USER_SIMULATOR_ID",
"TaskRunner",
"patch_env_set_state",
"unpatch_env_set_state",
]