Skip to content
Merged
4 changes: 4 additions & 0 deletions docs/changelog/2800.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Upgrade embedded wheels:

* wheel to ``0.45.0`` from ``0.44.0``
* setuptools to ``75.5.0``
1 change: 1 addition & 0 deletions docs/changelog/2801.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
no longer forcibly echo off during windows batch activation
6 changes: 2 additions & 4 deletions src/virtualenv/activation/batch/activate.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
@REM This file is UTF-8 encoded, so we need to update the current code page while executing it
@echo off
@for /f "tokens=2 delims=:." %%a in ('"%SystemRoot%\System32\chcp.com"') do (
@set _OLD_CODEPAGE=%%a
)
@for /f "tokens=2 delims=:." %%a in ('"%SystemRoot%\System32\chcp.com"') do @set _OLD_CODEPAGE=%%a

@if defined _OLD_CODEPAGE (
"%SystemRoot%\System32\chcp.com" 65001 > nul
)
Expand Down
26 changes: 13 additions & 13 deletions src/virtualenv/seed/wheels/embed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,37 @@
"3.8": {
"pip": "pip-24.3.1-py3-none-any.whl",
"setuptools": "setuptools-75.3.0-py3-none-any.whl",
"wheel": "wheel-0.44.0-py3-none-any.whl",
"wheel": "wheel-0.45.0-py3-none-any.whl",
},
"3.9": {
"pip": "pip-24.3.1-py3-none-any.whl",
"setuptools": "setuptools-75.3.0-py3-none-any.whl",
"wheel": "wheel-0.44.0-py3-none-any.whl",
"setuptools": "setuptools-75.5.0-py3-none-any.whl",
"wheel": "wheel-0.45.0-py3-none-any.whl",
},
"3.10": {
"pip": "pip-24.3.1-py3-none-any.whl",
"setuptools": "setuptools-75.3.0-py3-none-any.whl",
"wheel": "wheel-0.44.0-py3-none-any.whl",
"setuptools": "setuptools-75.5.0-py3-none-any.whl",
"wheel": "wheel-0.45.0-py3-none-any.whl",
},
"3.11": {
"pip": "pip-24.3.1-py3-none-any.whl",
"setuptools": "setuptools-75.3.0-py3-none-any.whl",
"wheel": "wheel-0.44.0-py3-none-any.whl",
"setuptools": "setuptools-75.5.0-py3-none-any.whl",
"wheel": "wheel-0.45.0-py3-none-any.whl",
},
"3.12": {
"pip": "pip-24.3.1-py3-none-any.whl",
"setuptools": "setuptools-75.3.0-py3-none-any.whl",
"wheel": "wheel-0.44.0-py3-none-any.whl",
"setuptools": "setuptools-75.5.0-py3-none-any.whl",
"wheel": "wheel-0.45.0-py3-none-any.whl",
},
"3.13": {
"pip": "pip-24.3.1-py3-none-any.whl",
"setuptools": "setuptools-75.3.0-py3-none-any.whl",
"wheel": "wheel-0.44.0-py3-none-any.whl",
"setuptools": "setuptools-75.5.0-py3-none-any.whl",
"wheel": "wheel-0.45.0-py3-none-any.whl",
},
"3.14": {
"pip": "pip-24.3.1-py3-none-any.whl",
"setuptools": "setuptools-75.3.0-py3-none-any.whl",
"wheel": "wheel-0.44.0-py3-none-any.whl",
"setuptools": "setuptools-75.5.0-py3-none-any.whl",
"wheel": "wheel-0.45.0-py3-none-any.whl",
},
}
MAX = "3.8"
Expand Down
Binary file not shown.
Binary file not shown.
47 changes: 47 additions & 0 deletions tests/unit/activation/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,50 @@ def print_prompt(self):
return 'echo "%PROMPT%"'

activation_tester(Batch)


@pytest.mark.usefixtures("activation_python")
def test_batch_output(activation_tester_class, activation_tester, tmp_path):
version_script = tmp_path / "version.bat"
version_script.write_text("ver", encoding="utf-8")

class Batch(activation_tester_class):
def __init__(self, session) -> None:
super().__init__(BatchActivator, session, None, "activate.bat", "bat")
self._version_cmd = [str(version_script)]
self._invoke_script = []
self.deactivate = "call deactivate"
self.activate_cmd = "call"
self.pydoc_call = f"call {self.pydoc_call}"
self.unix_line_ending = False

def _get_test_lines(self, activate_script):
"""
Build intermediary script which will be then called.
In the script just activate environment, call echo to get current
echo setting, and then deactivate. This ensures that echo setting
is preserved and no unwanted output appears.
"""
intermediary_script_path = str(tmp_path / "intermediary.bat")
activate_script_quoted = self.quote(str(activate_script))
return [
"@echo on",
f"@echo @call {activate_script_quoted} > {intermediary_script_path}",
f"@echo @echo >> {intermediary_script_path}",
f"@echo @deactivate >> {intermediary_script_path}",
f"@call {intermediary_script_path}",
]

def assert_output(self, out, raw, tmp_path): # noqa: ARG002
assert out[0] == "ECHO is on.", raw

def quote(self, s):
if '"' in s or " " in s:
text = s.replace('"', r"\"")
return f'"{text}"'
return s

def print_prompt(self):
return 'echo "%PROMPT%"'

activation_tester(Batch)
Loading