Skip to content

Make bare pytest from repo root resolve Base Python packages #1385

Description

@codeforester

Context

Claude's 2026-07-02 review noted that plain pytest from the repository root does not resolve Base's split Python package roots unless callers set PYTHONPATH=lib/python:cli/python or use bin/base-test.

I rechecked on current main after the July 3 PR train. The supported runner passes, but bare collection still fails with import errors for packages such as base_cli, base_setup, and base_projects:

/Users/rameshhp/.base.d/base/.venv/bin/python -m pytest --collect-only -q

The failure is not a product test failure because bin/base-test sets the path correctly. It is a contributor ergonomics gap: a common Python test entrypoint fails before collection unless the caller knows Base's path contract.

Proposed outcome

Make direct Python test collection from the repo root work without manual environment setup, or document the intentional unsupported path more explicitly if there is a reason not to configure pytest.

Acceptance criteria

  • Either python -m pytest --collect-only -q from the repo root succeeds without manual PYTHONPATH, or docs/testing.md clearly states that bare pytest is unsupported and points to bin/base-test / the required PYTHONPATH.
  • The chosen path preserves the supported bin/base-test behavior.
  • Add a lightweight regression check if pytest configuration is changed.

Validation evidence from review follow-up: supported env -u BASE_HOME BASE_BASH_LIBS_DIR=/Users/rameshhp/work/base-bash-libs/lib/bash BASE_CACHE_DIR=/private/tmp/base-claude-review-20260703 ./bin/base-test passed with Python 744 passed, 1 skipped and BATS ok 601.

Metadata

Metadata

Assignees

Labels

ciContinuous integration, tests, automation, or release workflows

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions