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
This commit is contained in:
Sharlatan Hellseher 2025-07-23 21:55:08 +01:00
parent e6dbf583f7
commit bb68040ae5
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5
3 changed files with 28 additions and 51 deletions

View file

@ -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 \

View file

@ -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

View file

@ -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)