From nobody Mon Nov 15 00:27:28 2021 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 A83FB1849BFF; Mon, 15 Nov 2021 00:27:28 +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 4HsqlN3N2Dz4hbD; Mon, 15 Nov 2021 00:27:28 +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 1D7F0103C4; Mon, 15 Nov 2021 00:27:28 +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 1AF0RSKM015124; Mon, 15 Nov 2021 00:27:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AF0RSrQ015123; Mon, 15 Nov 2021 00:27:28 GMT (envelope-from git) Date: Mon, 15 Nov 2021 00:27:28 GMT Message-Id: <202111150027.1AF0RSrQ015123@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: 383c0f67ccfe - main - net/py-duet: New port: Simple future-based async library for python 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: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 383c0f67ccfe5ec71f127cec7b3ce7be8bc530b8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=383c0f67ccfe5ec71f127cec7b3ce7be8bc530b8 commit 383c0f67ccfe5ec71f127cec7b3ce7be8bc530b8 Author: Yuri Victorovich AuthorDate: 2021-11-14 23:32:03 +0000 Commit: Yuri Victorovich CommitDate: 2021-11-15 00:27:21 +0000 net/py-duet: New port: Simple future-based async library for python --- net/Makefile | 1 + net/py-duet/Makefile | 23 +++++++++++++++++++++++ net/py-duet/distinfo | 3 +++ net/py-duet/pkg-descr | 20 ++++++++++++++++++++ 4 files changed, 47 insertions(+) diff --git a/net/Makefile b/net/Makefile index 3c227cdaf043..544e2769c331 100644 --- a/net/Makefile +++ b/net/Makefile @@ -1025,6 +1025,7 @@ SUBDIR += py-confluent-kafka SUBDIR += py-cymruwhois SUBDIR += py-dpkt + SUBDIR += py-duet SUBDIR += py-dugong SUBDIR += py-ec2-cli-tools SUBDIR += py-errbot diff --git a/net/py-duet/Makefile b/net/py-duet/Makefile new file mode 100644 index 000000000000..9875568eec9e --- /dev/null +++ b/net/py-duet/Makefile @@ -0,0 +1,23 @@ +PORTNAME= duet +PORTVERSION= 0.2.3 +CATEGORIES= net python +MASTER_SITES= CHEESESHOP +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Simple future-based async library for python + +LICENSE= APACHE20 +LICENSE_FILE= ${WRKSRC}/LICENSE + +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} + +USES= python:3.7+ # 3.6 requires extra-dependencies +USE_PYTHON= distutils autoplist + +NO_ARCH= yes + +do-test: + @cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest -v -rs + +.include diff --git a/net/py-duet/distinfo b/net/py-duet/distinfo new file mode 100644 index 000000000000..d284c3b8d876 --- /dev/null +++ b/net/py-duet/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1636931993 +SHA256 (duet-0.2.3.tar.gz) = 256d79280c2ac771855cac1a979df0def555dc1b0bef678c5ce718b0cc16f220 +SIZE (duet-0.2.3.tar.gz) = 23365 diff --git a/net/py-duet/pkg-descr b/net/py-duet/pkg-descr new file mode 100644 index 000000000000..ed86162ca671 --- /dev/null +++ b/net/py-duet/pkg-descr @@ -0,0 +1,20 @@ +Duet takes inspiration from the amazing trio library and the structured +concurrency approach to async programming that it uses. However, duet differs +from trio in two major ways: +* Instead of a full-blown implementation of asynchronous IO, duet relies on the + Future interface for parallelism, and provides a way to run async/await + coroutines around those Futures. This is useful if you are using an API that + returns futures, such as RPC libraries like gRPC. The standard Future + interface does not implement __await__ directly, so Future instances must be + wrapped in duet.AwaitableFuture. + +* duet is re-entrant. At the top level, you run async code by calling + duet.run(foo). Inside foo suppose you call a function that has not yet been + fully refactored to be asynchronous, but itself calls duet.run(bar). Most + async libraries, including trio and asyncio, will raise an exception if you + try to "re-enter" the event loop in this way, but duet allows it. We have + found that this can simplify the process of refactoring code to be + asynchronous because you don't have to completely separate the sync and async + parts of your codebase all at once. + +WWW: https://github.com/google/duet