PORTNAME=	redis
PORTVERSION=	7.4.0
CATEGORIES=	databases python
MASTER_SITES=	PYPI
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}

MAINTAINER=	sunpoet@FreeBSD.org
COMMENT=	Python client for Redis key-value store
WWW=		https://redis.readthedocs.io/en/latest/ \
		https://github.com/redis/redis-py

LICENSE=	MIT
LICENSE_FILE=	${WRKSRC}/LICENSE

BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}hatchling>=0:devel/py-hatchling@${PY_FLAVOR}
TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}mock>=0:devel/py-mock@${PY_FLAVOR} \
		redis-server:databases/redis

USES=		python
USE_PYTHON=	autoplist concurrent pep517 pytest

NO_ARCH=	yes

CONFLICTS_INSTALL=	${PYTHON_PKGNAMEPREFIX}redis \
			${PYTHON_PKGNAMEPREFIX}redis[0-9]

OPTIONS_DEFINE=	HIREDIS JWT OCSP OTEL XXHASH
HIREDIS_DESC=	High performance response parser
JWT_DESC=	Authentication token
OCSP_DESC=	Online Certificate Status Protocol support
OTEL_DESC=	OpenTelemetry support
XXHASH_DESC=	Compute digest locally via xxHash

HIREDIS_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}hiredis>=3.2.0:databases/py-hiredis@${PY_FLAVOR}
JWT_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pyjwt>=2.9.0:www/py-pyjwt@${PY_FLAVOR}
OCSP_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pyopenssl>=20.0.1,1:security/py-pyopenssl@${PY_FLAVOR} \
			${PYTHON_PKGNAMEPREFIX}requests>=2.31.0:www/py-requests@${PY_FLAVOR}
OCSP_USE=		PYTHON=cryptography
OTEL_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}opentelemetry-api>=1.39.1:devel/py-opentelemetry-api@${PY_FLAVOR} \
			${PYTHON_PKGNAMEPREFIX}opentelemetry-exporter-otlp-proto-http>=1.39.1:devel/py-opentelemetry-exporter-otlp-proto-http@${PY_FLAVOR} \
			${PYTHON_PKGNAMEPREFIX}opentelemetry-sdk>=1.39.1:devel/py-opentelemetry-sdk@${PY_FLAVOR}
XXHASH_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}xxhash>=3.6.0<3.7:devel/py-xxhash@${PY_FLAVOR}

.include <bsd.port.pre.mk>

.if ${PYTHON_REL} < 31103
RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}async_timeout>=4.0.3:devel/py-async_timeout@${PY_FLAVOR}
.endif

.include <bsd.port.post.mk>
