From owner-dev-commits-ports-all@freebsd.org Fri May 7 13:30:10 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 86D7E62D53E; Fri, 7 May 2021 13:30:10 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FcBC63QDPz4bdc; Fri, 7 May 2021 13:30:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 684894132; Fri, 7 May 2021 13:30:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 147DUAok070111; Fri, 7 May 2021 13:30:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 147DUA6j070107; Fri, 7 May 2021 13:30:10 GMT (envelope-from git) Date: Fri, 7 May 2021 13:30:10 GMT Message-Id: <202105071330.147DUA6j070107@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Kai Knoblich Subject: git: fc93af74b8da - 2021Q2 - www/py-cherrypy: Fix runtime with Python 3.8 and onward MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kai X-Git-Repository: ports X-Git-Refname: refs/heads/2021Q2 X-Git-Reftype: branch X-Git-Commit: fc93af74b8da19e5742801a0aafad914d73cb9af Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 May 2021 13:30:10 -0000 The branch 2021Q2 has been updated by kai: URL: https://cgit.FreeBSD.org/ports/commit/?id=fc93af74b8da19e5742801a0aafad914d73cb9af commit fc93af74b8da19e5742801a0aafad914d73cb9af Author: Kai Knoblich AuthorDate: 2021-04-25 18:45:34 +0000 Commit: Kai Knoblich CommitDate: 2021-05-07 13:29:32 +0000 www/py-cherrypy: Fix runtime with Python 3.8 and onward Backport patches from the 18.x release branch that uses the Python's library "contextlib" instead of the external library "contextlib2". The "contextlib2" library is a backported version which is required for compatibility with Python 2.7 as the 17.x release of CherryPy is the last one that has compatibility for Python 2.7. Since the support for Python 2.7 has been removed in aa7a6c429ea6, "contextlib2 is no longer needed for backward compatibility. This is a transitional solution to fix the regression with Python 3.8 because an update to the 18.x release needs a bit more work and also requires one or more new Python packages. While I'm here: * Sort variables according to the PHB and pet portclippy. * Remove superfluous EXAMPLESDIR. * Convert to newer options framework. * Set NO_ARCH as there are no architecture specific files. * Add "do-test" target to make future QA easier. PR: 250379 Reported by: jbeich Approved by: maintainer timeout (6+ months) MFH: 2021Q2 (cherry picked from commit 7915fe9b3fce2721c82d041ebbe47cf0a47981c1) --- www/py-cherrypy/Makefile | 43 ++++++++++++---------- .../files/patch-cherrypy_lib_sessions.py | 27 ++++++++++++++ www/py-cherrypy/files/patch-setup.py | 17 +++++++++ 3 files changed, 68 insertions(+), 19 deletions(-) diff --git a/www/py-cherrypy/Makefile b/www/py-cherrypy/Makefile index 9e9c1b357292..18393c8fce00 100644 --- a/www/py-cherrypy/Makefile +++ b/www/py-cherrypy/Makefile @@ -2,6 +2,7 @@ PORTNAME= cherrypy PORTVERSION= 17.4.2 +PORTREVISION= 1 CATEGORIES= www python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -14,40 +15,44 @@ LICENSE= BSD3CLAUSE BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pip>0:devel/py-pip@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}setuptools_scm>0:devel/py-setuptools_scm@${PY_FLAVOR} - -EXAMPLES_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sqlobject>=1.5.1:databases/py-sqlobject@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}cheetah3>0:devel/py-cheetah3@${PY_FLAVOR} -EXAMPLESDIR= ${PREFIX}/share/examples/${PKGNAMEPREFIX}${PORTNAME} - RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}six>=1.11.0:devel/py-six@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}cheroot>=6.2.4:www/py-cheroot@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}portend>=2.1.1:net/py-portend@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}zclockfile>0:devel/py-zclockfile@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}more-itertools>0:devel/py-more-itertools@${PY_FLAVOR} +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>=2.8:devel/py-pytest@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}path.py>0:devel/py-path.py@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}requests-toolbelt>0:www/py-requests-toolbelt@${PY_FLAVOR} -OPTIONS_DEFINE= EXAMPLES +USES= python:3.6+ +USE_PYTHON= distutils autoplist concurrent + +TEST_ENV= PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} +NO_ARCH= yes PORTEXAMPLES= * -USES= python:3.6+ -USE_PYTHON= distutils autoplist concurrent +OPTIONS_DEFINE= EXAMPLES -.include +EXAMPLES_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sqlobject>=1.5.1:databases/py-sqlobject@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}cheetah3>0:devel/py-cheetah3@${PY_FLAVOR} -.if ${PORT_OPTIONS:MEXAMPLES} -post-install: +post-install-EXAMPLES-on: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} (cd ${WRKSRC}/cherrypy/tutorial && \ ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}) (cd ${STAGEDIR}${PREFIX} && \ ${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py \ -d ${EXAMPLESDIR} ${EXAMPLESDIR:S,${PREFIX}/,,}) -.endif - -.include - -.if ${PYTHON_REL} < 3800 -RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}contextlib2>0:devel/py-contextlib2@${PY_FLAVOR} -.endif -.include +# Some tests fails with Python 3.6/3.7/3.8/3.9 and are omitted for now. +# This should be revised once the ports gets updated to a newer release. +do-test: + @cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest -v -rs \ + -o addopts='' \ + -k 'not test_HTTP11_Timeout_after_request \ + and not test_threadlocal_garbage \ + and not test_null_bytes \ + and not testCombinedTools' + +.include diff --git a/www/py-cherrypy/files/patch-cherrypy_lib_sessions.py b/www/py-cherrypy/files/patch-cherrypy_lib_sessions.py new file mode 100644 index 000000000000..8130d1130c5c --- /dev/null +++ b/www/py-cherrypy/files/patch-cherrypy_lib_sessions.py @@ -0,0 +1,27 @@ +Remove contextlib2 and use contextlib from the standard library. + +* Contextlib has been in the Python standard library since Python 3.2. +* Contextlib2 is a backport to Python 2 (and is supported through Python 3.7). + +Obtained from: https://github.com/cherrypy/cherrypy/commit/2fc78dc9af3e + +--- cherrypy/lib/sessions.py.orig 2021-04-22 13:06:39 UTC ++++ cherrypy/lib/sessions.py +@@ -109,7 +109,7 @@ import binascii + + import six + from six.moves import cPickle as pickle +-import contextlib2 ++import contextlib + + import zc.lockfile + +@@ -572,7 +572,7 @@ class FileSession(Session): + def release_lock(self, path=None): + """Release the lock on the currently-loaded session data.""" + self.lock.close() +- with contextlib2.suppress(FileNotFoundError): ++ with contextlib.suppress(FileNotFoundError): + os.remove(self.lock._path) + self.locked = False + diff --git a/www/py-cherrypy/files/patch-setup.py b/www/py-cherrypy/files/patch-setup.py new file mode 100644 index 000000000000..d06d636f7de7 --- /dev/null +++ b/www/py-cherrypy/files/patch-setup.py @@ -0,0 +1,17 @@ +Remove contextlib2 and use contextlib from the standard library. + +* Contextlib has been in the Python standard library since Python 3.2. +* Contextlib2 is a backport to Python 2 (and is supported through Python 3.7). + +Obtained from: https://github.com/cherrypy/cherrypy/commit/2fc78dc9af3e + +--- setup.py.orig 2021-04-22 13:05:31 UTC ++++ setup.py +@@ -66,7 +66,6 @@ params = dict( + 'portend>=2.1.1', + 'more_itertools', + 'zc.lockfile', +- 'contextlib2', + ], + extras_require={ + 'docs': [