git: b4119e9a6028 - main - www/py-websocket-client: Update to 1.4.2

From: Nuno Teixeira <eduardo_at_FreeBSD.org>
Date: Sat, 24 Dec 2022 14:10:42 UTC
The branch main has been updated by eduardo:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b4119e9a6028ed95b0127626329ef6894862fc20

commit b4119e9a6028ed95b0127626329ef6894862fc20
Author:     takefu <takefu@airport.fm>
AuthorDate: 2022-12-24 14:06:55 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2022-12-24 14:10:14 +0000

    www/py-websocket-client: Update to 1.4.2
    
    ChangeLog:
    https://github.com/websocket-client/websocket-client/compare/v0.58.0...v1.4.2
    
    PR:             262398
    Approved by:    maintainer timeout
---
 www/py-websocket-client/Makefile | 35 +++++++++++++++++++++++++----------
 www/py-websocket-client/distinfo |  6 +++---
 2 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/www/py-websocket-client/Makefile b/www/py-websocket-client/Makefile
index 1d944eeca5d2..923b80ca4b01 100644
--- a/www/py-websocket-client/Makefile
+++ b/www/py-websocket-client/Makefile
@@ -1,28 +1,43 @@
 PORTNAME=	websocket-client
-PORTVERSION=	0.58.0
+PORTVERSION=	1.4.2
 CATEGORIES=	www python
 MASTER_SITES=	CHEESESHOP
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
-# Newer version is called "websocket_client"
-# but to keep compat with old portname we fixup
-# "-" to "_" here.
-DISTNAME=	${PORTNAME:S/-/_/g}-${DISTVERSION}
 
 MAINTAINER=	alfred@FreeBSD.org
 COMMENT=	Websocket client for python
 WWW=		https://github.com/websocket-client/websocket-client
 
-LICENSE=	BSD3CLAUSE
+LICENSE=	APACHE20
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}six>=0:devel/py-six@${PY_FLAVOR}
+TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR}
 
-USES=		python:3.6+
-USE_PYTHON=	distutils concurrent autoplist
+USES=		python:3.7+
+USE_PYTHON=	autoplist distutils
 
 NO_ARCH=	yes
 
+OPTIONS_DEFINE=		OPTIONAL TEST
+OPTIONS_DEFAULT=	OPTIONAL TEST
+OPTIONAL_DESC=		SOCKS proxy support and performance boost
+TEST_DESC=		Run unit tests using a local echo server
+
+OPTIONAL_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}python-socks>0:net/py-python-socks@${PY_FLAVOR} \
+			${PYTHON_PKGNAMEPREFIX}wsaccel>0:www/py-wsaccel@${PY_FLAVOR}
+
+TEST_TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}websockets>0:devel/py-websockets@${PY_FLAVOR}
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MTEST}
+TEST_ENV=	LOCAL_WS_SERVER_PORT=8765
+.endif
+
 do-test:
-	@cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test
+.if ${PORT_OPTIONS:MTEST}
+	@(cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} websocket/tests/echo-server.py &)
+.endif
+	@(cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} pytest -v -ra)
 
 .include <bsd.port.mk>
diff --git a/www/py-websocket-client/distinfo b/www/py-websocket-client/distinfo
index 7c87ffccf195..6fba9826637b 100644
--- a/www/py-websocket-client/distinfo
+++ b/www/py-websocket-client/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1616713293
-SHA256 (websocket_client-0.58.0.tar.gz) = 63509b41d158ae5b7f67eb4ad20fecbb4eee99434e73e140354dc3ff8e09716f
-SIZE (websocket_client-0.58.0.tar.gz) = 48216
+TIMESTAMP = 1670301846
+SHA256 (websocket-client-1.4.2.tar.gz) = d6e8f90ca8e2dd4e8027c4561adeb9456b54044312dba655e7cae652ceb9ae59
+SIZE (websocket-client-1.4.2.tar.gz) = 49113