Fix compatibility with Python 3.13
Resolves: rhbz#2251781
This commit is contained in:
parent
aade1f853b
commit
d83676642c
60
py3.13.patch
Normal file
60
py3.13.patch
Normal file
@ -0,0 +1,60 @@
|
||||
From 11c30f6c69c4516b406c1c62f472d37898c58b93 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
||||
Date: Mon, 4 Dec 2023 14:26:52 +0100
|
||||
Subject: [PATCH] Run CI tests on Python 3.13, fix tests (#2673)
|
||||
|
||||
---
|
||||
docs/changelog/2673.feature.rst | 1 +
|
||||
tests/unit/create/test_creator.py | 6 +++++-
|
||||
tests/unit/create/via_global_ref/builtin/testing/path.py | 6 +++++-
|
||||
3 files changed, 11 insertions(+), 2 deletions(-)
|
||||
create mode 100644 docs/changelog/2673.feature.rst
|
||||
|
||||
diff --git a/docs/changelog/2673.feature.rst b/docs/changelog/2673.feature.rst
|
||||
new file mode 100644
|
||||
index 0000000..0adf4a0
|
||||
--- /dev/null
|
||||
+++ b/docs/changelog/2673.feature.rst
|
||||
@@ -0,0 +1 @@
|
||||
+The tests now pass on the CI with Python 3.13.0a2 - by :user:`hroncok`.
|
||||
diff --git a/tests/unit/create/test_creator.py b/tests/unit/create/test_creator.py
|
||||
index 8b9d688..fc21ad8 100644
|
||||
--- a/tests/unit/create/test_creator.py
|
||||
+++ b/tests/unit/create/test_creator.py
|
||||
@@ -231,7 +231,11 @@ def test_create_no_seed(python, creator, isolated, system, coverage_env, special
|
||||
assert os.path.exists(make_file)
|
||||
|
||||
git_ignore = (dest / ".gitignore").read_text(encoding="utf-8")
|
||||
- assert git_ignore.splitlines() == ["# created by virtualenv automatically", "*"]
|
||||
+ if creator_key == "venv" and sys.version_info >= (3, 13):
|
||||
+ comment = "# Created by venv; see https://docs.python.org/3/library/venv.html"
|
||||
+ else:
|
||||
+ comment = "# created by virtualenv automatically"
|
||||
+ assert git_ignore.splitlines() == [comment, "*"]
|
||||
|
||||
|
||||
def test_create_vcs_ignore_exists(tmp_path):
|
||||
diff --git a/tests/unit/create/via_global_ref/builtin/testing/path.py b/tests/unit/create/via_global_ref/builtin/testing/path.py
|
||||
index b2e1b85..d833de6 100644
|
||||
--- a/tests/unit/create/via_global_ref/builtin/testing/path.py
|
||||
+++ b/tests/unit/create/via_global_ref/builtin/testing/path.py
|
||||
@@ -44,11 +44,15 @@ class PathMockABC(FakeDataABC, Path):
|
||||
"""Mocks the behavior of `Path`"""
|
||||
|
||||
_flavour = getattr(Path(), "_flavour", None)
|
||||
-
|
||||
if hasattr(_flavour, "altsep"):
|
||||
# Allows to pass some tests for Windows via PosixPath.
|
||||
_flavour.altsep = _flavour.altsep or "\\"
|
||||
|
||||
+ # Python 3.13 renamed _flavour to pathmod
|
||||
+ pathmod = getattr(Path(), "pathmod", None)
|
||||
+ if hasattr(pathmod, "altsep"):
|
||||
+ pathmod.altsep = pathmod.altsep or "\\"
|
||||
+
|
||||
def exists(self):
|
||||
return self.is_file() or self.is_dir()
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
@ -1,6 +1,6 @@
|
||||
Name: python-virtualenv
|
||||
Version: 20.21.1
|
||||
Release: 6%{?dist}
|
||||
Release: 7%{?dist}
|
||||
Summary: Tool to create isolated Python environments
|
||||
|
||||
License: MIT
|
||||
@ -24,6 +24,9 @@ Patch3: 3.12-support-and-no-setuptools-wheel-on-3.12-2558.patch
|
||||
# (20.24.0) Fix tests with pluggy 1.2.0+
|
||||
# Manually cherry-picked from https://github.com/pypa/virtualenv/pull/2593
|
||||
Patch4: Fix-tests-with-pluggy-1.2.0.patch
|
||||
# Fix compatibility with Python 3.13
|
||||
# https://github.com/pypa/virtualenv/pull/2673
|
||||
Patch5: py3.13.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
@ -159,6 +162,10 @@ PIP_CERT=/etc/pki/tls/certs/ca-bundle.crt \
|
||||
%{_bindir}/virtualenv
|
||||
|
||||
%changelog
|
||||
* Mon Dec 04 2023 Lumír Balhar <lbalhar@redhat.com> - 20.21.1-7
|
||||
- Fix compatibility with Python 3.13
|
||||
Resolves: rhbz#2251781
|
||||
|
||||
* Thu Nov 23 2023 Lumír Balhar <lbalhar@redhat.com> - 20.21.1-6
|
||||
- Allow platformdirs version 4
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user