You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python: Simplify Python Poe tasks and unify package selectors (#4722)
* updated automation tasks and commands, with alias for the time being
* Restore aggregate test exclusions
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>
* updated versions in pre-commit
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: python/.github/skills/python-package-management/SKILL.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,17 +47,17 @@ uv run poe upgrade-dev-dependencies
47
47
48
48
# First, run workspace-wide lower/upper compatibility gates
49
49
uv run poe validate-dependency-bounds-test
50
-
# Defaults to --project "*"; pass a package to scope test mode
51
-
uv run poe validate-dependency-bounds-test --project <workspace-package-name>
50
+
# Defaults to --package "*"; pass a package to scope test mode
51
+
uv run poe validate-dependency-bounds-test --package core
52
52
53
53
# Then expand bounds for one dependency in the target package
54
-
uv run poe validate-dependency-bounds-project --mode both --project <workspace-package-name> --dependency "<dependency-name>"
54
+
uv run poe validate-dependency-bounds-project --mode both --package core --dependency "<dependency-name>"
55
55
56
56
# Repo-wide automation can reuse the same task
57
-
uv run poe validate-dependency-bounds-project --mode upper --project"*"
57
+
uv run poe validate-dependency-bounds-project --mode upper --package"*"
58
58
59
59
# Add a dependency to one project and run both validators for that project/dependency
60
-
uv run poe add-dependency-and-validate-bounds --project <workspace-package-name> --dependency "<dependency-spec>"
60
+
uv run poe add-dependency-and-validate-bounds --package core --dependency "<dependency-spec>"
61
61
```
62
62
63
63
### Dependency Bound Notes
@@ -66,7 +66,7 @@ uv run poe add-dependency-and-validate-bounds --project <workspace-package-name>
66
66
- Prerelease (`dev`/`a`/`b`/`rc`) and `<1.0` dependencies should use hard bounds with an explicit upper cap (avoid open-ended ranges).
67
67
- For `<1.0` dependencies, prefer the broadest validated range the package can really support. That may be a patch line, a minor line, or multiple minor lines when checks/tests show the broader lane is compatible.
68
68
- Prefer supporting multiple majors when practical; if APIs diverge across supported majors, use version-conditional imports/paths.
69
-
- For dependency changes, run workspace-wide bound gates first, then `validate-dependency-bounds-project --mode both` for the target package/dependency to keep minimum and maximum constraints current. The same task can also drive repo-wide upper-bound automation by using `--project "*"` and omitting `--dependency`.
69
+
- For dependency changes, run workspace-wide bound gates first, then `validate-dependency-bounds-project --mode both` for the target package/dependency to keep minimum and maximum constraints current. The same task can also drive repo-wide upper-bound automation by using `--package "*"` and omitting `--dependency`.
70
70
- Prefer targeted lock updates with `uv lock --upgrade-package <dependency-name>` to reduce `uv.lock` merge conflicts.
71
71
- Use `add-dependency-and-validate-bounds` for package-scoped dependency additions plus bound validation in one command.
72
72
- Use `upgrade-dev-dependencies` for repo-wide dev tooling refreshes; it repins dev dependencies, refreshes `uv.lock`, and reruns `check`, `typing`, and `test`.
Copy file name to clipboardExpand all lines: python/.github/skills/python-testing/SKILL.md
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,28 +17,35 @@ We run tests in two stages, for a PR each commit is tested with unit tests only
17
17
# Run tests for all packages in parallel
18
18
uv run poe test
19
19
20
-
# Run tests for a specific package
21
-
uv run --directory packages/core poe test
20
+
# Run tests for a specific workspace package
21
+
uv run poe test -P core
22
22
23
-
# Run all tests in a single pytest invocation (faster, uses pytest-xdist)
24
-
uv run poe all-tests
23
+
# Run all selected tests in a single pytest invocation
24
+
uv run poe test -A
25
25
26
26
# With coverage
27
-
uv run poe all-tests-cov
27
+
uv run poe test -A -C
28
+
uv run poe test -P core -C
28
29
29
30
# Run only unit tests (exclude integration tests)
30
-
uv run poe all-tests -m "not integration"
31
+
uv run poe test -A -m "not integration"
31
32
32
33
# Run only integration tests
33
-
uv run poe all-tests -m integration
34
+
uv run poe test -A -m integration
35
+
```
36
+
37
+
Direct package execution still works when you need it:
38
+
39
+
```bash
40
+
uv run --directory packages/core poe test
34
41
```
35
42
36
43
## Test Configuration
37
44
38
45
-**Async mode**: `asyncio_mode = "auto"` is enabled — do NOT use `@pytest.mark.asyncio`, but do mark tests with `async def` and use `await` for async calls
39
46
-**Timeout**: Default 60 seconds per test
40
47
-**Import mode**: `importlib` for cross-package isolation
41
-
-**Parallelization**: Large packages (core, ag-ui, orchestrations, anthropic) use `pytest-xdist` (`-n auto --dist worksteal`) in their `poe test` task. The `all-tests` task also uses xdist across all packages.
48
+
-**Parallelization**: Large packages (core, ag-ui, orchestrations, anthropic) use `pytest-xdist` (`-n auto --dist worksteal`) in their `poe test` task. The aggregate `uv run poe test -A` sweep also uses xdist across the selected packages.
0 commit comments