From nobody Mon Jan 08 17:42:14 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T81bV35cWz56Dfh; Mon, 8 Jan 2024 17:42:14 +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 4T81bV2fhJz4vKB; Mon, 8 Jan 2024 17:42:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704735734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6jI4OO1z2GNisKvKilMvDb5+rD5bSusXZ6ZPh+YZRW4=; b=VugqQWj2AJR+Vsgt5aQXaL/abG4Ss7fgaxk9RzNBDDqfJUASr1EeynU2NfR+8Zv5s0FYkU WNgVAafhxof8MUvX15Z5xxSDmqoh0DxcT9qMmIsUS+lh79e+BrZkUtYlyVS6zr99cDy+Vf hdV267cOYQKefdZK1O7uohORywLcbr7qOB3Dx+orXXWp14Tp+xvd2GcI8znh80DvfD2OrE pHvytP8efCRFVdHGdUVA9DTzuKqmfDktNQCkmxyGu/kHkUtkNUiy/Eub8VKbSqOFHNlnlX VuT3gRR8uS8p7O1VQ0llbqIUXE8L04CqCFJ8HlQvKH/aigjpggFMyd+hY/ZQNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704735734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6jI4OO1z2GNisKvKilMvDb5+rD5bSusXZ6ZPh+YZRW4=; b=EZ1of0Qp3wWxD0GMazTtGj8ddK0kzBacnPqsqlykgfDjBb8imvpq9HXWqV1dLIdZui9ufP qAWAmiKdmQZ7lo+EMZw+E9MAdvuWSoo23vOXqlKOlK6cIEKjSyB74OkMO79E7MQfoAKgfl VdGmgVV0o0gzZrUE9fL3xmXGCddWuc2c60rdIJ/bQ9317CrFmUQzW6CN7ii2wurpfsMz38 pTQtfdsqbvvNQjpRAQcDOYjipE4fn9WkinPDjfzUUwWhl1Nxm4gV/KvG40LwgNvubs8rgG DCYHjVHaOrpgrnnXV6SQUCuzL99Ff4sRxc41zApjNYW8ZcBNDjie6R4UgRDKnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704735734; a=rsa-sha256; cv=none; b=GvIHy7ICOm7MtLmeviGKmEdoD6AbooEP76VFOOAMMax6j8uuvbR0pLqtWmE0PIBctA4KJ2 POqQDSsYbJPSXz1GukWaeKtH80RgUSfodA3R1lWxntLWfbmD8QlYqdssab+Q6/rPyJYRXO Jf/IQ8IXBktc8n+HFg1LiyizzGnjjEtlcKwvTNEWAcaKztI/U4lcVWmEy+lvJFBcOpaNzM JAMjt2+j48L1fpAp3z6VxoQF58hgE6WQ/ATP9KsIOIJAGQgRKIFlnZ/X9fUaTuIh1pLpk+ FFhYVtnCQQCiwrLSFw+UnepEfrVn+tMs6PyCvA2vfoEm3XL5MjXou8568T6jgg== 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 4T81bV1kl1zGlW; Mon, 8 Jan 2024 17:42:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 408HgEQh036251; Mon, 8 Jan 2024 17:42:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 408HgEC1036248; Mon, 8 Jan 2024 17:42:14 GMT (envelope-from git) Date: Mon, 8 Jan 2024 17:42:14 GMT Message-Id: <202401081742.408HgEC1036248@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: c9938cd6a315 - main - www/py-httpbin: update 0.7.0 =?utf-8?Q?=E2=86=92?= 0.10.1 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c9938cd6a315180087ea9a1160515fd23c84bbb7 Auto-Submitted: auto-generated The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=c9938cd6a315180087ea9a1160515fd23c84bbb7 commit c9938cd6a315180087ea9a1160515fd23c84bbb7 Author: Evilham AuthorDate: 2024-01-08 17:34:19 +0000 Commit: Yuri Victorovich CommitDate: 2024-01-08 17:41:49 +0000 www/py-httpbin: update 0.7.0 → 0.10.1 PR: 276138 --- www/py-httpbin/Makefile | 32 ++++++++++++--------- www/py-httpbin/distinfo | 6 ++-- www/py-httpbin/files/patch-httpbin-core.py | 11 ------- www/py-httpbin/files/patch-httpbin_core.py | 40 ++++++++++++++++++++++++++ www/py-httpbin/files/patch-httpbin_helpers.py | 41 +++++++++++++++++++++++++++ www/py-httpbin/files/patch-test__httpbin.py | 24 ---------------- 6 files changed, 102 insertions(+), 52 deletions(-) diff --git a/www/py-httpbin/Makefile b/www/py-httpbin/Makefile index d42713a93991..1f79e6e66e93 100644 --- a/www/py-httpbin/Makefile +++ b/www/py-httpbin/Makefile @@ -1,32 +1,36 @@ PORTNAME= httpbin -PORTVERSION= 0.7.0 -PORTREVISION= 1 +PORTVERSION= 0.10.1 CATEGORIES= www python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= contact@evilham.com COMMENT= HTTP Request & Response Service -WWW= https://github.com/postmanlabs/httpbin +WWW= https://github.com/psf/httpbin LICENSE= ISCL LICENSE_FILE= ${WRKSRC}/LICENSE -RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}blinker>=1.1:devel/py-blinker@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}brotlipy>=0:archivers/py-brotlipy@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}decorator>=0:devel/py-decorator@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}markupsafe>=0:textproc/py-markupsafe@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}flask>=0:www/py-flask@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}itsdangerous>=0:security/py-itsdangerous@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}raven>=0:devel/py-raven@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}werkzeug>=0.14.1:www/py-werkzeug@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}six>=0:devel/py-six@${PY_FLAVOR} +BUILD_DEPENDS= ${PY_SETUPTOOLS} \ + ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}flask>0:www/py-flask@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}brotlicffi>0:archivers/py-brotlicffi@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}decorator>0:devel/py-decorator@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}flasgger>0:www/py-flasgger@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}greenlet>=3.0.0a1:devel/py-greenlet@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}greenlet>=3.0:devel/py-greenlet@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}importlib-metadata>=0:devel/py-importlib-metadata@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}werkzeug>=0.14.1:www/py-werkzeug@${PY_FLAVOR} USES= python -USE_PYTHON= autoplist concurrent distutils +USE_PYTHON= pep517 autoplist pytest + +TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} + NO_ARCH= yes do-test: - @cd ${WRKSRC} && ${PYTHON_CMD} test_httpbin.py + @cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m unittest -v tests/test_httpbin.py .include diff --git a/www/py-httpbin/distinfo b/www/py-httpbin/distinfo index 4744b3aaddc1..59cd5142a3cc 100644 --- a/www/py-httpbin/distinfo +++ b/www/py-httpbin/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1607953372 -SHA256 (httpbin-0.7.0.tar.gz) = cbb37790c91575f4f15757f42ad41d9f729eb227d5edbe89e4ec175486db8dfa -SIZE (httpbin-0.7.0.tar.gz) = 92613 +TIMESTAMP = 1704479732 +SHA256 (httpbin-0.10.1.tar.gz) = 7b8596beb0e75a7b653c39d1f3cf263d6d5c476d29e1df6f7bb2b70bf9f06a3d +SIZE (httpbin-0.10.1.tar.gz) = 107058 diff --git a/www/py-httpbin/files/patch-httpbin-core.py b/www/py-httpbin/files/patch-httpbin-core.py deleted file mode 100644 index 61f342b9188f..000000000000 --- a/www/py-httpbin/files/patch-httpbin-core.py +++ /dev/null @@ -1,11 +0,0 @@ ---- httpbin/core.py.orig 2018-05-08 11:41:03 UTC -+++ httpbin/core.py -@@ -19,7 +19,7 @@ from flask import Flask, Response, request, render_tem - from six.moves import range as xrange - from werkzeug.datastructures import WWWAuthenticate, MultiDict - from werkzeug.http import http_date --from werkzeug.wrappers import BaseResponse -+from werkzeug.wrappers import Response as BaseResponse - from werkzeug.http import parse_authorization_header - from raven.contrib.flask import Sentry - diff --git a/www/py-httpbin/files/patch-httpbin_core.py b/www/py-httpbin/files/patch-httpbin_core.py new file mode 100644 index 000000000000..55f528e82182 --- /dev/null +++ b/www/py-httpbin/files/patch-httpbin_core.py @@ -0,0 +1,40 @@ +--- httpbin/core.py.orig 2023-08-28 22:56:17 UTC ++++ httpbin/core.py +@@ -32,7 +32,6 @@ except ImportError: # werkzeug < 2.1 + from werkzeug.wrappers import Response + except ImportError: # werkzeug < 2.1 + from werkzeug.wrappers import BaseResponse as Response +-from werkzeug.http import parse_authorization_header + from flasgger import Swagger, NO_SANITIZER + + from . import filters +@@ -47,6 +46,7 @@ from .helpers import ( + H, + ROBOT_TXT, + ANGRY_ASCII, ++ parse_authorization_header, + parse_multi_value_header, + next_stale_after_value, + digest_challenge_response, +@@ -636,16 +636,17 @@ def redirect_to(): + args_dict = request.args.items() + args = CaseInsensitiveDict(args_dict) + +- # We need to build the response manually and convert to UTF-8 to prevent +- # werkzeug from "fixing" the URL. This endpoint should set the Location +- # header to the exact string supplied. ++ ++ # Can be removed when: https://github.com/psf/httpbin/issues/36 is closed ++ # See also: ++ # https://src.fedoraproject.org/rpms/python-httpbin/c/54fe8e1f94f208b16ef0588e4eb69aaa107e9867?branch=rawhide + response = app.make_response("") + response.status_code = 302 + if "status_code" in args: + status_code = int(args["status_code"]) + if status_code >= 300 and status_code < 400: + response.status_code = status_code +- response.headers["Location"] = args["url"].encode("utf-8") ++ response.headers["Location"] = args["url"] + + return response + diff --git a/www/py-httpbin/files/patch-httpbin_helpers.py b/www/py-httpbin/files/patch-httpbin_helpers.py new file mode 100644 index 000000000000..f271fc354127 --- /dev/null +++ b/www/py-httpbin/files/patch-httpbin_helpers.py @@ -0,0 +1,41 @@ +--- httpbin/helpers.py.orig 2023-08-28 22:56:17 UTC ++++ httpbin/helpers.py +@@ -13,7 +13,15 @@ from hashlib import md5, sha256, sha512 + import time + import os + from hashlib import md5, sha256, sha512 +-from werkzeug.http import parse_authorization_header ++# Can be removed when: https://github.com/psf/httpbin/issues/36 is closed ++# See also (version order is wrong): ++# https://src.fedoraproject.org/rpms/python-httpbin/c/54fe8e1f94f208b16ef0588e4eb69aaa107e9867?branch=rawhide ++from werkzeug.http import dump_header ++try: ++ from werkzeug.datastructures import Authorization ++ parse_authorization_header = Authorization.from_header ++except ImportError: # werkzeug < 2.3 ++ from werkzeug.http import parse_authorization_header + from werkzeug.datastructures import WWWAuthenticate + + from flask import request, make_response +@@ -466,9 +474,17 @@ def digest_challenge_response(app, qop, algorithm, sta + ]), algorithm) + opaque = H(os.urandom(10), algorithm) + +- auth = WWWAuthenticate("digest") +- auth.set_digest('me@kennethreitz.com', nonce, opaque=opaque, +- qop=('auth', 'auth-int') if qop is None else (qop,), algorithm=algorithm) +- auth.stale = stale ++ # Can be removed when: https://github.com/psf/httpbin/issues/36 is closed ++ # See also: ++ # https://src.fedoraproject.org/rpms/python-httpbin/c/54fe8e1f94f208b16ef0588e4eb69aaa107e9867?branch=rawhide ++ values = { ++ 'realm': 'me@kennethreitz.com', ++ 'nonce': nonce, ++ 'opaque': opaque, ++ 'qop': dump_header(('auth', 'auth-int') if qop is None else (qop,)), ++ 'algorithm': algorithm, ++ 'stale': stale, ++ } ++ auth = WWWAuthenticate("digest", values=values) + response.headers['WWW-Authenticate'] = auth.to_header() + return response diff --git a/www/py-httpbin/files/patch-test__httpbin.py b/www/py-httpbin/files/patch-test__httpbin.py deleted file mode 100644 index f83c6dce27ee..000000000000 --- a/www/py-httpbin/files/patch-test__httpbin.py +++ /dev/null @@ -1,24 +0,0 @@ ---- test_httpbin.py.orig 2018-05-08 11:41:03 UTC -+++ test_httpbin.py -@@ -144,7 +144,9 @@ class HttpbinTestCase(unittest.TestCase): - data = json.loads(response.data.decode('utf-8')) - self.assertEqual(data['args'], {}) - self.assertEqual(data['headers']['Host'], 'localhost') -- self.assertEqual(data['headers']['Content-Length'], '0') -+ # Newest Werkzeug versions omit Content-Length if '0'; see -+ # https://github.com/postmanlabs/httpbin/pull/555/files -+ self.assertEqual(data['headers'].get('Content-Length', '0'), '0') - self.assertEqual(data['headers']['User-Agent'], 'test') - # self.assertEqual(data['origin'], None) - self.assertEqual(data['url'], 'http://localhost/get') -@@ -158,7 +160,9 @@ class HttpbinTestCase(unittest.TestCase): - data = json.loads(response.data.decode('utf-8')) - self.assertEqual(data['args'], {}) - self.assertEqual(data['headers']['Host'], 'localhost') -- self.assertEqual(data['headers']['Content-Length'], '0') -+ # Newest Werkzeug versions omit Content-Length if '0'; see -+ # https://github.com/postmanlabs/httpbin/pull/555/files -+ self.assertEqual(data['headers'].get('Content-Length', '0'), '0') - self.assertEqual(data['url'], 'http://localhost/anything/foo/bar') - self.assertEqual(data['method'], 'GET') - self.assertTrue(response.data.endswith(b'\n'))