Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions ai/py-langchain-core/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
PORTNAME= langchain-core
DISTVERSION= 1.2.19
PORTREVISION= 2
DISTVERSION= 1.7.6
CATEGORIES= ai python # machine-learning
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
Expand All @@ -12,36 +11,45 @@ WWW= https://python.langchain.com/docs/introduction/ \
https://github.com/langchain-ai/langchain

LICENSE= mit
LICENSE_FILE= ${WRKSRC}/LICENSE

BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}hatchling>0:devel/py-hatchling@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}jsonpatch>=1.33:devel/py-jsonpatch@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}langsmith>=0.3.45:ai/py-langsmith@${PY_FLAVOR} \
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}certifi>=2026.10.19:security/py-certifi@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}httpx>=0.23.0:www/py-httpx@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}jsonpatch>=1.33.0:devel/py-jsonpatch@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}langchain-protocol>=0.0.20:ai/py-langchain-protocol@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}langsmith>=0.14.9:ai/py-langsmith@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}langsmith<1.0.0:ai/py-langsmith@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}packaging>=23.2:devel/py-packaging@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pydantic2>=2.7.4:devel/py-pydantic2@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pydantic2<3.0.0:devel/py-pydantic2@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pyyaml>=5.3:devel/py-pyyaml@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}tenacity>=8.4.0<10.0.0>=8.1.0:devel/py-tenacity@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}tenacity>=8.4.1:devel/py-tenacity@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}typing-extensions>=4.7:devel/py-typing-extensions@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}uuid-utils>=0.12.0:misc/py-uuid-utils@${PY_FLAVOR}
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}blockbuster>=1.5.18:devel/py-blockbuster@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}freezegun>=1.2.2:devel/py-freezegun@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}grandalf>=0.8:math/py-grandalf@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}langchain-tests>0:ai/py-langchain-tests@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}numpy>=1.16:math/py-numpy@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytest-asyncio>=0.21.1:devel/py-pytest-asyncio@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}langchain-tests>=1.1.9:ai/py-langchain-tests@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}numpy>=1.26.4,1:math/py-numpy@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytest>=9.0.3,1:devel/py-pytest@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytest-asyncio>=1.3.0:devel/py-pytest-asyncio@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytest-benchmark>0:devel/py-pytest-benchmark@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytest-codspeed>0:devel/py-pytest-codspeed@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytest-mock>=3.10.0:devel/py-pytest-mock@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytest-socket>=0.7.0:devel/py-pytest-socket@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytest-watcher>0:devel/py-pytest-watcher@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytest-watcher>=0.3.4:devel/py-pytest-watcher@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytest-xdist>=3.6.1:devel/py-pytest-xdist@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}responses>=0.25.0:devel/py-responses@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}syrupy>=4.0.2:devel/py-syrupy@${PY_FLAVOR}
${PYTHON_PKGNAMEPREFIX}syrupy>=5.0.0:devel/py-syrupy@${PY_FLAVOR}

USES= python
USES= python:3.11+
USE_PYTHON= pep517 autoplist pytest

NO_ARCH= yes

# tests fail with: INTERNALERROR> ValueError: no option named 'only_extended'
# Upstream excludes Tenacity 8.4.0; dependency tuples cannot express !=.
# Match the upstream Makefile's default unit-test contract.
TEST_ARGS= --benchmark-disable --disable-socket --allow-unix-socket tests/unit_tests/

.include <bsd.port.mk>
6 changes: 3 additions & 3 deletions ai/py-langchain-core/distinfo
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
TIMESTAMP = 1773509067
SHA256 (langchain_core-1.2.19.tar.gz) = 87fa82c3eb4cc3d7a65f574cb447b5df09ec2131c8c2a0a02d4737ad02685438
SIZE (langchain_core-1.2.19.tar.gz) = 836647
TIMESTAMP = 1794980039
SHA256 (langchain_core-1.7.6.tar.gz) = 0833781e3a8e6fe83073c8412c21180a0545d5ccdf3437889951caf9589ece6c
SIZE (langchain_core-1.7.6.tar.gz) = 1037637
28 changes: 28 additions & 0 deletions ai/py-langchain-core/files/patch-langchain_core_utils_uuid.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--- langchain_core/utils/uuid.py.orig
+++ langchain_core/utils/uuid.py
@@ -7,6 +7,7 @@
Comment thread
laffer1 marked this conversation as resolved.
Dismissed
from __future__ import annotations

import typing
+from inspect import signature
from uuid import UUID

from uuid_utils.compat import uuid7 as _uuid_utils_uuid7
@@ -15,6 +16,9 @@
from uuid import UUID

_NANOS_PER_SECOND: typing.Final = 1_000_000_000
+_UUID_UTILS_HAS_NANOSECONDS: typing.Final = (
+ "nanoseconds" in signature(_uuid_utils_uuid7).parameters
+)


def _to_timestamp_and_nanos(nanoseconds: int) -> tuple[int, int]:
@@ -50,6 +54,8 @@
# For now, just delegate to the uuid_utils implementation
if nanoseconds is None:
return _uuid_utils_uuid7()
+ if _UUID_UTILS_HAS_NANOSECONDS:
+ return _uuid_utils_uuid7(nanoseconds=nanoseconds)
seconds, nanos = _to_timestamp_and_nanos(nanoseconds)
return _uuid_utils_uuid7(timestamp=seconds, nanos=nanos)
Loading