Repository: wntrblm/nox
Pull request #904 (2024-12-23 10:15:22)

chore(deps): bump astral-sh/setup-uv from 4 to 5 in the actions group
Bumps the actions group with 1 update: [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv).

Updates `astral-sh/setup-uv` from 4 to 5
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/astral-sh/setup-uv/releases">astral-sh/setup-uv's releases</a>.</em></p>
<blockquote>
<h2>v5.0.0 🎄 Merry Christmas - Help fastly and users by default</h2>
<h2>Changes</h2>
<p>This christmans 🎄 release is a bit early bit still full of presents 🎁
Since we are changing some of the defaults this can lead to breaking changes, thus the major version increase.</p>
<p>Here are the highlights:</p>
<h3><a href="https://redirect.github.com/astral-sh/setup-uv/pull/193">Default to enable-cache: true on GitHub hosted runners</a></h3>
<p>Did you know that that Fastly, the company hosting PyPI, theoretically has to pay $12.5 million per month and so far have served more than 2.41 <strong>exabytes</strong> of data?
<img src="https://github.com/user-attachments/assets/f2f6cb3f-68f6-4e37-abb1-d3bf1f278533" alt="image" /></p>
<p>This is why <a href="https://redirect.github.com/astral-sh/setup-uv/issues/54">they asked us</a> to turn on caching by default. After weighting the pros and cons we decided to automatically upload the cache to the GitHub Actions cache when running on GitHub hosted runners. You can still disable that with <code>enable-cache: false</code>.</p>
<p>I remember when I first got into actions and didn't understand all the magic. I was baffled that some actions did something behind the scenes to make everything faster. I hope with this change we help a lot of users who are don't want to or are afraid to understand what <code>enable-cache</code> does.</p>
<h3><a href="https://redirect.github.com/astral-sh/setup-uv/pull/185">Add **/requirements*.txt to default cache-dependency-glob</a></h3>
<p>If caching is enabled we automatically searched for a <code>uv.lock</code> file and when this changed we knew we had to refresh the cache. A lot of projects don't use this but rather the good old <code>requirements.txt</code>. We now automatically search for both <code>uv.lock</code>and <code>requirements*.txt</code> (this means also <code>requirements-test.txt</code>, <code>requirements-dev.txt</code>, ...) files.
You can change this with <code>cache-dependency-glob</code></p>
<h3><a href="https://redirect.github.com/astral-sh/setup-uv/pull/194">Auto activate venv when python-version is set</a></h3>
<p>Some workflows install packages on the fly. This automatically works when using a python version that is already present on the runner. But if uv installs the version, e.g. because it is a free-threaded version or an old one, it is a <a href="https://astral.sh/blog/python-build-standalone">standalone-build</a> and installing packages &quot;into the system&quot; is not possible.</p>
<p>We now automatically create a new virtual environment with <code>uv venv</code> and activate it for the rest of the workflow if <code>python-version</code> is used. This means you can now do</p>
<pre lang="yaml"><code>- name: Install uv
  uses: astral-sh/setup-uv@auto-environment
  with:
    python-version: 3.13t
