Skip to content

Commit f56fb61

Browse files
authored
Run CI tests on Python 3.13, fix tests (#2673)
1 parent 5be4b5d commit f56fb61

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

.github/workflows/check.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
py:
22-
- "3.12.0-rc.2"
22+
- "3.13.0-alpha.2"
23+
- "3.12"
2324
- "3.11"
2425
- "3.10"
2526
- "3.9"

docs/changelog/2673.feature.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The tests now pass on the CI with Python 3.13.0a2 - by :user:`hroncok`.

src/virtualenv/seed/wheels/embed/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
"setuptools": "setuptools-69.0.2-py3-none-any.whl",
3737
"wheel": "wheel-0.42.0-py3-none-any.whl",
3838
},
39+
"3.13": {
40+
"pip": "pip-23.3.1-py3-none-any.whl",
41+
"setuptools": "setuptools-69.0.2-py3-none-any.whl",
42+
"wheel": "wheel-0.42.0-py3-none-any.whl",
43+
},
3944
}
4045
MAX = "3.7"
4146

tests/unit/create/test_creator.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,11 @@ def list_to_str(iterable):
217217
assert result == "None"
218218

219219
git_ignore = (dest / ".gitignore").read_text(encoding="utf-8")
220-
assert git_ignore.splitlines() == ["# created by virtualenv automatically", "*"]
220+
if creator_key == "venv" and sys.version_info >= (3, 13):
221+
comment = "# Created by venv; see https://docs.python.org/3/library/venv.html"
222+
else:
223+
comment = "# created by virtualenv automatically"
224+
assert git_ignore.splitlines() == [comment, "*"]
221225

222226

223227
def test_create_vcs_ignore_exists(tmp_path):

tests/unit/create/via_global_ref/builtin/testing/path.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,15 @@ class PathMockABC(FakeDataABC, Path):
4747
"""Mocks the behavior of `Path`"""
4848

4949
_flavour = getattr(Path(), "_flavour", None)
50-
5150
if hasattr(_flavour, "altsep"):
5251
# Allows to pass some tests for Windows via PosixPath.
5352
_flavour.altsep = _flavour.altsep or "\\"
5453

54+
# Python 3.13 renamed _flavour to pathmod
55+
pathmod = getattr(Path(), "pathmod", None)
56+
if hasattr(pathmod, "altsep"):
57+
pathmod.altsep = pathmod.altsep or "\\"
58+
5559
def exists(self):
5660
return self.is_file() or self.is_dir()
5761

0 commit comments

Comments
 (0)