From nobody Wed Jan 26 07:16:35 2022 X-Original-To: dev-commits-ports-all@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 AB46E196D482; Wed, 26 Jan 2022 07:16:36 +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 4JkFQD0H2Wz4kZH; Wed, 26 Jan 2022 07:16:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643181396; 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=gXzf0/YipkjvoybYyoQm2neOm7NknMgIrK42eWXqmPY=; b=L3eiCMjv19gE2Ughopfh3INQSuBuDh2VwzrpY+KTtYr0BvEdArw24XxRkvYHFBeQqImt5h Os4J18XE7yDxYepKsbOgkeDmZkEhGdi+SXB7aEKEZtsPYoiUlbeHIsfJKQgjH2oFQ9yOOT UfTjbX2fysTzcXBHVOkQK02AfOooN/68UFfKCgnbpuIum75EAMWP/IIDaCsIUk5L2VI+fQ JoCqGkKuob2xjvZh7SAriXvx711MTYrf7MrGSP5EoPNhTnj7v4hGijXD+qwxgv1gKJQisB +MfqX5xrAnZWtl/bBOy5LpRRioXNlUI56uBdmAKCPLwUwDAy9O5oXgLuULPmyw== 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 DE52319319; Wed, 26 Jan 2022 07:16:35 +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 20Q7GZfh034112; Wed, 26 Jan 2022 07:16:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20Q7GZKd034111; Wed, 26 Jan 2022 07:16:35 GMT (envelope-from git) Date: Wed, 26 Jan 2022 07:16:35 GMT Message-Id: <202201260716.20Q7GZKd034111@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Hiroki Tagato Subject: git: 120e65ad6842 - main - devel/py-makefun: add port: Dynamically create python functions with a proper signature List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tagattie X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 120e65ad68426e6c9be44e99b3ffc45931fde288 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643181396; 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=gXzf0/YipkjvoybYyoQm2neOm7NknMgIrK42eWXqmPY=; b=qlUh340bfYWnQwFiIjiQiVLeq4xY9d1DEwCsCASD1gLG8MpXayllrKMhHZnMfXvwaU+rxR v+n3REw1KKkUBK4bOQPcGXL8IDf2fB9Hjfckahj7oRrOh/uNN6IURH6quMpKJpTaDdElXL VIry5bROEu9WYsnyVs9TfqBSLKKb8nv8PQ9D19c9VPKn46noViJRj3pWSVMvOInRdj0DTh XZtgWWjIY0UsjWlT2Pt13YnoNv0Pgk0RBkKw6TlaN+fo+iyD7NOW0TFY3Op+WotTbsi+dq UqEPkvpFhVFNkMnRzQ4/FkYS5y4N/pRLql65mxXtl+3pRv5n3noD8Q1aXJVuAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643181396; a=rsa-sha256; cv=none; b=UFBmQ8QCc+DkqCkrRsOTXvNBljyrP6sQMr118NI+nzIMVI19VEwJA0C/BWP+o4yUMsvS8q bMRYVcMJqJfieRr+fBjtsdaCVT5TA6lgLTa38Fzf3BiuWdJxKcNTpkIRxssepCFO8RO8JU EhrhSQavlVBXI7w05JkQZ/BkDKm+6Bs38f3IouTSs6o0dcMFy2IcgpAiQMX75KpUhQaCi5 Ht5N4gmJC1fX8EQp2zuQc5NaEMj3f4OUmfYzhlFfQNGeMuSN0PXYZYTn5iUEqRPGG83EuU nmYOloe/ozgFeLKBdWMJFhWd+eBRrsqgZlcmBpSW8j6usAv33hW7T1s2uFYVrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tagattie: URL: https://cgit.FreeBSD.org/ports/commit/?id=120e65ad68426e6c9be44e99b3ffc45931fde288 commit 120e65ad68426e6c9be44e99b3ffc45931fde288 Author: Goran Mekić AuthorDate: 2022-01-26 07:13:28 +0000 Commit: Hiroki Tagato CommitDate: 2022-01-26 07:16:09 +0000 devel/py-makefun: add port: Dynamically create python functions with a proper signature Makefun helps you create functions dynamically, with the signature of your choice. It was largely inspired by decorator and functools, and created mainly to cover some of their limitations. The typical use cases are: * creating signature-preserving function wrappers - just like functools.wraps but with accurate TypeError exception raising when user-provided arguments are wrong, and with a very convenient way to access argument values. * creating function wrappers that have more or less arguments that the function they wrap. A bit like functools.partial but a lot more flexible and friendly for your users. For example, I use it in my pytest plugins to add a requests parameter to users' tests or fixtures when they do not already have it. * more generally, creating functions with a signature derived from a reference signature, or even creating functions with a signature completely defined at runtime. WWW: https://github.com/smarie/python-makefun PR: 260879 Reported by: Goran Mekić (new maintainer) --- devel/Makefile | 1 + devel/py-makefun/Makefile | 30 ++++++++++++++++++++++++++++++ devel/py-makefun/distinfo | 3 +++ devel/py-makefun/pkg-descr | 20 ++++++++++++++++++++ 4 files changed, 54 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index 815450176479..2566844bc5c2 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -4751,6 +4751,7 @@ SUBDIR += py-macholib SUBDIR += py-magic SUBDIR += py-mailcap-fix + SUBDIR += py-makefun SUBDIR += py-manuel SUBDIR += py-marrow.mailer SUBDIR += py-marrow.util diff --git a/devel/py-makefun/Makefile b/devel/py-makefun/Makefile new file mode 100644 index 000000000000..1ee54ed057c3 --- /dev/null +++ b/devel/py-makefun/Makefile @@ -0,0 +1,30 @@ +PORTNAME= makefun +PORTVERSION= 1.13.1 +CATEGORIES= devel python +MASTER_SITES= CHEESESHOP +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= meka@tilda.center +COMMENT= Dynamically create python functions with a proper signature + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pip>=0:devel/py-pip@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pytest-runner>=0:devel/py-pytest-runner@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}setuptools_scm>=0:devel/py-setuptools_scm@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}funcsigs>=0:devel/py-funcsigs@${PY_FLAVOR} +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>=0:devel/py-pytest@${PY_FLAVOR} + +USES= python:3.5-3.9 +USE_PYTHON= autoplist concurrent distutils + +TEST_ENV= PYTHONPATH=${WRKSRC}/src + +NO_ARCH= yes + +do-test: + cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest -v -rs -o addopts= + +.include diff --git a/devel/py-makefun/distinfo b/devel/py-makefun/distinfo new file mode 100644 index 000000000000..638e34a08e3a --- /dev/null +++ b/devel/py-makefun/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1643131820 +SHA256 (makefun-1.13.1.tar.gz) = 985bb8b670ffbbb95d2a8aa996d318e6e9a3f26fc6f3ef2da93ebdf8f9c616bf +SIZE (makefun-1.13.1.tar.gz) = 72170 diff --git a/devel/py-makefun/pkg-descr b/devel/py-makefun/pkg-descr new file mode 100644 index 000000000000..043075309cca --- /dev/null +++ b/devel/py-makefun/pkg-descr @@ -0,0 +1,20 @@ +Makefun helps you create functions dynamically, with the signature of your +choice. It was largely inspired by decorator and functools, and created mainly +to cover some of their limitations. + +The typical use cases are: + * creating signature-preserving function wrappers - just like functools.wraps + but with accurate TypeError exception raising when user-provided arguments are + wrong, and with a very convenient way to access argument values. + + * creating function wrappers that have more or less arguments that the + function they wrap. A bit like functools.partial but a lot more flexible and + friendly for your users. For example, I use it in my pytest plugins to add a + requests parameter to users' tests or fixtures when they do not already have + it. + + * more generally, creating functions with a signature derived from a reference + signature, or even creating functions with a signature completely defined at + runtime. + +WWW: https://github.com/smarie/python-makefun