Skip to content

Test tools (pytest) are installed in the production image: move them to dev requirements #231

Backlog

Description

@OkiriGabriel

Problem

requirements.txt, which the Docker image and the hashed lock (#121) install, contains test tools:

# --- Testing ---
pytest>=8.2.0
pytest-asyncio>=0.23.0

So the production image ships pytest and its dependencies (pluggy, iniconfig and so on). That means more attack surface, more CVEs to triage in Trivy and pip-audit, and a bigger image.

Fix

  • Move them to requirements-dev.txt (which exists) and/or [project.optional-dependencies] dev in pyproject.toml.
  • Regenerate the locks with scripts/lock.sh.
  • CI jobs that run tests install -r requirements.txt -r requirements-dev.txt, and the new Dependency Lock job does the same for its test step.
  • Check: the built image has no pytest (docker run … python -c "import pytest" fails).

Good first issue.

Files

requirements.txt, requirements-dev.txt, requirements.lock, .github/workflows/ci.yml, CONTRIBUTING.md

Activity

  1. added
    good first issue
    technical-debt
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issuetechnical-debt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions