Skip to content

Run CI tests on Python 3.13, fix tests #2673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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