Skip to content

Python: Simplify Python Poe tasks and unify package selectors#4722

Open
eavanvalkenburg wants to merge 3 commits intomicrosoft:mainfrom
eavanvalkenburg:update_automation_tasks
Open

Python: Simplify Python Poe tasks and unify package selectors#4722
eavanvalkenburg wants to merge 3 commits intomicrosoft:mainfrom
eavanvalkenburg:update_automation_tasks

Conversation

@eavanvalkenburg
Copy link
Member

@eavanvalkenburg eavanvalkenburg commented Mar 16, 2026

Motivation and Context

The Python workspace Poe surface had grown difficult to navigate and maintain. We had overlapping task names for scope variants, inconsistent package selectors across task families, and duplicated task guidance across docs, workflows, editor tasks, and package-local task listings.

This change simplifies the contributor-facing command surface, keeps temporary compatibility aliases for existing workflows, and aligns the supporting automation around the same task model.

Description

  • Introduces python/scripts/workspace_poe_tasks.py as the root dispatcher for the canonical Python task families: syntax, test, typing, check-packages, and check
  • Consolidates task scope behind shared flags such as -P/--package, -A/--all, -S/--samples, -F/--format, and -C/--check / --cov
  • Replaces the public fmt/lint split with syntax as the primary entrypoint while keeping deprecated compatibility aliases in place
  • Folds legacy all-tests variants and sample-only checks into the canonical task families instead of maintaining separate public commands
  • Updates combined package syntax runs to start format and lint work through the shared parallel runner, and makes typing start MyPy before Pyright
  • Adds package-scoped check support and normalizes package selection so short names like core work consistently across the root task families and dependency-bound validation flows
  • Adds python/scripts/dependencies/add_dependency_to_project.py so dependency-add flows can accept short workspace package selectors while still delegating to uv add --package with the distribution name uv expects
  • Reworks root, shared, and package-local Poe task definitions to include descriptions, marks deprecated aliases with DEPRECATED:, and groups the root task block by workflow family for discoverability
  • Aligns DEV_SETUP.md, skill docs, VS Code tasks, pre-commit hooks, and GitHub workflows with the new task surface and package selector terminology
  • Keeps the sample formatting changes produced by the new syntax flow so the tree reflects the current formatter output
  • Adds concise explanatory comments/docstrings to the touched task-surface scripts where the control flow or compatibility behavior is non-obvious

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings March 16, 2026 11:27
@eavanvalkenburg eavanvalkenburg requested a review from a team as a code owner March 16, 2026 11:27
@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation python lab Agent Framework Lab labels Mar 16, 2026
@github-actions github-actions bot changed the title Simplify Python Poe tasks and unify package selectors Python: Simplify Python Poe tasks and unify package selectors Mar 16, 2026
Copy link
Contributor

Copilot AI left a comment

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 simplifies the Python workspace Poe task surface by introducing a single dispatcher script, standardizing package selectors/flags across task families, and updating supporting automation/docs to match the new command model.

Changes:

  • Added a root task dispatcher (python/scripts/workspace_poe_tasks.py) and shared selector matching (project_filter_matches) to unify --package/scope semantics.
  • Refactored root + package-local Poe task definitions (incl. deprecated aliases) and aligned dependency tooling to accept short package selectors like core.
  • Updated docs, CI/workflows, pre-commit hooks, VS Code tasks, and sample formatting to reflect the new task surface.

Reviewed changes

