From 2f5569cd7796ab3f7080d5d27bf769fd466b2e0d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 20:33:10 -0800 Subject: [PATCH 1/4] Bump pypa/gh-action-pypi-publish from 1.12.2 to 1.12.3 (#2813) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7c2e522d3..31a96ffe6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,6 +43,6 @@ jobs: name: ${{ env.dists-artifact-name }} path: dist/ - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.12.2 + uses: pypa/gh-action-pypi-publish@v1.12.3 with: attestations: true From baf2da4bad9d5f5d91ac130589024d0a40062d8b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 20:33:31 -0800 Subject: [PATCH 2/4] [pre-commit.ci] pre-commit autoupdate (#2810) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- src/virtualenv/util/path/_win.py | 8 ++++---- tests/unit/activation/conftest.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bc0373e30..47b76e025 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.29.4 + rev: 0.30.0 hooks: - id: check-github-workflows args: ["--verbose"] @@ -24,13 +24,13 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.8.0" + rev: "v0.8.3" hooks: - id: ruff-format - id: ruff args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"] - repo: https://github.com/rbubley/mirrors-prettier - rev: "v3.3.3" + rev: "v3.4.2" hooks: - id: prettier additional_dependencies: diff --git a/src/virtualenv/util/path/_win.py b/src/virtualenv/util/path/_win.py index aa67ca770..6404cda64 100644 --- a/src/virtualenv/util/path/_win.py +++ b/src/virtualenv/util/path/_win.py @@ -6,13 +6,13 @@ def get_short_path_name(long_name): import ctypes # noqa: PLC0415 from ctypes import wintypes # noqa: PLC0415 - _GetShortPathNameW = ctypes.windll.kernel32.GetShortPathNameW # noqa: N806 - _GetShortPathNameW.argtypes = [wintypes.LPCWSTR, wintypes.LPWSTR, wintypes.DWORD] - _GetShortPathNameW.restype = wintypes.DWORD + GetShortPathNameW = ctypes.windll.kernel32.GetShortPathNameW # noqa: N806 + GetShortPathNameW.argtypes = [wintypes.LPCWSTR, wintypes.LPWSTR, wintypes.DWORD] + GetShortPathNameW.restype = wintypes.DWORD output_buf_size = 0 while True: output_buf = ctypes.create_unicode_buffer(output_buf_size) - needed = _GetShortPathNameW(long_name, output_buf, output_buf_size) + needed = GetShortPathNameW(long_name, output_buf, output_buf_size) if output_buf_size >= needed: return output_buf.value output_buf_size = needed diff --git a/tests/unit/activation/conftest.py b/tests/unit/activation/conftest.py index e320038ea..2d53d540c 100644 --- a/tests/unit/activation/conftest.py +++ b/tests/unit/activation/conftest.py @@ -212,8 +212,8 @@ def __call__(self, monkeypatch, tmp_path): stderr=subprocess.PIPE, env=env, ) - _out, _err = process.communicate() - err = _err.decode("utf-8") + _out, err_ = process.communicate() + err = err_.decode("utf-8") assert process.returncode assert self.non_source_fail_message in err From eb8c7c3bc1ddde4e86d8da1f11e6df0dc615ddc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Thu, 2 Jan 2025 17:54:56 -0800 Subject: [PATCH 3/4] Skip tcsh tests on broken tcsh versions (#2817) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernát Gábor --- .pre-commit-config.yaml | 2 +- docs/changelog/2814.bugfix.rst | 1 + src/virtualenv/discovery/builtin.py | 4 ++-- tests/unit/activation/conftest.py | 2 +- tests/unit/activation/test_csh.py | 14 ++++++++++++++ tests/unit/seed/wheels/test_acquire.py | 3 ++- 6 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 docs/changelog/2814.bugfix.rst diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 47b76e025..60dc868ae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.8.3" + rev: "v0.8.5" hooks: - id: ruff-format - id: ruff diff --git a/docs/changelog/2814.bugfix.rst b/docs/changelog/2814.bugfix.rst new file mode 100644 index 000000000..9b85df2da --- /dev/null +++ b/docs/changelog/2814.bugfix.rst @@ -0,0 +1 @@ +Skip tcsh tests on broken tcsh versions - by :user:`gaborbernat`. diff --git a/src/virtualenv/discovery/builtin.py b/src/virtualenv/discovery/builtin.py index 00c595b46..4c20832af 100644 --- a/src/virtualenv/discovery/builtin.py +++ b/src/virtualenv/discovery/builtin.py @@ -5,7 +5,7 @@ import sys from contextlib import suppress from pathlib import Path -from typing import TYPE_CHECKING, Callable +from typing import TYPE_CHECKING from virtualenv.info import IS_WIN, fs_path_id @@ -15,7 +15,7 @@ if TYPE_CHECKING: from argparse import ArgumentParser - from collections.abc import Generator, Iterable, Mapping, Sequence + from collections.abc import Callable, Generator, Iterable, Mapping, Sequence from virtualenv.app_data.base import AppData LOGGER = logging.getLogger(__name__) diff --git a/tests/unit/activation/conftest.py b/tests/unit/activation/conftest.py index 2d53d540c..1c945436d 100644 --- a/tests/unit/activation/conftest.py +++ b/tests/unit/activation/conftest.py @@ -77,7 +77,7 @@ def __call__(self, monkeypatch, tmp_path): try: process = Popen(invoke, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env) raw_, _ = process.communicate() - raw = raw_.decode() + raw = raw_.decode(errors="replace") assert process.returncode == 0, raw except subprocess.CalledProcessError as exception: output = exception.output + exception.stderr diff --git a/tests/unit/activation/test_csh.py b/tests/unit/activation/test_csh.py index 309ae811e..125ba42d4 100644 --- a/tests/unit/activation/test_csh.py +++ b/tests/unit/activation/test_csh.py @@ -1,9 +1,23 @@ from __future__ import annotations +import sys +from shutil import which +from subprocess import check_output + +import pytest +from packaging.version import Version + from virtualenv.activation import CShellActivator def test_csh(activation_tester_class, activation_tester): + exe = f"tcsh{'.exe' if sys.platform == 'win32' else ''}" + if which(exe): + version_text = check_output([exe, "--version"], text=True, encoding="utf-8") + version = Version(version_text.split(" ")[1]) + if version >= Version("6.24.14"): + pytest.skip("https://github.com/tcsh-org/tcsh/issues/117") + class Csh(activation_tester_class): def __init__(self, session) -> None: super().__init__(CShellActivator, session, "csh", "activate.csh", "csh") diff --git a/tests/unit/seed/wheels/test_acquire.py b/tests/unit/seed/wheels/test_acquire.py index 20979775b..a56480fa0 100644 --- a/tests/unit/seed/wheels/test_acquire.py +++ b/tests/unit/seed/wheels/test_acquire.py @@ -5,7 +5,7 @@ from datetime import datetime, timezone from pathlib import Path from subprocess import CalledProcessError -from typing import TYPE_CHECKING, Callable +from typing import TYPE_CHECKING import pytest @@ -16,6 +16,7 @@ from virtualenv.seed.wheels.util import Wheel, discover_wheels if TYPE_CHECKING: + from collections.abc import Callable from unittest.mock import MagicMock from pytest_mock import MockerFixture From 25f561510d9500d4fd6c19b58d9a79e97f8687f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Thu, 2 Jan 2025 17:55:54 -0800 Subject: [PATCH 4/4] release 20.28.1 --- docs/changelog.rst | 7 +++++++ docs/changelog/2814.bugfix.rst | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) delete mode 100644 docs/changelog/2814.bugfix.rst diff --git a/docs/changelog.rst b/docs/changelog.rst index ae4131c45..699332816 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -5,6 +5,13 @@ Release History .. towncrier release notes start +v20.28.1 (2025-01-02) +--------------------- + +Bugfixes - 20.28.1 +~~~~~~~~~~~~~~~~~~ +- Skip tcsh tests on broken tcsh versions - by :user:`gaborbernat`. (:issue:`2814`) + v20.28.0 (2024-11-25) --------------------- diff --git a/docs/changelog/2814.bugfix.rst b/docs/changelog/2814.bugfix.rst deleted file mode 100644 index 9b85df2da..000000000 --- a/docs/changelog/2814.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Skip tcsh tests on broken tcsh versions - by :user:`gaborbernat`.