#127 Update a test regex to work with Python 3.12+
Merged 11 months ago by churchyard. Opened 11 months ago by churchyard.
rpms/ churchyard/python-tox python3.12  into  rawhide

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

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

+ From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>

+ Date: Mon, 17 Jul 2023 11:35:38 +0200

+ Subject: [PATCH] Update a test regex to work with Python 3.12+

+ 

+ Fixes https://github.com/tox-dev/tox/issues/3065

+ 

+ New message:

+ 

+     "argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'type'"

+ ---

+  docs/changelog/3065.bugfix.rst            | 1 +

+  tests/config/loader/test_memory_loader.py | 2 +-

+  2 files changed, 2 insertions(+), 1 deletion(-)

+  create mode 100644 docs/changelog/3065.bugfix.rst

+ 

+ diff --git a/docs/changelog/3065.bugfix.rst b/docs/changelog/3065.bugfix.rst

+ new file mode 100644

+ index 000000000..774b33b24

+ --- /dev/null

+ +++ b/docs/changelog/3065.bugfix.rst

+ @@ -0,0 +1 @@

+ +Update a regular expression in tests to match the exception message in both Python 3.12 and older.

+ diff --git a/tests/config/loader/test_memory_loader.py b/tests/config/loader/test_memory_loader.py

+ index 6f645540e..8ab7f8f62 100644

+ --- a/tests/config/loader/test_memory_loader.py

+ +++ b/tests/config/loader/test_memory_loader.py

+ @@ -66,7 +66,7 @@ def test_memory_loader(value: Any, of_type: type[Any], outcome: Any) -> None:

+          (["m"], List[int], ValueError, "invalid literal for int"),

+          ({"m": 1}, Dict[int, int], ValueError, "invalid literal for int"),

+          ({1: "m"}, Dict[int, int], ValueError, "invalid literal for int"),

+ -        (object, Path, TypeError, "expected str, bytes or os.PathLike object"),

+ +        (object, Path, TypeError, r"str(, bytes)? or (an )?os\.PathLike object"),

+          (1, Command, TypeError, "1"),

+          (1, EnvList, TypeError, "1"),

+      ],

file modified
+4 -1
@@ -30,7 +30,10 @@ 

  # Remove dependency on devpi-process.

  # Remove coverage-related dependencies.

  # Adjust virtualenv environment variables to make it work with our patched virtualenv.

- Patch:          fix-tests.patch

+ Patch1:         fix-tests.patch

+ 

+ # Update a test regex to work with Python 3.12+

+ Patch2:         https://github.com/tox-dev/tox/pull/3066.patch

  

  BuildArch:      noarch

  

@@ -50,14 +50,14 @@ 

  

  # Get all packages that supplement tox,

  # no repo explicitly specified means we use the enabled repos on the CI system which should be what we want

- repoquery_result = subprocess.check_output(['dnf', 'repoquery', '--whatsupplements', 'tox'], text=True)

+ repoquery_result = subprocess.check_output(['dnf-3', 'repoquery', '--whatsupplements', 'tox'], text=True)

  supplementing_pkgs = set(repoquery_result.splitlines())

  

  

  # It gets quite tricky, since packages like "pypy" can supplement tox, we get a set of provides for all of them

  supplementing_pkgs_provides = {}

  for nvra in supplementing_pkgs:

-     repoquery_result = subprocess.check_output(['dnf', '-q', 'repoquery', '--provides', nvra], text=True)

+     repoquery_result = subprocess.check_output(['dnf-3', '-q', 'repoquery', '--provides', nvra], text=True)

      provides = set(repoquery_result.splitlines())

      unversioned_provides = {provide.split(' ')[0] for provide in provides}

      supplementing_pkgs_provides[nvra.rsplit('-', 2)[0]] = unversioned_provides

file modified
+1 -1
@@ -89,7 +89,7 @@ 

      - python2-devel

      - pypy3.9-devel

      - python3-tox

-     - dnf

+     - python3-dnf

      - mock

      - rpmdevtools

      - rpm-build

no initial comment

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/b98ce22c663e4e68907aa110b046136a

1 new commit added

  • Enumerate patches to workaround CI's old RPM version
11 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/2bd7e44871d841fb96fdb74ae2f1c35b

1 new commit added

  • Use dnf-3 on the CI to workaround https://bugzilla.redhat.com/2223347
11 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/44b9cb7b363e47a494fdf2987e01ceef

Pull-Request has been merged by churchyard

11 months ago