From d3f53ad08754714d076978fdaaddd886149b8389 Mon Sep 17 00:00:00 2001 From: Tom Softreck Date: Sun, 11 Oct 2026 16:00:35 +0200 Subject: [PATCH] feat(queue): support pythonpath src and dot fallback in python-pytest builtin verify profile (ticket-448) --- project/TICKETS.md | 1 + project/ticket-448/README.md | 24 +++++++++ project/ticket-448/intent.json | 75 +++++++++++++++++++++++++++++ src/koru/queue/verify/profiles.py | 2 +- tests/test_queue_verify_profiles.py | 4 ++ 5 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 project/ticket-448/README.md create mode 100644 project/ticket-448/intent.json diff --git a/project/TICKETS.md b/project/TICKETS.md index f9320f1e..6dfece6e 100644 --- a/project/TICKETS.md +++ b/project/TICKETS.md @@ -442,4 +442,5 @@ project analysis or human-owned ticket inputs. | **ticket-442** | [`README.md`](./ticket-442/README.md) | - | - | - | - | - | | **ticket-443** | [`README.md`](./ticket-443/README.md) | - | - | - | - | - | | **ticket-445** | [`README.md`](./ticket-445/README.md) | - | - | - | - | - | +| **ticket-447** | [`README.md`](./ticket-447/README.md) | - | - | - | - | - | diff --git a/project/ticket-448/README.md b/project/ticket-448/README.md new file mode 100644 index 00000000..7aa1cfcc --- /dev/null +++ b/project/ticket-448/README.md @@ -0,0 +1,24 @@ +# Ticket 448: Support pythonpath src and dot fallback in python-pytest builtin verify profile + +- **ID**: ticket-448 +- **Owner**: gemini +- **Status**: IN_PROGRESS +- **Workflow state**: PUBLICATION +- **Created**: 2026-10-11 + +SESSION_EXECUTION_AUTHORIZATION: user requests continuation, test and merge. Builtin python-pytest profile must include src and . in pythonpath so packages with src/ layout can run pytest in clean worktrees without prior editable install. + +## Goal and scope + +Update `BUILTIN_PROFILES["python-pytest"]` in `src/koru/queue/verify/profiles.py` to use `python -m pytest -o pythonpath="src ." -q`. This ensures that in isolated worktrees (where repositories have not been installed via `pip install -e .`), pytest can discover and import package code located under `src/` as well as the repository root `.`. + +## Acceptance criteria + +- [x] AC-01: `BUILTIN_PROFILES["python-pytest"].command` is `python -m pytest -o pythonpath="src ." -q`. +- [x] AC-02: Regression tests verify that `python-pytest` executes with `pythonpath="src ."` option. +- [x] AC-03: Governance checks pass cleanly. + +## Tracking boundary + +This directory contains the minimal reviewed intent. Optional participant prose +and raw command logs are not required delivery output. diff --git a/project/ticket-448/intent.json b/project/ticket-448/intent.json new file mode 100644 index 00000000..de073ec7 --- /dev/null +++ b/project/ticket-448/intent.json @@ -0,0 +1,75 @@ +{ + "schema": "new-project.intent/v3", + "ticket": "ticket-448", + "summary": "Support pythonpath src and dot fallback in python-pytest builtin verify profile", + "workstream": "application", + "classification": { + "kind": "SERVICE", + "priority": "P2", + "origin": "health" + }, + "allowedPaths": [ + "project/ticket-448/**", + "TODO.md", + "project/TICKETS.md", + "src/koru/queue/verify/profiles.py", + "tests/test_queue_verify_profiles.py" + ], + "forbiddenPaths": [ + "project/ticket-*/user-*.md" + ], + "stacks": [], + "dependsOn": [], + "conflictsWith": [], + "integrationTicket": null, + "delivery": { + "acceptedBaseSha": "54490af40c001591304cb616cd66ec5617469716", + "targetBranch": "main", + "outcome": "Include src and . in pythonpath option for python-pytest builtin verify profile so that packages using src/ layout can be verified in fresh worktrees without prior editable install.", + "nonGoals": [ + "No changes to other verify profiles", + "No changes to custom project profiles" + ], + "complexity": "S", + "estimatedMinutes": 30, + "budgets": { + "maxImplementationFiles": 2, + "maxAffectedComponents": 1, + "maxPublicInterfaceChanges": 0, + "maxRuntimeDependencies": 0 + }, + "architecture": { + "status": "accepted", + "decision": "Configure python-pytest builtin profile to execute python -m pytest -o pythonpath=\"src .\" -q.", + "components": [ + { + "name": "queue-verify-profiles", + "paths": [ + "src/koru/queue/verify/profiles.py", + "tests/test_queue_verify_profiles.py" + ] + } + ], + "responsibilityChanges": false, + "interfaceChanges": [], + "dataChanges": [], + "ui": { + "impact": "none", + "states": [], + "evidence": [] + }, + "rollback": "Revert commit for ticket-448." + }, + "runtimeDependencies": [], + "validation": [ + { + "criterion": "AC-01", + "commands": [ + "pytest tests/test_queue_verify_profiles.py", + "./project/governance-check.sh" + ], + "evidence": "Tests verifying python-pytest command configuration and fallback." + } + ] + } +} diff --git a/src/koru/queue/verify/profiles.py b/src/koru/queue/verify/profiles.py index bbbb6e21..ada3af12 100644 --- a/src/koru/queue/verify/profiles.py +++ b/src/koru/queue/verify/profiles.py @@ -43,7 +43,7 @@ class VerifyProfile: for profile in ( VerifyProfile( name="python-pytest", - command="python -m pytest -q", + command='python -m pytest -o pythonpath="src ." -q', timeout_s=600, description="run the project's pytest suite", ), diff --git a/tests/test_queue_verify_profiles.py b/tests/test_queue_verify_profiles.py index 3ce8cc61..2233500a 100644 --- a/tests/test_queue_verify_profiles.py +++ b/tests/test_queue_verify_profiles.py @@ -109,6 +109,10 @@ def test_builtins_are_present_without_any_config(self) -> None: "shellcheck", ): self.assertIsNotNone(registry.get(name), name) + self.assertEqual( + registry.get("python-pytest").command, + 'python -m pytest -o pythonpath="src ." -q', + ) def test_a_project_profile_from_koru_yaml_is_loaded(self) -> None: with tempfile.TemporaryDirectory() as tmp: