Haystack uses Hatch for environment and dependency management.
Do not run python or pip directly.
Before running code on this project, you must be able to run hatch --version and get a correct output.
If not, ask the user where Hatch is or if they want to install it. For installation instructions, refer to https://hatch.pypa.io/latest/install/#installation.
hatch -e test run python SCRIPT.py
hatch -e test shell
uv pip install PACKAGE
hatch env prune
Tests run via Hatch and support pytest arguments.
Prefer running tests on a specific module or using -k, since the full suite is large.
hatch run test:unit
hatch run test:integration
hatch run test:types
Type checking targets Python 3.12, above the 3.10 floor in requires-python, because numpy's stubs use PEP 695 type statements that mypy rejects below 3.12. So mypy will not catch code that breaks on 3.10; the unit test matrix runs on 3.10 and covers that.
To fix type issues, avoid type: ignore, casts, or assertions when possible. If they are necessary, explain why.
hatch run fmt
Every user-facing PR (not docs, not CI) must include a release note:
hatch run release-note SHORT_DESCRIPTION
Edit the generated file in releasenotes/notes/. Release notes use reStructuredText formatting; see the release notes section in CONTRIBUTING.md for details.