Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <bsd.port.mk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
TIMESTAMP = 1686987050 | ||
SHA256 (time_machine-2.10.0.tar.gz) = 64fd89678cf589fc5554c311417128b2782222dd65f703bf248ef41541761da0 | ||
SIZE (time_machine-2.10.0.tar.gz) = 28249 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |