guix_mirror_bot pushed a commit to branch python-team in repository guix. commit 24671f06e27453e44d84d9ed02efc46746991007 Author: Sharlatan Hellseher <sharlata...@gmail.com> AuthorDate: Wed Jul 23 21:55:08 2025 +0100
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 --- gnu/local.mk | 1 - gnu/packages/check.scm | 55 +++++++++++----------- .../patches/python-pyfakefs-remove-bad-test.patch | 23 --------- 3 files changed, 28 insertions(+), 51 deletions(-) diff --git a/gnu/local.mk b/gnu/local.mk index 134dfcdc11..27d8f3f352 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2166,7 +2166,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 a555ddcabe..026f5e0ef5 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -3917,37 +3917,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)