Skip to content

Commit

Permalink
CI should pass
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainBrault committed Jul 29, 2024
1 parent 9f3a2ff commit 2b99d79
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/tox_uv/_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from pathlib import Path
from platform import python_implementation
from typing import TYPE_CHECKING, Any, Literal, Union, cast
from typing import TYPE_CHECKING, Any, Literal, Optional, TypeAlias, cast

from tox.execute.local_sub_process import LocalSubProcessExecutor
from tox.execute.request import StdinSource
Expand All @@ -34,7 +34,7 @@
from tox.tox_env.installer import Installer


PythonPreference = Literal["only-managed", "installed", "managed", "system", "only-system"]
PythonPreference: TypeAlias = Literal["only-managed", "installed", "managed", "system", "only-system"]


class UvVenv(Python, ABC):
Expand All @@ -52,9 +52,11 @@ def register_config(self) -> None:
default=False,
desc="add seed packages to the created venv",
)
# The cast(...) might seems superfluous but removing it
# makes mypy crash. The problem is probably on tox's typing side
self.conf.add_config(
keys=["uv_python_preference"],
of_type=Union[PythonPreference, None],
of_type=cast(type[Optional[PythonPreference]], Optional[PythonPreference]),
default=None,
desc=(
"Whether to prefer using Python installations that are already"
Expand Down

0 comments on commit 2b99d79

Please sign in to comment.