Skip to content

Commit

Permalink
Run CI tests on Python 3.13, fix tests (#2673)
Browse files Browse the repository at this point in the history
  • Loading branch information
hroncok authored Nov 30, 2023
1 parent 5be4b5d commit f56fb61
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
fail-fast: false
matrix:
py:
- "3.12.0-rc.2"
- "3.13.0-alpha.2"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/2673.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The tests now pass on the CI with Python 3.13.0a2 - by :user:`hroncok`.
5 changes: 5 additions & 0 deletions src/virtualenv/seed/wheels/embed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
"setuptools": "setuptools-69.0.2-py3-none-any.whl",
"wheel": "wheel-0.42.0-py3-none-any.whl",
},
"3.13": {
"pip": "pip-23.3.1-py3-none-any.whl",
"setuptools": "setuptools-69.0.2-py3-none-any.whl",
"wheel": "wheel-0.42.0-py3-none-any.whl",
},
}
MAX = "3.7"

Expand Down
6 changes: 5 additions & 1 deletion tests/unit/create/test_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ def list_to_str(iterable):
assert result == "None"

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):
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/create/via_global_ref/builtin/testing/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,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()

Expand Down

0 comments on commit f56fb61

Please sign in to comment.