#4 Backport patch and skip test to make package build with Python 3.12
Merged 10 months ago by churchyard. Opened a year ago by thrnciar.
rpms/ thrnciar/python-fs python3.12  into  rawhide

file added
+25
@@ -0,0 +1,25 @@ 

+ From f6f260f97df29500a531baf1b370c3e4e4f3dc76 Mon Sep 17 00:00:00 2001

+ From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>

+ Date: Thu, 23 Mar 2023 13:23:12 +0100

+ Subject: [PATCH] Replace TestCase method aliases removed in Python 3.12

+ 

+ Fixes: #568

+ ---

+  CHANGELOG.md    | 2 ++

+  CONTRIBUTORS.md | 1 +

+  fs/test.py      | 2 +-

+  3 files changed, 4 insertions(+), 1 deletion(-)

+ 

+ diff --git a/fs/test.py b/fs/test.py

+ index 32e6ea5c..9bfe811d 100644

+ --- a/fs/test.py

+ +++ b/fs/test.py

+ @@ -1082,7 +1082,7 @@ def test_remove(self):

+          self.fs.makedirs("foo/bar/baz/")

+  

+          error_msg = "resource 'foo/bar/egg/test.txt' not found"

+ -        assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)

+ +        assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegex)

+          with assertRaisesRegex(errors.ResourceNotFound, error_msg):

+              self.fs.remove("foo/bar/egg/test.txt")

+  

file modified
+8 -1
@@ -12,6 +12,11 @@ 

  URL:            https://pypi.org/project/fs/

  Source0:        https://github.com/PyFilesystem/pyfilesystem2/archive/v%{version}/%{srcname}-%{version}.tar.gz

  

+ # Replace TestCase method aliases removed in Python 3.12

+ # https://github.com/PyFilesystem/pyfilesystem2/pull/570

+ # changelog fragment removed to avoid conflict

+ Patch:          570.patch

+ 

  BuildArch:      noarch

  BuildRequires:  python3-devel

  BuildRequires:  python3-setuptools
@@ -49,7 +54,9 @@ 

  %if %{with tests}

  %check

  # tests/test_ftpfs.py needs pyftpdlib (not packaged yet)

- %{python3} -m pytest --ignore tests/test_ftpfs.py

+ # test_seek_current and test_seek_end are skipped due to regression in Python 3.12

+ # upstream issue: https://github.com/python/cpython/issues/102956

+ %{python3} -m pytest --ignore tests/test_ftpfs.py -k "not test_seek_current and not test_seek_end"

  %endif

  

  %files -n python3-%{srcname}

Marking as [WIP], there is no need to merge this right now.

rebased onto 778a956

a year ago

rebased onto d1138e0

11 months ago

I am removing [WIP] since Python mass-rebuild is almost here. A review would be appreciated.

Looks good.

Fedora CI fails with:

error: line 4: Unknown tag: %bcond tests 0

This was not introduced here.

Merging as a provenpackager, we are starting the Python 3.12 side tag rebuild this week.

Pull-Request has been merged by churchyard

10 months ago
Metadata