Skip to content

scripts/run_tests.sh requires undeclared pytest-split and fails in uv venvs without pip #22401

@corywardrop

Description

@corywardrop

Bug Description

scripts/run_tests.sh now requires pytest-split, but pytest-split is not declared in the project dev dependencies. If the selected Hermes dev venv was created by uv without pip, the script attempts to self-install the missing package with python -m pip and exits before running any tests because pip is unavailable.

This breaks the documented canonical test runner in a normal uv-managed development environment.

Reproduction

On current main at f2afa68a4, the selected venv is a uv-created venv:

$ read venv/pyvenv.cfg
home = /home/seedrop/.local/share/uv/python/cpython-3.11-linux-x86_64-gnu/bin
implementation = CPython
uv = 0.11.2
version_info = 3.11.15
include-system-site-packages = false

The venv has pytest/xdist but not pytest-split:

/home/seedrop/.hermes/hermes-agent/venv/bin/python
pytest 9.0.3
xdist ok
ModuleNotFoundError: No module named 'pytest_split'

Running the canonical test runner fails before pytest starts:

scripts/run_tests.sh --maxfail=20 -q

Observed output:

→ installing pytest-split into /home/seedrop/.hermes/hermes-agent/venv
/home/seedrop/.hermes/hermes-agent/venv/bin/python: No module named pip

Expected Behavior

The canonical test runner should work in the project-supported dev environment. Required test-runner dependencies should be installed by the dev dependency set, or the script should use a package-manager path that works for uv-created venvs without assuming pip is present.

Actual Behavior

The script has an undeclared runtime dependency on pytest-split and attempts an ad-hoc pip install into the venv. In uv-created venvs without pip, that bootstrap path fails immediately.

Relevant files:

  • scripts/run_tests.sh, lines 44-48: imports pytest_split, then runs "$PYTHON" -m pip install ... if missing.
  • pyproject.toml, line 57: [project.optional-dependencies].dev includes pytest/xdist but not pytest-split.

Suggested Fix

Prefer declaring pytest-split>=0.9,<1 in the dev extra so scripts/run_tests.sh does not need to install at runtime. If runtime bootstrap remains necessary, make it uv-aware or fail with a clear setup message instead of assuming pip exists.

Environment

  • Repo: NousResearch/hermes-agent
  • Branch: main
  • Commit tested: f2afa68a4
  • Python: uv-managed CPython 3.11.15 venv
  • scripts/run_tests.sh selected venv: /home/seedrop/.hermes/hermes-agent/venv

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existstype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions