Skip to content

Commit 938cce8

Browse files
committed
[portage] more defaults
1 parent 24a1c7e commit 938cce8

File tree

4 files changed

+22
-19
lines changed

4 files changed

+22
-19
lines changed

stubs/portage/portage/dbapi/__init__.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class dbapi:
2727
"SLOT",
2828
]
2929
],
30-
mytree: str | None = ...,
31-
myrepo: str | None = ...,
30+
mytree: str | None = None,
31+
myrepo: str | None = None,
3232
) -> list[str]: ...
3333
def match(self, mydep: str, use_cache: Literal[0, 1] = 1) -> list[str] | str: ...
3434

stubs/portage/portage/dbapi/porttree.pyi

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
from _typeshed import Incomplete
12
from collections.abc import Sequence
23
from typing import Literal
34

45
from portage.dbapi import dbapi
56

67
class portdbapi(dbapi):
78
def getFetchMap(
8-
self, mypkg: str, useflags: Sequence[str] | None = ..., mytree: str | None = ...
9+
self, mypkg: str, useflags: Sequence[str] | None = None, mytree: str | None = None
910
) -> dict[str, tuple[str, ...]]: ...
1011
def xmatch(
1112
self,
@@ -20,10 +21,12 @@ class portdbapi(dbapi):
2021
],
2122
origdep: str,
2223
) -> list[str] | str: ...
23-
def findname(self, mycpv: str, mytree: str | None = ..., myrepo: str | None = ...) -> str: ...
24+
def findname(self, mycpv: str, mytree: str | None = None, myrepo: str | None = None) -> str: ...
2425
def findname2(
25-
self, mycpv: str, mytree: str | None = ..., myrepo: str | None = ...
26+
self, mycpv: str, mytree: str | None = None, myrepo: str | None = None
2627
) -> tuple[None, Literal[0]] | tuple[str, str] | tuple[str, None]: ...
2728

2829
class portagetree:
2930
dbapi: portdbapi
31+
32+
def __getattr__(name: str) -> Incomplete: ... # incomplete module

stubs/portage/portage/package/ebuild/config.pyi

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
from collections.abc import Hashable, Mapping
1+
from collections.abc import Mapping
22
from typing import Literal, TypeVar
33

44
class config:
55
def __init__(
66
self,
7-
clone: config | None = ...,
8-
mycpv: str | None = ...,
9-
config_profile_path: str | None = ...,
10-
config_incrementals: dict[str, str] | None = ...,
11-
config_root: str | None = ...,
12-
target_root: str | None = ...,
13-
sysroot: str | None = ...,
14-
eprefix: str | None = ...,
7+
clone: config | None = None,
8+
mycpv: str | None = None,
9+
config_profile_path: str | None = None,
10+
config_incrementals: dict[str, str] | None = None,
11+
config_root: str | None = None,
12+
target_root: str | None = None,
13+
sysroot: str | None = None,
14+
eprefix: str | None = None,
1515
local_config: bool = True,
16-
env: dict[str, str] | None = ...,
17-
_unmatched_removal: bool = ...,
18-
repositories: list[str] | None = ...,
16+
env: dict[str, str] | None = None,
17+
_unmatched_removal: bool = False,
18+
repositories: list[str] | None = None,
1919
) -> None: ...
2020
def __getitem__(self, key: str) -> str: ...
2121
def __setitem__(self, key: str, value: str) -> None: ...
@@ -27,7 +27,7 @@ _K = TypeVar("_K")
2727
_V = TypeVar("_V")
2828

2929
def best_from_dict(
30-
key: Hashable,
30+
key: _K,
3131
top_dict: Mapping[_K, _V],
3232
key_order,
3333
EmptyOnError: Literal[0, 1] = 1,

stubs/portage/portage/versions.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from typing_extensions import Self
44

55
from .package.ebuild.config import config
66

7-
def vercmp(ver1: str, ver2: str, silent: Literal[0, 1] = ...) -> int | None: ...
7+
def vercmp(ver1: str, ver2: str, silent: Literal[0, 1] = 1) -> int | None: ...
88

99
class _pkg_str(str):
1010
@property

0 commit comments

Comments
 (0)