Commit Graph

8 Commits

Author SHA1 Message Date
Julian Risch 6c7348023b chore: enable ANN ruff ruleset for type annotation enforcement (#10856)
* chore: enable ANN ruff ruleset, exclude components and testing dirs

- Add ANN (flake8-annotations) to ruff select in pyproject.toml
- Globally ignore ANN401 (Any) for legitimate dynamic types
- Exclude haystack/components/** and haystack/testing/** from ANN checks
  (mirrors existing mypy disallow_incomplete_defs=false overrides)
- Fix all 43 ANN violations in the remaining modules:
  - Add -> None to __post_init__ in breakpoints, file_content,
    image_content, sparse_embedding, streaming_chunk, tool, toolset, auth
  - Add -> str to __str__ in filter_policy, auth, hf (2x)
  - Add *args: Any, **kwargs: Any + return types to metaclass __call__
    in component.py and document.py, and __new__ in chat_message.py
  - Add -> None to async _runner() in async_pipeline.py
  - Type _check_callable_compatibility args and return bool
  - Add Callable return type to _dispatch_bm25
  - Type send_telemetry decorator params and return
  - Type __init_track__ and __setattr_warn__ wrapper functions
  - Type _parse_date, _parse_generic_args, async run()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: fix ANN violations in .github/utils and docs-website scripts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: fix mypy errors introduced by ANN annotations

- async_pipeline.py: _runner() returns Mapping[str, Any], not None
- dataclasses.py: extend type: ignore to cover arg-type in addition to call-arg

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* alphabetical order of ruff rules

* fix: add ANN type annotations to haystack/components and remove per-file-ignore

Fix all ANN (flake8-annotations) violations in haystack/components/ so
the per-file-ignore for that directory can be removed entirely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: remove haystack.components.* from mypy disallow_incomplete_defs override

All ANN type annotations have been added to haystack/components/, so the
mypy override is no longer needed for that module.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 11:28:33 +00:00
Stefano Fiorucci 34a2e7585c docs: improve create_unstable_docs_docusaurus.py script (#10685)
* draft

* improve

* simplify and improve
2026-02-27 11:44:21 +01:00
Stefano Fiorucci 819ed7244b chore: drop pylint (#10640)
* draft

* progress

* more fixes

* improvs

* strict

* rm pylint

* rm pylint comments

* fix and simplify

* standardize

* more

* alpha order

* final touch

* remove template

* rm ellipsis comments
2026-02-24 07:46:20 +00:00
Stefano Fiorucci 7c6323b960 refactor: support PEP604 typing syntax (X|Y and X|None) (#10255)
* adopt X|Y syntax: draft

* cast Union

* fix pylint + state testing

* use X|Y

* rm unused imports

* trigger e2e tests

* fix + simplification

* add compatibility tests

* rm e2e tests trigger

* fix

* add relnote

* simplify/fix pep604 union parsing

* fix comments

* test _is_optional_type

* introduce _build_pep604_union_type; make _is_union_type private

* try removing problematic test
2025-12-19 15:47:51 +01:00
Vladimir Blagojevic 4a56d52b60 chore: Update code snippets in docs (audio and builders components) (#10156)
* Update code snippets in docs

* Add reno note

* Revert "Add reno note"

This reverts commit 18733fa828ebedfe5b20903bcf0080abc198ad9e.

* PR feedback

* Minor fix

* No Secrets between us

* Comments format update

* Restore output format

* Script output, needs to be commented
2025-12-11 15:06:54 +01:00
Vladimir Blagojevic df3b13857e feat: Enable first snippet test runs in new documentation (#9967)
* Enable first snippet test runs in docs

* Move improved agent example to pydoc

* Linting docs

* Add pylint disable for too-many-positional-arguments
2025-11-06 10:26:56 +01:00
Daria Fokina a71dd7d2aa update license headers (#9861) 2025-10-10 12:04:48 +02:00
Daria Fokina a66a05f756 docs: moving Docusaurus setup to Haystack repo (#9847)
* move-docusarus-to-haystack

* debug

* add src

* blank page bug

* unify readme
2025-10-10 11:44:13 +02:00