testsAndMisc/meta/requirements-test.txt
Krzysztof kuhy Rudnicki e4b8ad0cfe Install only the test deps in Python tests CI: 79 packages -> 17
python-tests.yml runs pytest and nothing else, but installed the full
requirements.txt -- 79 packages, of which ~62 are linters, formatters and
type checkers that job never invokes. Installing them was the workflow's
slowest step: 49s, against 35s actually running the tests.

meta/requirements-test.txt holds the 17 that matter. Derived by static
import analysis over python_pkg/ and linux_configuration/tests/, then
VERIFIED rather than assumed -- a clean Python 3.11 venv with only this
list runs the whole suite:

  2174 passed, TOTAL 100.00%, 7138 stmts / 1748 branches, 0 missing

identical to the full-requirements run. Install of the subset: 6.2s.

The pytest-* entries are in the list even though nothing imports them:
randomly reorders tests, timeout enforces a limit, sugar changes
reporting and xdist provides -n. Dropping one changes how the suite runs.

Drift is gated, not left to discipline: a new requirements-test-sync hook
reuses check_requirements_sync.py's existing --requirements flag, so a
new third-party import fails at commit time rather than as a bare
ModuleNotFoundError in CI. The new file is also in both path filters.

pre-commit.yml keeps the full list -- it needs every formatter.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJrqKERAo5QUeEHWS5Asgp
2026-08-23 16:29:24 +02:00

41 lines
1.6 KiB
Plaintext

# ==============================================================================
# testsAndMisc — the dependencies needed to RUN THE TEST SUITE, and no others.
#
# python-tests.yml runs pytest and nothing else, but installed the full
# meta/requirements.txt: ~79 packages, of which ~62 are linters, formatters and
# type checkers that job never invokes. That install was the workflow's slowest
# step (49s, against 35s actually running pytest).
#
# Derived by static import analysis over python_pkg/ and
# linux_configuration/tests/, then VERIFIED by running the whole suite against
# only this list: 2174 passed, 100.00% coverage, 0 missing lines or branches.
#
# The pytest-* entries are here because they are plugins that change behaviour,
# not because anything imports them: randomly reorders tests, timeout enforces
# a limit, sugar changes reporting, xdist provides -n. Dropping one silently
# changes how the suite runs.
#
# The linting job (pre-commit.yml) still installs the full requirements.txt --
# it needs every formatter. Keep this file in sync when python_pkg gains a new
# runtime import; check_requirements_sync.py gates the full list, and the
# suite itself fails loudly here on a missing import.
# ==============================================================================
anthropic>=0.25.0
beautifulsoup4>=4.0
coverage>=7.4.0
defusedxml>=0.7.1
markdownify>=1.2.0
numpy>=1.20
pillow>=10.0
pytest>=8.0.0
pytest-cov>=4.1.0
pytest-randomly>=3.15.0
pytest-sugar>=1.0.0
pytest-timeout>=2.2.0
pytest-xdist>=3.5.0
requests>=2.0
rich>=13.0
typer>=0.12.0
typing_extensions