summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSharlatan Hellseher <sharlatanus@gmail.com>2025-07-23 21:55:08 +0100
committerSharlatan Hellseher <sharlatanus@gmail.com>2025-09-25 09:35:49 +0100
commitbb68040ae5cdd960486b6e37eb4cb16a25fdfd12 (patch)
tree4d07ba47ab1b508398de5498f76bd83cd2833353
parente6dbf583f74330b8ff519d223c95638a6253c064 (diff)
gnu: python-pyfakefs: Update to 5.9.1.
* gnu/packages/check.scm (python-pyfakefs): Update to 5.9.1. [source]: Switch to git-fetch, not GitHub repository provides proper releases and tests. <patches>: Drop it. [arguments] <test-backend>: Use 'custom. <test-flags>: Run all self tests without extra packages. <phases>: Add 'disable-root-tests. [build-system]: Use pyproject. [home-page]: Now pyproject.toml points to GitHub page as the main one, no reference to <http://pyfakefs.org/> in documentation was found. [native-inputs]: Remove python-pytest; add python-setuptools. * gnu/packages/patches/python-pyfakefs-remove-bad-test.patch: Remove file. * gnu/local.mk: Deregister patch. Change-Id: I4427d889019275b304ad021d8e5d0829bcff518a
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/check.scm55
-rw-r--r--gnu/packages/patches/python-pyfakefs-remove-bad-test.patch23
3 files changed, 28 insertions, 51 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 05df9fd12c..4fbca72354 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2160,7 +2160,6 @@ dist_patch_DATA = \
%D%/packages/patches/python-pep8-stdlib-tokenize-compat.patch \
%D%/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch \
%D%/packages/patches/python-pillow-CVE-2022-45199.patch \
- %D%/packages/patches/python-pyfakefs-remove-bad-test.patch \
%D%/packages/patches/python-libxml2-utf8.patch \
%D%/packages/patches/python-memcached-syntax-warnings.patch \
%D%/packages/patches/python-mox3-python3.6-compat.patch \
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index b8cfeb9f54..86328c88bc 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -3894,37 +3894,38 @@ grew out of the @dfn{Vc} project.")
(license license:bsd-3))))
(define-public python-pyfakefs
+ ;; TODO: Move to python-build.
(package
(name "python-pyfakefs")
- (version "4.6.3")
- (source (origin
- (method url-fetch)
- ;; We use the PyPI URL because there is no proper release
- ;; available from GitHub. The GitHub project only provides
- ;; autogenerated tarballs, which are known to change in place.
- (uri (pypi-uri "pyfakefs" version))
- (sha256
- (base32
- "18bcv8yalg80zgigx40fk692yr3wf9ch1hkb0cdplqspyry2mwbd"))
- (patches (search-patches
- "python-pyfakefs-remove-bad-test.patch"))
- (file-name (string-append name "-" version ".tar.gz"))))
+ (version "5.9.1")
+ (source
+ (origin
+ (method git-fetch) ;no tets in PyPI archive
+ (uri (git-reference
+ (url "https://github.com/pytest-dev/pyfakefs")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0xdq8fgbqrrnhwbgklwfngmpzgna2frr9vc318vy1rb0vhsmzvjk"))))
+ (build-system pyproject-build-system)
(arguments
- `(#:phases
- (modify-phases %standard-phases
- ;; The default test suite does not run these extra tests.
- (add-after 'check 'check-pytest-plugin
- (lambda _
- (invoke
- "python" "-m" "pytest"
- "pyfakefs/pytest_tests/pytest_plugin_test.py"))))))
+ (list
+ #:test-backend #~'custom
+ ;; Ran 2699 tests; 1177 skipped, 2 expected failures
+ #:test-flags
+ #~(list "-m" "pyfakefs.tests.all_tests_without_extra_packages")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'disable-root-tests
+ (lambda _
+ (substitute* "pyfakefs/tests/fake_filesystem_test.py"
+ (("def test_expand_root")
+ "def __off_test_expand_root")))))))
+ ;; As it would be imported by many through python-importlib-metadata, keep
+ ;; dependencies on bare minimal.
(native-inputs
- (list python-pytest))
- (build-system python-build-system)
- ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
- ;; page, but the pyfakefs documentation asks us to use this specific URL
- ;; when linking to the project. Honor their request.
- (home-page "http://pyfakefs.org/")
+ (list python-setuptools))
+ (home-page "https://github.com/pytest-dev/pyfakefs")
;; TRANSLATORS: In the synopsis, "Mock" is a verb.
(synopsis "Mock file system interactions in tests")
(description
diff --git a/gnu/packages/patches/python-pyfakefs-remove-bad-test.patch b/gnu/packages/patches/python-pyfakefs-remove-bad-test.patch
deleted file mode 100644
index a9488bbe43..0000000000
--- a/gnu/packages/patches/python-pyfakefs-remove-bad-test.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-This test incorrectly assumes that the root user is always available.
-However, in the build environment, the root user is not available.
-Note that because the original file distributed in the release on PyPi
-has lines ending in CRLF, those are retained in the diff below.
-
---- a/pyfakefs/tests/fake_filesystem_test.py 1969-12-31 16:00:00.000000000 -0800
-+++ b/pyfakefs/tests/fake_filesystem_test.py 1969-12-31 16:00:00.000000000 -0800
-@@ -1021,15 +1021,6 @@
- self.assertEqual(self.path.expanduser('~'),
- self.os.environ['HOME'].replace('/', '!'))
-
-- @unittest.skipIf(TestCase.is_windows or TestCase.is_cygwin,
-- 'only tested on unix systems')
-- def test_expand_root(self):
-- if sys.platform == 'darwin':
-- roothome = '!var!root'
-- else:
-- roothome = '!root'
-- self.assertEqual(self.path.expanduser('~root'), roothome)
--
- def test_getsize_path_nonexistent(self):
- file_path = 'foo!bar!baz'
- self.assertRaises(os.error, self.path.getsize, file_path)