Skip to content

Commit

Permalink
core[patch]: deprecation docstring with lib (#18350)
Browse files Browse the repository at this point in the history
  • Loading branch information
efriis authored Mar 1, 2024
1 parent bce0684 commit 11cb42c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/core/langchain_core/_api/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,12 @@ def finalize( # type: ignore
addendum,
]
details = " ".join([component.strip() for component in components if component])
package = _name.split(".")[0].replace("_", "-") if "." in _name else None
since_str = f"{package}=={since}" if package else since
new_doc = (
f"[*Deprecated*] {old_doc}\n"
f"{notes_header if notes_header not in old_doc else ''}\n"
f".. deprecated:: {since}\n"
f".. deprecated:: {since_str}\n"
f" {details}"
)

Expand Down

0 comments on commit 11cb42c

Please sign in to comment.