- run: uv pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple cython
</code></pre>
<h2>🚨 Breaking changes</h2>
<ul>
<li>Default to enable-cache: true on GitHub hosted runners <a href="https://github.com/eifinger"><code>@​eifinger</code></a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/193">#193</a>)</li>
<li>Add **/requirements*.txt to default cache-dependency-glob <a href="https://github.com/eifinger"><code>@​eifinger</code></a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/185">#185</a>)</li>
</ul>
<h2>🐛 Bug fixes</h2>
<ul>
<li>Always use api.github.com <a href="https://github.com/eifinger"><code>@​eifinger</code></a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/191">#191</a>)</li>
</ul>
<h2>🚀 Enhancements</h2>
<ul>
<li>Auto activate venv when python-version is set <a href="https://github.com/eifinger"><code>@​eifinger</code></a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/194">#194</a>)</li>
<li>Add python version to cache key <a href="https://github.com/eifinger"><code>@​eifinger</code></a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/187">#187</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/astral-sh/setup-uv/commit/180f8b44399608a850e1db031fa65c77746566d3"><code>180f8b4</code></a> Fix wrong cacheDependencyPathHash (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/201">#201</a>)</li>
<li><a href="https://github.com/astral-sh/setup-uv/commit/e3fb95a68959a9be3d650989dc1d43a9a324447a"><code>e3fb95a</code></a> Warn instead of fail for no-dependency-glob (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/200">#200</a>)</li>
<li><a href="https://github.com/astral-sh/setup-uv/commit/2af22b5b2dcfc0729ee842c635f300f1fc5a9e9a"><code>2af22b5</code></a> chore: update known checksums for 0.5.11 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/198">#198</a>)</li>
<li><a href="https://github.com/astral-sh/setup-uv/commit/dd578776bbb50c3f5b3de9e6379065aa0077c56f"><code>dd57877</code></a> Auto activate venv when python-version is set (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/194">#194</a>)</li>
<li><a href="https://github.com/astral-sh/setup-uv/commit/85aa0bf0c11c139baabd61df94702a838ff76d62"><code>85aa0bf</code></a> chore: update known checksums for 0.5.10 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/196">#196</a>)</li>
<li><a href="https://github.com/astral-sh/setup-uv/commit/1f2cbfa7bb518f97c35c3cd1ac38271d6e45b512"><code>1f2cbfa</code></a> Bump <code>@​types/node</code> from 22.10.1 to 22.10.2 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/189">#189</a>)</li>
<li><a href="https://github.com/astral-sh/setup-uv/commit/25b3ce6330ae41c3f95bd2addaf55f4db2d4820a"><code>25b3ce6</code></a> chore: update known checksums for 0.5.9 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/195">#195</a>)</li>
<li><a href="https://github.com/astral-sh/setup-uv/commit/856099c958e7f2d5560824c4068f415104f5e436"><code>856099c</code></a> Add python version to cache key (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/187">#187</a>)</li>
<li><a href="https://github.com/astral-sh/setup-uv/commit/e3017a763c9554c4df1f8374df36156df9c2bb8b"><code>e3017a7</code></a> Default to enable-cache: true on GitHub hosted runners (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/193">#193</a>)</li>
<li><a href="https://github.com/astral-sh/setup-uv/commit/3460fe1a9ab32cdfff176fd684479d2f6dff237c"><code>3460fe1</code></a> Always use api.github.com (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/191">#191</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/astral-sh/setup-uv/compare/v4...v5">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=astral-sh/setup-uv&package-manager=github_actions&previous-version=4&new-version=5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions


</details>


Patch:
diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml
index 4db5a7c..2119850 100644
--- a/.github/workflows/action.yml
+++ b/.github/workflows/action.yml
@@ -27,7 +27,7 @@ jobs:
           - macos-14
     steps:
       - uses: actions/checkout@v4
-      - uses: astral-sh/setup-uv@v4
+      - uses: astral-sh/setup-uv@v5
       - uses: ./
       - run: nox --non-interactive --error-on-missing-interpreter --session github_actions_default_tests
 
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d75c8fb..1f32ff1 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -44,7 +44,7 @@ jobs:
           python-version: ${{ matrix.python-version }}
           allow-prereleases: true
       - name: Setup uv
-        uses: astral-sh/setup-uv@v4
+        uses: astral-sh/setup-uv@v5
       - name: Set up Miniconda
         uses: conda-incubator/setup-miniconda@v3
         with:
@@ -76,7 +76,7 @@ jobs:
         with:
           python-version: "3.12"
       - name: Setup uv
-        uses: astral-sh/setup-uv@v4
+        uses: astral-sh/setup-uv@v5
       - name: Install Nox-under-test
         run:  uv pip install --system .
       - name: Download individual coverage reports
@@ -110,7 +110,7 @@ jobs:
         with:
           python-version: "3.12"
       - name: Setup uv
-        uses: astral-sh/setup-uv@v4
+        uses: astral-sh/setup-uv@v5
       - name: Install Nox-under-test
         run:  uv pip install --system .
       - name: Docs
diff --git a/nox/virtualenv.py b/nox/virtualenv.py
index dcf2b0f..87df09e 100644
--- a/nox/virtualenv.py
+++ b/nox/virtualenv.py
@@ -19,11 +19,11 @@ import contextlib
 import functools
 import json
 import os
-import platform
 import re
 import shutil
 import subprocess
 import sys
+import sysconfig
 from pathlib import Path
 from socket import gethostbyname
 from typing import TYPE_CHECKING, Any, ClassVar
@@ -64,6 +64,11 @@ def __dir__() -> list[str]:
     return __all__
 
 
+# Use for test mocking and to make mypy happy
+_PLATFORM = sys.platform
+_IS_MINGW = sysconfig.get_platform().startswith("mingw")
+
+
 # Problematic environment variables that are stripped from all commands inside
 # of a virtualenv. See https://github.com/theacodes/nox/issues/44
 _BLACKLISTED_ENV_VARS = frozenset(
@@ -74,7 +79,6 @@ _BLACKLISTED_ENV_VARS = frozenset(
         "UV_SYSTEM_PYTHON",
     ]
 )
-_SYSTEM = platform.system()
 
 
 def find_uv() -> tuple[bool, str]:
@@ -359,7 +363,7 @@ class CondaEnv(ProcessEnv):
     def bin_paths(self) -> list[str]:
         """Returns the location of the conda env's bin folder."""
         # see https://github.com/conda/conda/blob/f60f0f1643af04ed9a51da3dd4fa242de81e32f4/conda/activate.py#L563-L572
-        if _SYSTEM == "Windows":
+        if _PLATFORM.startswith("win"):
             return [
                 self.location,
                 os.path.join(self.location, "Library", "mingw-w64", "bin"),
@@ -601,7 +605,7 @@ class VirtualEnv(ProcessEnv):
 
         # The rest of this is only applicable to Windows, so if we don't have
         # an interpreter by now, raise.
-        if _SYSTEM != "Windows":
+        if not _PLATFORM.startswith("win"):
             self._resolved = InterpreterNotFound(self.interpreter)
             raise self._resolved
 
@@ -630,7 +634,7 @@ class VirtualEnv(ProcessEnv):
     @property
     def bin_paths(self) -> list[str]:
         """Returns the location of the virtualenv's bin folder."""
-        if _SYSTEM == "Windows":
+        if _PLATFORM.startswith("win") and not _IS_MINGW:
             return [os.path.join(self.location, "Scripts")]
         return [os.path.join(self.location, "bin")]
 
diff --git a/noxfile.py b/noxfile.py
index 75dd7e3..7c23c90 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -18,14 +18,13 @@ from __future__ import annotations
 import contextlib
 import functools
 import os
-import platform
 import shutil
 import sqlite3
 import sys
 
 import nox
 
-ON_WINDOWS_CI = "CI" in os.environ and platform.system() == "Windows"
+ON_WINDOWS_CI = "CI" in os.environ and sys.platform.startswith("win32")
 
 nox.needs_version = ">=2024.4.15"
 nox.options.default_venv_backend = "uv|virtualenv"


Test patch:
diff --git a/tests/test_command.py b/tests/test_command.py
index dd1af5f..3811587 100644
--- a/tests/test_command.py
+++ b/tests/test_command.py
@@ -36,12 +36,12 @@ import nox.popen
 PYTHON = sys.executable
 
 skip_on_windows_primary_console_session = pytest.mark.skipif(
-    platform.system() == "Windows" and "SECONDARY_CONSOLE_SESSION" not in os.environ,
+    sys.platform.startswith("win") and "SECONDARY_CONSOLE_SESSION" not in os.environ,
     reason="On Windows, this test must run in a separate console session.",
 )
 
 only_on_windows = pytest.mark.skipif(
-    platform.system() != "Windows", reason="Only run this test on Windows."
+    not sys.platform.startswith("win"), reason="Only run this test on Windows."
 )
 
 
@@ -127,7 +127,7 @@ def test_run_verbosity_failed_command(
 
 
 @pytest.mark.skipif(
-    platform.system() == "Windows",
+    sys.platform.startswith("win"),
     reason="See https://github.com/python/cpython/issues/85815",
 )
 def test_run_non_str() -> None:
@@ -285,7 +285,7 @@ def enable_ctrl_c(*, enabled: bool) -> None:
 
 def interrupt_process(proc: subprocess.Popen[Any]) -> None:
     """Send SIGINT or CTRL_C_EVENT to the process."""
-    if platform.system() == "Windows":
+    if sys.platform.startswith("win"):
         # Disable Ctrl-C so we don't terminate ourselves.
         enable_ctrl_c(enabled=False)
 
@@ -301,7 +301,7 @@ def command_with_keyboard_interrupt(
     monkeypatch: pytest.MonkeyPatch, marker: Any
 ) -> None:
     """Monkeypatch Popen.communicate to raise KeyboardInterrupt."""
-    if platform.system() == "Windows":
+    if sys.platform.startswith("win"):
         # Enable Ctrl-C because the child inherits the setting from us.
         enable_ctrl_c(enabled=True)
 
diff --git a/tests/test_virtualenv.py b/tests/test_virtualenv.py
index a05885c..e364ea8 100644
--- a/tests/test_virtualenv.py
+++ b/tests/test_virtualenv.py
@@ -38,7 +38,7 @@ if TYPE_CHECKING:
 
     from nox.virtualenv import CondaEnv, ProcessEnv, VirtualEnv
 
-IS_WINDOWS = nox.virtualenv._SYSTEM == "Windows"
+IS_WINDOWS = sys.platform.startswith("win")
 HAS_CONDA = shutil.which("conda") is not None
 HAS_UV = shutil.which("uv") is not None
 RAISE_ERROR = "RAISE_ERROR"
@@ -249,7 +249,7 @@ def test_conda_env_create_verbose(
     assert kwargs["log"]
 
 
-@mock.patch("nox.virtualenv._SYSTEM", new="Windows")
+@mock.patch("nox.virtualenv._PLATFORM", new="win32")
 def test_condaenv_bin_windows(make_conda: Callable[..., tuple[CondaEnv, Path]]) -> None:
     venv, dir_ = make_conda()
     assert [
@@ -406,7 +406,7 @@ def test_bin_paths(
     assert str(dir_.joinpath("Scripts" if IS_WINDOWS else "bin")) == venv.bin
 
 
-@mock.patch("nox.virtualenv._SYSTEM", new="Windows")
+@mock.patch("nox.virtualenv._PLATFORM", new="win32")
 def test_bin_windows(
     make_one: Callable[..., tuple[VirtualEnv | ProcessEnv, Path]],
 ) -> None:
@@ -417,6 +417,18 @@ def test_bin_windows(
     assert str(dir_.joinpath("Scripts")) == venv.bin
 
 
+@mock.patch("nox.virtualenv._PLATFORM", new="win32")
+@mock.patch("nox.virtualenv._IS_MINGW", new=True)
+def test_bin_windows_mingw(
+    make_one: Callable[..., tuple[VirtualEnv | ProcessEnv, Path]],
+) -> None:
+    venv, dir_ = make_one()
+    assert venv.bin_paths
+    assert len(venv.bin_paths) == 1
+    assert venv.bin_paths[0] == venv.bin
+    assert str(dir_.joinpath("bin")) == venv.bin
+
+
 def test_create(
     monkeypatch: pytest.MonkeyPatch,
     make_one: Callable[..., tuple[VirtualEnv, Path]],
@@ -899,7 +911,7 @@ def test__resolved_interpreter_none(
         ("2.7.15", "python2.7"),
     ],
 )
-@mock.patch("nox.virtualenv._SYSTEM", new="Linux")
+@mock.patch("nox.virtualenv._PLATFORM", new="linux")
 @mock.patch.object(shutil, "which", return_value=True)
 def test__resolved_interpreter_numerical_non_windows(
     which: mock.Mock,
@@ -914,7 +926,7 @@ def test__resolved_interpreter_numerical_non_windows(
 
 
 @pytest.mark.parametrize("input_", ["2.", "2.7."])
-@mock.patch("nox.virtualenv._SYSTEM", new="Linux")
+@mock.patch("nox.virtualenv._PLATFORM", new="linux")
 @mock.patch.object(shutil, "which", return_value=False)
 def test__resolved_interpreter_invalid_numerical_id(
     which: mock.Mock,
@@ -929,7 +941,7 @@ def test__resolved_interpreter_invalid_numerical_id(
     which.assert_called_once_with(input_)
 
 
-@mock.patch("nox.virtualenv._SYSTEM", new="Linux")
+@mock.patch("nox.virtualenv._PLATFORM", new="linux")
 @mock.patch.object(shutil, "which", return_value=False)
 def test__resolved_interpreter_32_bit_non_windows(
     which: mock.Mock, make_one: Callable[..., tuple[VirtualEnv, Path]]
@@ -941,7 +953,7 @@ def test__resolved_interpreter_32_bit_non_windows(
     which.assert_called_once_with("3.6-32")
 
 
-@mock.patch("nox.virtualenv._SYSTEM", new="Linux")
+@mock.patch("nox.virtualenv._PLATFORM", new="linux")
 @mock.patch.object(shutil, "which", return_value=True)
 def test__resolved_interpreter_non_windows(
     which: mock.Mock, make_one: Callable[..., tuple[VirtualEnv, Path]]
@@ -954,7 +966,7 @@ def test__resolved_interpreter_non_windows(
     which.assert_called_once_with("python3.6")
 
 
-@mock.patch("nox.virtualenv._SYSTEM", new="Windows")
+@mock.patch("nox.virtualenv._PLATFORM", new="win32")
 @mock.patch.object(shutil, "which")
 def test__resolved_interpreter_windows_full_path(
     which: mock.Mock, make_one: Callable[..., tuple[VirtualEnv, Path]]
@@ -976,7 +988,7 @@ def test__resolved_interpreter_windows_full_path(
         ("2.7-32", r"c:\python27\python.exe"),
     ],
 )
-@mock.patch("nox.virtualenv._SYSTEM", new="Windows")
+@mock.patch("nox.virtualenv._PLATFORM", new="win32")
 @mock.patch.object(subprocess, "run")
 @mock.patch.object(shutil, "which")
 def test__resolved_interpreter_windows_pyexe(
@@ -1011,7 +1023,7 @@ def test__resolved_interpreter_windows_pyexe(
     which.assert_has_calls([mock.call(input_), mock.call("py")])
 
 
-@mock.patch("nox.virtualenv._SYSTEM", new="Windows")
+@mock.patch("nox.virtualenv._PLATFORM", new="win32")
 @mock.patch.object(subprocess, "run")
 @mock.patch.object(shutil, "which")
 def test__resolved_interpreter_windows_pyexe_fails(
@@ -1020,8 +1032,8 @@ def test__resolved_interpreter_windows_pyexe_fails(
     # Establish that if the py launcher fails, we give the right error.
     venv, _ = make_one(interpreter="python3.6")
 
-    # Trick the nox.virtualenv._SYSTEM into thinking that it cannot find python3.6
-    # (it likely will on Unix). Also, when the nox.virtualenv._SYSTEM looks for the
+    # Trick the nox.virtualenv into thinking that it cannot find python3.6
+    # (it likely will on Unix). Also, when the nox.virtualenv looks for the
     # py launcher, give it a dummy that fails.
     def special_run(cmd: str, *args: str, **kwargs: object) -> TextProcessResult:  # noqa: ARG001
         return TextProcessResult("", 1)
@@ -1036,7 +1048,7 @@ def test__resolved_interpreter_windows_pyexe_fails(
     which.assert_has_calls([mock.call("python3.6"), mock.call("py")])
 
 
-@mock.patch("nox.virtualenv._SYSTEM", new="Windows")
+@mock.patch("nox.virtualenv._PLATFORM", new="win32")
 @mock.patch("nox.virtualenv.UV_PYTHON_SUPPORT", new=False)
 def test__resolved_interpreter_windows_path_and_version(
     make_one: Callable[..., tuple[VirtualEnv, Path]],
@@ -1065,7 +1077,7 @@ def test__resolved_interpreter_windows_path_and_version(
 @pytest.mark.parametrize("input_", ["2.7", "python3.7", "goofy"])
 @pytest.mark.parametrize("sysfind_result", [r"c:\python37-x64\python.exe", None])
 @pytest.mark.parametrize("sysexec_result", ["3.7.3\\n", RAISE_ERROR])
-@mock.patch("nox.virtualenv._SYSTEM", new="Windows")
+@mock.patch("nox.virtualenv._PLATFORM", new="win32")
 @mock.patch("nox.virtualenv.UV_PYTHON_SUPPORT", new=False)
 def test__resolved_interpreter_windows_path_and_version_fails(
     input_: str,
@@ -1089,7 +1101,7 @@ def test__resolved_interpreter_windows_path_and_version_fails(
         print(venv._resolved_interpreter)
 
 
-@mock.patch("nox.virtualenv._SYSTEM", new="Windows")
+@mock.patch("nox.virtualenv._PLATFORM", new="win32")
 @mock.patch.object(shutil, "which")
 def test__resolved_interpreter_not_found(
     which: mock.Mock, make_one: Callable[..., tuple[VirtualEnv, Path]]
@@ -1106,7 +1118,7 @@ def test__resolved_interpreter_not_found(
         print(venv._resolved_interpreter)
 
 
-@mock.patch("nox.virtualenv._SYSTEM", new="Windows")
+@mock.patch("nox.virtualenv._PLATFORM", new="win32")
 @mock.patch("nox.virtualenv.locate_via_py", new=lambda _: None)  # type: ignore[misc]  # noqa: PT008
 def test__resolved_interpreter_nonstandard(
     make_one: Callable[..., tuple[VirtualEnv, Path]],
@@ -1119,7 +1131,7 @@ def test__resolved_interpreter_nonstandard(
         print(venv._resolved_interpreter)
 
 
-@mock.patch("nox.virtualenv._SYSTEM", new="Linux")
+@mock.patch("nox.virtualenv._PLATFORM", new="linux")
 @mock.patch.object(shutil, "which", return_value=True)
 def test__resolved_interpreter_cache_result(
     which: mock.Mock, make_one: Callable[..., tuple[VirtualEnv, Path]]
@@ -1135,7 +1147,7 @@ def test__resolved_interpreter_cache_result(
     assert which.call_count == 1
 
 
-@mock.patch("nox.virtualenv._SYSTEM", new="Linux")
+@mock.patch("nox.virtualenv._PLATFORM", new="linux")
 @mock.patch.object(shutil, "which", return_value=None)
 def test__resolved_interpreter_cache_failure(
     which: mock.Mock, make_one: Callable[..., tuple[VirtualEnv, Path]]