From nobody Wed May 10 14:59:00 2023 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 4QGdTJ6KHfz4B17M; Wed, 10 May 2023 14:59:00 +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 4QGdTJ5jbgz3wDT; Wed, 10 May 2023 14:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683730740; 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=+6VVreh93DatUeoRheBjP8IVVcnhQOdy1Qpzb58K1uM=; b=inBIUEtDCXcoDZabQ88+3qobuxNnIVNjXZ2XApW/Qe9S5Gbd168HHrAXKLuTIoZmw21GF5 fkEY6xSB8ZQwa+GTg1w4uFuWAOI/+PPK5yoR9wMSCy9cmSNc+7ZjlOpnXQWCbK+IPhz0GY em/LVKKnBqlKhnZrrYmkk3PZWhOpMnHTCLSazQgywDBVeQcSgaQuwjFlNZmp3FTgSuHgGt 4JsIm4sbXq6FL8PU7FEqkSzn/go7s4t5RofyyO26B2l3WkStiLnTP8S+xU/pVjp6Ymqu64 IQ2EF9oCGaXHuXI/SigobhfyuLEaI+C8KsFqwJ4qqza+XnjaiE42qxBsUfeZFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683730740; 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=+6VVreh93DatUeoRheBjP8IVVcnhQOdy1Qpzb58K1uM=; b=lWYt/viuCSTrsw8XparJSTN3KPlcjkg7v7j7BXcEfNcBlZ4G1tGtdXEtZF0xi/7ZPryrl7 UCJ27d/yl3MwnmBhany89KAlJ9/OMR+91/1va68qbQVNWRvSScKibXnlKUfqnBsr8v86n8 ll90JAlwTKf0OD0IUoQg21yAOkIPkcoeHio01/FpKuDjpCuhtamKkerL44XZoCPDQzFZbP hUjXF2oLDgTkVZ/SGTN6N7sKggFGaxSVrKyYM/PJfGasAl/yMFYNSN/RNz22VCdSrTz3gP 1p3oLmGKL8PrjT7klFkfgc+oedfAOg/7Q7DF+0wwD+bZ6Lq5sw4Yq97z62LhNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683730740; a=rsa-sha256; cv=none; b=oonyb1ojYIodM92M61kvBs9j0COnuT9x2/9b7B3ho1EMBwr0HFiZT7Z/WmYIJnc8hiiXxl JlyXf6XESzFMM/D2nun1ZDnN+erUQF/6dSOpVeTuN/MZOfLLhNKTEWyilbBLnq3e20pV6Y 7+PP7Pgq1bt7JyH4Fb2uaKi4DAGAebgh/oI3CPnxtKBVtGc9wPGjZZwJrpTx7U6TK7QK/T WWp8EaFGlwP4/NrbsgW0F20zJ2/WhXfHfhKIuP1h5SCmWBYBF9ieJgFTu2Ide5CVt4p2R2 S8TxYx7FmQRaglLj1Scza8Z8o1YMV8Pk6iYgsQty5IV0HlnvwX6+W/4901rppA== 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 4QGdTJ4m8PzFm5; Wed, 10 May 2023 14:59:00 +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 34AEx08X036927; Wed, 10 May 2023 14:59:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34AEx0MI036926; Wed, 10 May 2023 14:59:00 GMT (envelope-from git) Date: Wed, 10 May 2023 14:59:00 GMT Message-Id: <202305101459.34AEx0MI036926@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dan Langille Subject: git: e1fbe719d425 - main - devel/py-celery-singleton: New port 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: dvl X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e1fbe719d4258ee0106c22dc5a4189cf050148c4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dvl: URL: https://cgit.FreeBSD.org/ports/commit/?id=e1fbe719d4258ee0106c22dc5a4189cf050148c4 commit e1fbe719d4258ee0106c22dc5a4189cf050148c4 Author: Dan Langille AuthorDate: 2023-05-10 14:57:16 +0000 Commit: Dan Langille CommitDate: 2023-05-10 14:58:56 +0000 devel/py-celery-singleton: New port Prevent duplicate celery tasks. --- devel/Makefile | 1 + devel/py-celery-singleton/Makefile | 20 ++++++++++++++++++++ devel/py-celery-singleton/Makefile.new | 21 +++++++++++++++++++++ devel/py-celery-singleton/distinfo | 3 +++ devel/py-celery-singleton/pkg-descr | 22 ++++++++++++++++++++++ 5 files changed, 67 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index 3c943afce144..1195b1661e86 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -4402,6 +4402,7 @@ SUBDIR += py-cdg SUBDIR += py-celery SUBDIR += py-celery-progress + SUBDIR += py-celery-singleton SUBDIR += py-cerberus SUBDIR += py-certsrv SUBDIR += py-cffi diff --git a/devel/py-celery-singleton/Makefile b/devel/py-celery-singleton/Makefile new file mode 100644 index 000000000000..1db65012b67e --- /dev/null +++ b/devel/py-celery-singleton/Makefile @@ -0,0 +1,20 @@ +PORTNAME= celery-singleton +PORTVERSION= 0.3.1 +CATEGORIES= devel python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= dvl@FreeBSD.org +COMMENT= Prevent duplicate celery tasks +WWW= https://github.com/steinitzu/celery-singleton + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}redis>0:databases/py-redis@${PY_FLAVOR} + +USES= python:3.6+,run +USE_PYTHON= autoplist distutils +NO_ARCH= yes + +.include diff --git a/devel/py-celery-singleton/Makefile.new b/devel/py-celery-singleton/Makefile.new new file mode 100644 index 000000000000..4efec4571419 --- /dev/null +++ b/devel/py-celery-singleton/Makefile.new @@ -0,0 +1,21 @@ +PORTNAME= celery-singleton +PORTVERSION= 0.3.1 +PORTREVISION= 1 +CATEGORIES= devel python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= dvl@FreeBSD.org +COMMENT= Prevent duplicate celery tasks +WWW= https://github.com/steinitzu/celery-singleton + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}redis>0:databases/py-redis@${PY_FLAVOR} + +USES= python:3.6+,run +USE_PYTHON= autoplist distutils +NO_ARCH= yes + +.include diff --git a/devel/py-celery-singleton/distinfo b/devel/py-celery-singleton/distinfo new file mode 100644 index 000000000000..4d68b5c9b10d --- /dev/null +++ b/devel/py-celery-singleton/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1683049934 +SHA256 (celery-singleton-0.3.1.tar.gz) = 260ce4978e631f8682ea0ccb03d7f3b87d42bc20e04e9bd46ddb78a2f8035d1e +SIZE (celery-singleton-0.3.1.tar.gz) = 4659 diff --git a/devel/py-celery-singleton/pkg-descr b/devel/py-celery-singleton/pkg-descr new file mode 100644 index 000000000000..178c480c3288 --- /dev/null +++ b/devel/py-celery-singleton/pkg-descr @@ -0,0 +1,22 @@ +celery-singleton uses the JSON representation of a task's delay() or +apply_async() arguments to generate a unique lock and stores it in redis. By +default it uses the redis server of the celery result backend. If you use a +different/no result backend or want to use a different redis server for +celery-singleton, refer the configuration section for how to customize the +redis. + +import time +from celery_singleton import Singleton +from somewhere import celery_app + +@celery_app.task(base=Singleton) +def do_stuff(*args, **kwargs): + time.sleep(4) + return 'I just woke up' + +# run the task as normal +async_result = do_stuff.delay(1, 2, 3, a='b') +async_result2 = do_stuff.delay(1, 2, 3, a='b') + +# These are the same, task is only queued once +assert async_result == async_result2