Copilot reviewed 60 out of 60 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
python/shared_tasks.toml Replaces per-package fmt/lint surface with syntax and adds task help/aliases.
python/scripts/workspace_poe_tasks.py New root dispatcher implementing unified flags, fan-out vs aggregate modes, prek/CI helpers.
python/scripts/task_runner.py Adds normalized selector matching + task arg forwarding for parallel/sequential execution.
python/scripts/dependencies/validate_dependency_bounds.py Reuses shared selector matching for dependency-bound validation package filters.
python/scripts/dependencies/add_dependency_to_project.py New wrapper translating short selectors to distribution names for uv add --package.
python/scripts/dependencies/_dependency_bounds_upper_impl.py Updates package filtering to use shared selector matcher.
python/scripts/dependencies/_dependency_bounds_lower_impl.py Updates package filtering to use shared selector matcher.
python/scripts/dependencies/README.md Updates documentation to use --package and short selectors (e.g., core).
python/samples/SAMPLE_GUIDELINES.md Updates sample syntax-check instructions to the new task surface.
python/samples/04-hosting/a2a/invoice_data.py Formatter-driven reflow of sample data construction.
python/samples/02-agents/tools/function_tool_with_session_injection.py Formatter-driven line wrapping.
python/samples/02-agents/tools/control_total_tool_executions.py Formatter-driven line wrapping and comment alignment.
python/samples/02-agents/skills/mixed_skills/mixed_skills.py Formatter-driven string reflow.
python/samples/02-agents/skills/file_based_skill/file_based_skill.py Formatter-driven string reflow.
python/samples/02-agents/skills/code_defined_skill/code_defined_skill.py Formatter-driven decorator/arg formatting.
python/samples/02-agents/providers/github_copilot/github_copilot_with_file_operations.py Formatter-driven function signature reflow.
python/samples/02-agents/devui/in_memory_mode.py Formatter-driven return/signature reflow.
python/samples/02-agents/compaction/tiktoken_tokenizer.py Formatter-driven constructor/message text formatting.
python/samples/02-agents/compaction/custom.py Formatter-driven condition/list formatting.
python/samples/02-agents/chat_client/custom_chat_client.py Sample update to use Message(..., text=...) formatting style.
python/samples/02-agents/chat_client/chat_response_cancellation.py Formatter-driven wrapping of asyncio.create_task(...).
python/pyproject.toml Reworks root Poe tasks around dispatcher, adds help text, keeps deprecated aliases, updates dependency tasks.
python/packages/redis/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/purview/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/orchestrations/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/ollama/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/mem0/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/lab/pyproject.toml Expands lab tasks to table form with help + sequences.
python/packages/lab/README.md Updates guidance to use root test -P lab scoping.
python/packages/github_copilot/pyproject.toml Adds help to test/pyright/mypy tasks; preserves version-guarded shells.
python/packages/foundry_local/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/durabletask/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/devui/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/declarative/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/core/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/copilotstudio/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/claude/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/chatkit/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/bedrock/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/azurefunctions/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/azure-cosmos/pyproject.toml Converts local Poe task definitions to table form with help; adds help to integration-tests task.
python/packages/azure-ai/pyproject.toml Converts local Poe task definitions to table form with help; adds help to integration-tests task.
python/packages/azure-ai-search/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/anthropic/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/ag-ui/pyproject.toml Converts local Poe task definitions to table form with help.
python/packages/a2a/pyproject.toml Converts local Poe task definitions to table form with help.
python/DEV_SETUP.md Rewrites contributor commands/docs to match new syntax/test/selector flags.
python/CODING_STANDARD.md Updates dependency-bound workflow examples to use --package.
python/.vscode/tasks.json Aligns VS Code tasks to the new Poe task surface and venv/setup flags.
python/.pre-commit-config.yaml Routes poe-check hook to the new dispatcher’s prek-check.
python/.github/skills/python-testing/SKILL.md Updates testing guidance to test -P/-A/-C model.
python/.github/skills/python-samples/SKILL.md Updates sample formatting/lint/syntax commands to syntax -S / pyright -S.
python/.github/skills/python-package-management/SKILL.md Updates dependency bound commands to --package/short selectors.
python/.github/skills/python-code-quality/SKILL.md Updates quality commands and prek behavior to match new task surface.
.github/workflows/python-tests.yml Updates CI to use uv run poe test -A.
.github/workflows/python-test-coverage.yml Updates coverage run to uv run poe test -A -C ....
.github/workflows/python-merge-tests.yml Updates merge-gate tests to uv run poe test -A ....
.github/workflows/python-integration-tests.yml Updates integration workflow to uv run poe test -A ....
.github/workflows/python-dependency-range-validation.yml Updates workflow to pass --package instead of --project.
.github/workflows/python-code-quality.yml Renames job step text and uses dispatcher for ci-mypy.

You can also share your feedback on Copilot code review. Take the survey.

Preserve the legacy all-tests scope for test --all by excluding lab and devui from the default aggregate sweep, while still allowing explicit package selection. Also ignore hidden/generated test directories such as .mypy_cache during aggregate discovery.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Mar 16, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL27070324188% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python Unit Test Overview

Tests Skipped Failures Errors Time
5221 20 💤 0 ❌ 0 🔥 1m 23s ⏱️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation lab Agent Framework Lab python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants