core: deprecation doc removal (#28553)

![ScreenShot 2024-12-05 at 02 33
43PM@2x](https://github.com/user-attachments/assets/e1ce495b-90ca-41c7-9a65-b403a934675c)
This commit is contained in:
Erick Friis 2024-12-05 15:35:28 -08:00 committed by GitHub
parent 482e8a7855
commit 478def8dcc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -364,8 +364,15 @@ def deprecated(
_package or _name.split(".")[0].replace("_", "-") if "." in _name else None _package or _name.split(".")[0].replace("_", "-") if "." in _name else None
) )
since_str = f"{package}=={since}" if package else since since_str = f"{package}=={since}" if package else since
if removal:
if removal.startswith("1.") and package and package.startswith("langchain"):
removal_str = f"It will not be removed until {package}=={removal}."
else:
removal_str = f"It will be removed in {package}=={removal}."
else:
removal_str = ""
new_doc = f"""\ new_doc = f"""\
.. deprecated:: {since_str} {details} .. deprecated:: {since_str} {details} {removal_str}
{old_doc}\ {old_doc}\
""" """