From 9815657e797620996d1276790e3762e4833e9851 Mon Sep 17 00:00:00 2001 From: Po-Chuan Hsieh Date: Sun, 31 Mar 2024 11:05:06 +0800 Subject: [PATCH] devel/py-pyfakefs: Add py-pyfakefs 5.3.5 pyfakefs implements a fake file system that mocks the Python file system modules. Using pyfakefs, your tests operate on a fake file system in memory without touching the real disk. The software under test requires no modification to work with pyfakefs. Pyfakefs creates a new empty in-memory file system at each test start, which replaces the real filesystem during the test. Think of pyfakefs as making a per-test temporary directory, except for an entire file system. There are several means to achieve this: by using the fs fixture if running pytest, by using fake_filesystem_unittest.TestCase as a base class if using unittest, by using a fake_filesystem_unittest.Patcher instance as a context manager, or by using the patchfs decorator. --- devel/Makefile | 1 + devel/py-pyfakefs/Makefile | 24 ++++++++++++++++++++++++ devel/py-pyfakefs/distinfo | 3 +++ devel/py-pyfakefs/pkg-descr | 13 +++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 devel/py-pyfakefs/Makefile create mode 100644 devel/py-pyfakefs/distinfo create mode 100644 devel/py-pyfakefs/pkg-descr diff --git a/devel/Makefile b/devel/Makefile index d7e485d6c5d5b..e67c8ff1f6054 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -5350,6 +5350,7 @@ SUBDIR += py-pyee SUBDIR += py-pyelftools SUBDIR += py-pyface + SUBDIR += py-pyfakefs SUBDIR += py-pyfcm SUBDIR += py-pyflakes SUBDIR += py-pyformance diff --git a/devel/py-pyfakefs/Makefile b/devel/py-pyfakefs/Makefile new file mode 100644 index 0000000000000..15bb37b14aca3 --- /dev/null +++ b/devel/py-pyfakefs/Makefile @@ -0,0 +1,24 @@ +PORTNAME= pyfakefs +PORTVERSION= 5.3.5 +CATEGORIES= devel python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Implement a fake file system that mocks the Python file system modules +WWW= https://pytest-pyfakefs.readthedocs.io/en/stable/ \ + https://github.com/jmcgeheeiv/pyfakefs + +LICENSE= APACHE20 +LICENSE_FILE= ${WRKSRC}/COPYING + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR} +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}undefined>=0:devel/py-undefined@${PY_FLAVOR} + +USES= python +USE_PYTHON= autoplist concurrent pep517 pytest + +NO_ARCH= yes + +.include diff --git a/devel/py-pyfakefs/distinfo b/devel/py-pyfakefs/distinfo new file mode 100644 index 0000000000000..d22cb346ed937 --- /dev/null +++ b/devel/py-pyfakefs/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1710603292 +SHA256 (pyfakefs-5.3.5.tar.gz) = 7cdc500b35a214cb7a614e1940543acc6650e69a94ac76e30f33c9373bd9cf90 +SIZE (pyfakefs-5.3.5.tar.gz) = 196773 diff --git a/devel/py-pyfakefs/pkg-descr b/devel/py-pyfakefs/pkg-descr new file mode 100644 index 0000000000000..4e82fbb5cd45c --- /dev/null +++ b/devel/py-pyfakefs/pkg-descr @@ -0,0 +1,13 @@ +pyfakefs implements a fake file system that mocks the Python file system +modules. Using pyfakefs, your tests operate on a fake file system in memory +without touching the real disk. The software under test requires no modification +to work with pyfakefs. + +Pyfakefs creates a new empty in-memory file system at each test start, which +replaces the real filesystem during the test. Think of pyfakefs as making a +per-test temporary directory, except for an entire file system. + +There are several means to achieve this: by using the fs fixture if running +pytest, by using fake_filesystem_unittest.TestCase as a base class if using +unittest, by using a fake_filesystem_unittest.Patcher instance as a context +manager, or by using the patchfs decorator.