From nobody Sat Jun 17 08:19:53 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 4QjpqF5CS9z4fN0j; Sat, 17 Jun 2023 08:19:53 +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 4QjpqF4mdxz4QNT; Sat, 17 Jun 2023 08:19:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686989993; 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=lQNR9tvBVaI+tGPQsIX0YDBXx+PXvP+2FOeF3PBEuvc=; b=Ifr9agPjAGMn6Vc5NjD8w8c9R9qGfA3qjlbb0iIf7hvgow0I7txV5+YlFL96UBgHfGhTZm oigHYpVa5YcBXX9wHwxA47lY/U/R0adSArLVGwnSVwP/Qjw6GoVxJ/VhrMrXvIM3PFWUVE vfvzrICtYpBmsKPWsljHSGKmaSVvAOc+JVGVhuNOqpiMubJZvjid+BdgAK+N4fc2fPw5nm 0DYWEl/5N4zxqpwpRFGq2ZlPiLPWXitKUzjD9FL05aTWohglWKUay2+tD4Hz+w1VMtm9uW yfwU9rGgg9AXXiSMbD630QvOwrB9D9KBCOyjpVsNa+l96c3iATKp9UhndLMpcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686989993; 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=lQNR9tvBVaI+tGPQsIX0YDBXx+PXvP+2FOeF3PBEuvc=; b=VkxlMHQMfllbHsuvujrmqs1lzZSsdBWy4MmGRK2YvYB9MoQzPNVcknGP7NJ3aZLgov+IRo YU/FP8lK9alfBWxJC757HTmNiXBRC/CvosresVfyIPCMAi6klnBMkh0xQB9lREO+yXjk8Q hWaWXjxch+P3QiCL3z2woyX+AV+PU8OjRsBTGvxssdR3w3CQrjP0cMH1kJOb45eAXvoM9B lI5GQMwLrjV2EynYka2ifOf4QAcZfQzgmGEuZanazv+lhARrNG/n+cM2sVhyIXcfezkfZi iXnK+YNjebgTl8sMvI0JInbH1xbcDQJ7yVVwRWgrBKrCFvdoaeID0zeBrL/3iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686989993; a=rsa-sha256; cv=none; b=ZnzI9bw39ay0vupeZjFWuF2cLlHHaYeEFlJymOBf3YE7FmRXub16SCh2AemwaHQQ1GIwIU 0TOPAjC07wfkliW96AyCT2Jbobkw33wh7wsbWLktPU3Pv0CkK4YsmV6x9Q+2oSnAT8XbwX RI+VXuczvkXX66zJoRwQKy2eLK++E9QQ29sUy/tA7EMq10UvtfJANx6clpWgfZxA0KFB0V Hh3OU7I25sf2VUR5Iysx/cc35zLNIJyDXEMTsj3HnacDJaVAmX8NlyNfqpcIZzECJ4S/Hr J645IhRyrDEdirE4btK3x41W2txjtJ/Z5ru2psN34RIVISE5SnVbHNieZdNNsA== 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 4QjpqF3rvmz12r5; Sat, 17 Jun 2023 08:19:53 +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 35H8Jrmd009953; Sat, 17 Jun 2023 08:19:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35H8Jrhh009952; Sat, 17 Jun 2023 08:19:53 GMT (envelope-from git) Date: Sat, 17 Jun 2023 08:19:53 GMT Message-Id: <202306170819.35H8Jrhh009952@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Nicola Vitale Subject: git: aadc486bfec5 - main - devel/py-time-machine: Add 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: nivit X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aadc486bfec59c7d720d107f6758a4684c834236 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by nivit: URL: https://cgit.FreeBSD.org/ports/commit/?id=aadc486bfec59c7d720d107f6758a4684c834236 commit aadc486bfec59c7d720d107f6758a4684c834236 Author: Nicola Vitale AuthorDate: 2023-06-17 08:17:31 +0000 Commit: Nicola Vitale CommitDate: 2023-06-17 08:19:46 +0000 devel/py-time-machine: Add new port time-machine, is intended to combine the advantages of freezegun and libfaketime Python modules. It works without LD_PRELOAD but still mocks the standard library functions everywhere they may be referenced. It does so by modifying the built-in functions at the C level, to point them through wrappers that return different values when mocking. Normally in Python, built-in functions are immutable, but time-machine overcomes this by using C code to replace their function pointers. https://github.com/adamchainz/time-machine --- devel/Makefile | 1 + devel/py-time-machine/Makefile | 26 ++++++++++++++++++++++++++ devel/py-time-machine/distinfo | 3 +++ devel/py-time-machine/pkg-descr | 7 +++++++ 4 files changed, 37 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index a4827cd8881d..0d96c802863f 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -5605,6 +5605,7 @@ SUBDIR += py-thrift SUBDIR += py-thriftpy2 SUBDIR += py-tiamat + SUBDIR += py-time-machine SUBDIR += py-timelib SUBDIR += py-timeout-decorator SUBDIR += py-tinyarray diff --git a/devel/py-time-machine/Makefile b/devel/py-time-machine/Makefile new file mode 100644 index 000000000000..b18e41043a7e --- /dev/null +++ b/devel/py-time-machine/Makefile @@ -0,0 +1,26 @@ +PORTNAME= time-machine +DISTVERSION= 2.10.0 +CATEGORIES= devel python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} +DISTNAME= ${PORTNAME:S/-/_/1}-${PORTVERSION} + +MAINTAINER= nivit@FreeBSD.org +COMMENT= Travel through time in your Python tests +WWW= https://github.com/adamchainz/time-machine + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=63.1.0:devel/py-setuptools@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}wheel>=0.40.0:devel/py-wheel@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}dateutil>=2.8.2:devel/py-dateutil@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}six>=1.5:devel/py-six@${PY_FLAVOR} + +USES= python +USE_PYTHON= autoplist pep517 + +post-install: + ${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/_time_machine${PYTHON_EXT_SUFFIX}.so + +.include diff --git a/devel/py-time-machine/distinfo b/devel/py-time-machine/distinfo new file mode 100644 index 000000000000..96ce92f2851e --- /dev/null +++ b/devel/py-time-machine/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1686987050 +SHA256 (time_machine-2.10.0.tar.gz) = 64fd89678cf589fc5554c311417128b2782222dd65f703bf248ef41541761da0 +SIZE (time_machine-2.10.0.tar.gz) = 28249 diff --git a/devel/py-time-machine/pkg-descr b/devel/py-time-machine/pkg-descr new file mode 100644 index 000000000000..f4b7e989294f --- /dev/null +++ b/devel/py-time-machine/pkg-descr @@ -0,0 +1,7 @@ +time-machine is intended to combine the advantages of freezegun and libfaketime +Python modules. It works without LD_PRELOAD but still mocks the standard +library functions everywhere they may be referenced. It does so by modifying +the built-in functions at the C level, to point them through wrappers that +return different values when mocking. Normally in Python, built-in functions +are immutable, but time-machine overcomes this by using C code to replace their +function pointers.