chore: Make docstring-parser core dep (#9477)

* Make docstring-parser core dep

* Add reno note
This commit is contained in:
Vladimir Blagojevic 2025-06-05 11:28:18 +02:00 committed by GitHub
parent 853a32f8da
commit b69d261280
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 9 deletions

View File

@ -7,15 +7,11 @@ from dataclasses import MISSING, fields, is_dataclass
from inspect import getdoc
from typing import Any, Callable, Dict, List, Sequence, Tuple, Union, get_args, get_origin
from docstring_parser import parse
from pydantic import BaseModel, Field, create_model
from haystack import logging
from haystack.dataclasses import ChatMessage
from haystack.lazy_imports import LazyImport
with LazyImport(message="Run 'pip install docstring-parser'") as docstring_parser_import:
from docstring_parser import parse
logger = logging.getLogger(__name__)
@ -33,7 +29,6 @@ def _get_param_descriptions(method: Callable) -> Tuple[str, Dict[str, str]]:
if not docstring:
return "", {}
docstring_parser_import.check()
parsed_doc = parse(docstring)
param_descriptions = {}
for param in parsed_doc.params:

View File

@ -57,6 +57,7 @@ dependencies = [
"numpy",
"python-dateutil",
"jsonschema", # JsonSchemaValidator, Tool
"docstring-parser", # ComponentTool
"haystack-experimental",
]
@ -128,9 +129,6 @@ dependencies = [
# Structured logging
"structlog",
# ComponentTool
"docstring-parser",
# needed in link content fetcher tests
"httpx[http2]",

View File

@ -0,0 +1,4 @@
---
enhancements:
- |
Made doc-parser a core dependency since ComponentTool that uses it is one of the core Tool components.