We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41828fd commit 6ea328fCopy full SHA for 6ea328f
nix_update/eval.py
@@ -2,7 +2,7 @@
2
import os
3
from dataclasses import InitVar, dataclass, field
4
from textwrap import dedent, indent
5
-from typing import Any, Dict, List, Literal, Optional, Union
+from typing import Any, Dict, List, Literal, Optional
6
from urllib.parse import ParseResult, urlparse
7
8
from .errors import UpdateError
@@ -57,7 +57,7 @@ class Package:
57
has_update_script: bool
58
59
raw_version_position: InitVar[Optional[Dict[str, Any]]]
60
- raw_cargo_lock: InitVar[Union[Literal[False], str, None]]
+ raw_cargo_lock: InitVar[Literal[False] | str | None]
61
62
parsed_url: Optional[ParseResult] = None
63
new_version: Optional[Version] = None
@@ -69,7 +69,7 @@ def __post_init__(
69
self,
70
import_path: str,
71
raw_version_position: Optional[Dict[str, Any]],
72
- raw_cargo_lock: Union[Literal[False], str, None],
+ raw_cargo_lock: Literal[False] | str | None,
73
) -> None:
74
url = self.url or (self.urls[0] if self.urls else None)
75
if url:
nix_update/update.py
@@ -9,7 +9,7 @@
9
from concurrent.futures import ThreadPoolExecutor
10
from os import path
11
from pathlib import Path
12
-from typing import Dict, Literal, Optional, Tuple, Union
+from typing import Dict, Literal, Optional, Tuple
13
14
15
from .eval import CargoLockInSource, CargoLockInStore, NoCargoLock, Package, eval_attr
@@ -152,7 +152,7 @@ def update_cargo_deps_hash(opts: Options, filename: str, current_hash: str) -> N
152
replace_hash(filename, current_hash, target_hash)
153
154
155
-def update_cargo_lock(opts: Options, filename: str, dst: Union[CargoLockInSource, CargoLockInStore]) -> None:
+def update_cargo_lock(opts: Options, filename: str, dst: CargoLockInSource | CargoLockInStore) -> None:
156
res = run(
157
[
158
"nix",
nix_update/utils.py
import subprocess
import sys
-from typing import IO, Any, Callable, Dict, List, Optional, Union
+from typing import IO, Any, Callable, Dict, List, Optional
HAS_TTY = sys.stdout.isatty()
ROOT = Path(os.path.dirname(os.path.realpath(__file__)))
@@ -24,9 +24,9 @@ def wrapper(text: str) -> None:
24
25
def run(
26
command: List[str],
27
- cwd: Optional[Union[Path, str]] = None,
28
- stdout: Union[None, int, IO[Any]] = subprocess.PIPE,
29
- stderr: Union[None, int, IO[Any]] = None,
+ cwd: Optional[Path | str] = None,
+ stdout: None | int | IO[Any] = subprocess.PIPE,
+ stderr: None | int | IO[Any] = None,
30
check: bool = True,
31
extra_env: Dict[str, str] = {},
32
) -> "subprocess.CompletedProcess[str]":
0 commit comments