Python: Simplify Python Poe tasks and unify package selectors#4722
Open
eavanvalkenburg wants to merge 3 commits intomicrosoft:mainfrom
Open
Python: Simplify Python Poe tasks and unify package selectors#4722eavanvalkenburg wants to merge 3 commits intomicrosoft:mainfrom
eavanvalkenburg wants to merge 3 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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>
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
python/scripts/workspace_poe_tasks.pyas the root dispatcher for the canonical Python task families:syntax,test,typing,check-packages, andcheck-P/--package,-A/--all,-S/--samples,-F/--format, and-C/--check/--covfmt/lintsplit withsyntaxas the primary entrypoint while keeping deprecated compatibility aliases in placeall-testsvariants and sample-only checks into the canonical task families instead of maintaining separate public commandssyntaxruns to start format and lint work through the shared parallel runner, and makestypingstart MyPy before Pyrightchecksupport and normalizes package selection so short names likecorework consistently across the root task families and dependency-bound validation flowspython/scripts/dependencies/add_dependency_to_project.pyso dependency-add flows can accept short workspace package selectors while still delegating touv add --packagewith the distribution name uv expectsDEPRECATED:, and groups the root task block by workflow family for discoverabilityDEV_SETUP.md, skill docs, VS Code tasks, pre-commit hooks, and GitHub workflows with the new task surface and package selector terminologyContribution Checklist