mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-12-01 01:16:09 +00:00
chore: Make docstring-parser core dep (#9477)
* Make docstring-parser core dep * Add reno note
This commit is contained in:
parent
853a32f8da
commit
b69d261280
@ -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:
|
||||
|
||||
@ -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]",
|
||||
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
---
|
||||
enhancements:
|
||||
- |
|
||||
Made doc-parser a core dependency since ComponentTool that uses it is one of the core Tool components.
|
||||
Loading…
x
Reference in New Issue
Block a user