From owner-svn-ports-head@freebsd.org Sat Jan 26 09:21:15 2019 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E57B14BA735; Sat, 26 Jan 2019 09:21:15 +0000 (UTC) (envelope-from koobs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14D35708C1; Sat, 26 Jan 2019 09:21:15 +0000 (UTC) (envelope-from koobs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0750F1E018; Sat, 26 Jan 2019 09:21:15 +0000 (UTC) (envelope-from koobs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0Q9LEpb009532; Sat, 26 Jan 2019 09:21:14 GMT (envelope-from koobs@FreeBSD.org) Received: (from koobs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0Q9LE1V009530; Sat, 26 Jan 2019 09:21:14 GMT (envelope-from koobs@FreeBSD.org) Message-Id: <201901260921.x0Q9LE1V009530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: koobs set sender to koobs@FreeBSD.org using -f From: Kubilay Kocak Date: Sat, 26 Jan 2019 09:21:14 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r491252 - in head/net/py-pyzmq: . files X-SVN-Group: ports-head X-SVN-Commit-Author: koobs X-SVN-Commit-Paths: in head/net/py-pyzmq: . files X-SVN-Commit-Revision: 491252 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 14D35708C1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 09:21:15 -0000 Author: koobs Date: Sat Jan 26 09:21:14 2019 New Revision: 491252 URL: https://svnweb.freebsd.org/changeset/ports/491252 Log: net/py-pyzmq: Fix framework compliance issues Identified while QA'ing an upcoming net/libzmq update [1]: - Strip shared libraries. - Update (correct) LICENSE definition, previous was incomplete. - Backport upstream PR [2] to fix test_large_send OOM issue. QA: 209 passed, 33 skipped in 58.81 seconds [2] https://github.com/zeromq/pyzmq/pull/1219 PR: 230575 [1] Approved by: portmgr (blanket: framework compliance) MFH: 2019Q1 Added: head/net/py-pyzmq/files/ head/net/py-pyzmq/files/patch-PR1219 (contents, props changed) Modified: head/net/py-pyzmq/Makefile Modified: head/net/py-pyzmq/Makefile ============================================================================== --- head/net/py-pyzmq/Makefile Sat Jan 26 09:07:48 2019 (r491251) +++ head/net/py-pyzmq/Makefile Sat Jan 26 09:21:14 2019 (r491252) @@ -10,7 +10,10 @@ PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= novel@FreeBSD.org COMMENT= Python bindings for ZeroMQ -LICENSE= LGPL3 +LICENSE= BSD3CLAUSE LGPL3 +LICENSE_COMB= multi +LICENSE_FILE_BSD3CLAUSE= ${WRKSRC}/COPYING.BSD +LICENSE_FILE_LGPL3= ${WRKSRC}/COPYING.LESSER LIB_DEPENDS= libzmq.so:net/libzmq4 TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>=0:devel/py-pytest@${PY_FLAVOR} @@ -29,5 +32,9 @@ RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}asyncio>0:devel/p do-test: @cd ${WRKSRC} && ${PYTHON_CMD} ${PYSETUP} build_ext --inplace @cd ${WRKSRC} && ${PYTHON_CMD} ${PYSETUP} test + +post-install: + ${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/zmq/backend/cython/*.so + ${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/zmq/devices/*.so .include Added: head/net/py-pyzmq/files/patch-PR1219 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/py-pyzmq/files/patch-PR1219 Sat Jan 26 09:21:14 2019 (r491252) @@ -0,0 +1,72 @@ +From 545ed995e2121b8229390a34a3ae144f3a13cd84 Mon Sep 17 00:00:00 2001 +From: Min RK +Date: Mon, 20 Aug 2018 17:02:04 +0200 +Subject: [PATCH] improve test_large_send + +- reduce memory requirements by calling `recv(copy=False)` +- treat MemoryError during send/recv as a skip due to insufficient memory +- give it mark.large so it's easier for test runners to skip it explicitly +--- + zmq/tests/test_socket.py | 32 +++++++++++++++++++++++--------- + 1 file changed, 23 insertions(+), 9 deletions(-) + +diff --git zmq/tests/test_socket.py zmq/tests/test_socket.py +index 72eedb5a..59bf087e 100644 +--- zmq/tests/test_socket.py ++++ zmq/tests/test_socket.py +@@ -485,7 +485,7 @@ def test_subscribe_method(self): + pub.send(b'prefixmessage') + events = p.poll(1000) + self.assertEqual(events, []) +- ++ + # Travis can't handle how much memory PyPy uses on this test + @mark.skipif( + ( +@@ -497,16 +497,30 @@ def test_subscribe_method(self): + ), + reason="only run on 64b and not on Travis." + ) ++ @mark.large + def test_large_send(self): ++ c = os.urandom(1) ++ N = 2**31 + 1 + try: +- buf = os.urandom(1) * (2**31 + 1) +- except MemoryError: +- raise SkipTest() ++ buf = c * N ++ except MemoryError as e: ++ raise SkipTest("Not enough memory: %s" % e) + a, b = self.create_bound_pair() +- a.send(buf, copy=False) +- rcvd = b.recv() +- assert rcvd == buf +- ++ try: ++ a.send(buf, copy=False) ++ rcvd = b.recv(copy=False) ++ except MemoryError as e: ++ raise SkipTest("Not enough memory: %s" % e) ++ # sample the front and back of the received message ++ # without checking the whole content ++ # Python 2: items in memoryview are bytes ++ # Python 3: items im memoryview are int ++ byte = c if sys.version_info < (3,) else ord(c) ++ view = memoryview(rcvd) ++ assert len(view) == N ++ assert view[0] == byte ++ assert view[-1] == byte ++ + def test_custom_serialize(self): + a, b = self.create_bound_pair(zmq.DEALER, zmq.ROUTER) + def serialize(msg): +@@ -515,7 +529,7 @@ def serialize(msg): + content = json.dumps(msg['content']).encode('utf8') + frames.append(content) + return frames +- ++ + def deserialize(frames): + identities = frames[:-1] + content = json.loads(frames[-1].decode('utf8'))