#3725 Python typing stubs baseline
Closed 7 months ago by tkopecek. Opened 2 years ago by tkopecek.
tkopecek/koji issue3708  into  master

file modified
+7 -2
@@ -5,10 +5,12 @@ 

  SUBDIRS =

  PKGDIR = $(shell $(PYTHON) ../devtools/get_site_packages.py )/$(PACKAGE)

  

- ifeq ($(PYVER_MAJOR),2)

- 	PYFILES=$(filter-out db.py,$(PYFILES_ALL))

+ ifeq ($(PYVER_MAJOR), 2)

+ 	PYFILES=$(filter-out db.py, $(PYFILES_ALL))

+ 	PYIFILES=

  else

  	PYFILES=$(PYFILES_ALL)

+ 	PYIFILES=$(wildcard *.pyi)

  endif

  

  _default:
@@ -23,6 +25,9 @@ 

  	for p in $(PYFILES) ; do \

  		install -p -m 644 $$p $(DESTDIR)/$(PKGDIR)/$$p; \

  	done

+ 	for p in $(PYIFILES) ; do \

+ 		install -p -m 644 $$p $(DESTDIR)/$(PKGDIR)/$$p; \

+ 	done

  	for p in $(PYSCRIPTS) ; do \

  		chmod 0755 $(DESTDIR)/$(PKGDIR)/$$p; \

  	done

file added
+2883
The added file is too large to be shown here, see it at: koji/__init__.pyi
file added
+4
@@ -0,0 +1,4 @@ 

+ from typing import Tuple

+ 

+ __version_info__: Tuple[int, int, int]

+ __version__: str

file added
+41
@@ -0,0 +1,41 @@ 

+ from _typeshed import Incomplete

+ 

+ multilibArches: dict[str, tuple[str]]

+ arches: dict[str, str]

+ 

+ def legitMultiArchesInSameLib(arch: Incomplete | None = ...): ...

+ def canCoinstall(arch1, arch2): ...

+ def archDifference(myarch, targetarch): ...

+ def score(arch): ...

+ def isMultiLibArch(arch: Incomplete | None = ...): ...

+ def getBestArchFromList(archlist, myarch: Incomplete | None = ...): ...

+ def getArchList(thisarch: Incomplete | None = ...): ...

+ def getCanonX86Arch(arch): ...

+ def getCanonARMArch(arch): ...

+ def getCanonPPCArch(arch): ...

+ def getCanonSPARCArch(arch): ...

+ def getCanonX86_64Arch(arch): ...

+ 

+ def getCanonArch(

+         skipRpmPlatform: int = ...) -> str:

+     ...

+ 

+ canonArch: str

+ 

+ def getMultiArchInfo(arch=...): ...

+ def getBestArch(myarch: Incomplete | None = ...): ...

+ def getBaseArch(myarch: Incomplete | None = ...): ...

+ 

+ class ArchStorage:

+     canonarch: Incomplete

+     basearch: Incomplete

+     bestarch: Incomplete

+     compatarches: Incomplete

+     archlist: Incomplete

+     multilib: bool

+     def __init__(self) -> None: ...

+     legit_multi_arches: Incomplete

+     def setup_arch(self, arch: Incomplete | None = ..., archlist_includes_compat_arch: bool = ...) -> None: ...

+     def get_best_arch_from_list(self, archlist, fromarch: Incomplete | None = ...): ...

+     def score(self, arch): ...

+     def get_arch_list(self, arch): ...

file added
+22
@@ -0,0 +1,22 @@ 

+ from _typeshed import Incomplete

+ 

+ 

+ class _data:

+     ...

+ 

+ 

+ class ThreadLocal:

+     def __init__(self) -> None:

+         ...

+ 

+     def __getattr__(self, key: str):

+         ...

+ 

+     def __setattr__(self, key: str, value):

+         ...

+ 

+     def __delattr__(self, key: str):

+         ...

+ 

+ 

+ context: ThreadLocal

file added
+215
@@ -0,0 +1,215 @@ 

+ from _typeshed import Incomplete

+ import io

+ import logging

+ import koji

+ from koji.tasks import safe_rmtree, BaseTaskHandler

+ from koji.util import (

+     adler32_constructor,

+     base64encode,

+     dslice,

+     joinpath,

+     parseStatus,

+     to_list,

+ )

+ from typing import Any, Optional, Collection, Callable

+ 

+ 

+ def incremental_upload(

+         session: koji.ClientSession,

+         fname: str,

+         fd: io.IOBase,

+         path: str,

+         retries: int = ...,

+         logger: Optional[logging.Logger] = ...) -> None:

+     ...

+ 

+ 

+ def fast_incremental_upload(

+         session: koji.ClientSession,

+         fname: str,

+         fd: io.IOBase,

+         path: str,

+         retries: int,

+         logger: logging.Logger) -> None:

+     ...

+ 

+ 

+ def log_output(

+         session: koji.ClientSession,

+         path: str,

+         args: Collection[str],

+         outfile: str,

+         uploadpath: str,

+         cwd: Optional[str] = None,

+         logerror: bool | int = ...,

+         append: bool | int = ...,

+         chroot: Optional[str] = ...,

+         env: Optional[dict[str, Any]] = ...):

+     ...

+ 

+ 

+ class SCM:

+     types: dict[str, tuple[str]]

+ 

+     @classmethod

+     def is_scm_url(

+             cls,

+             url: str,

+             strict: bool = ...):

+         ...

+ 

+     logger: logging.Logger

+     url: str

+     scheme: str

+     user: str

+     host: str

+     repository: str

+     module: str

+     revision: str

+     use_common: bool

+     source_cmd: list[str]

+     scmtype: str

+ 

+     def __init__(

+             self,

+             url: str,

+             allow_password: bool = ...) -> None:

+         ...

+ 

+     def get_info(

+             self,

+             keys: list[str] = ...):

+         ...

+ 

+     def assert_allowed(

+             self,

+             allowed: str = ...,

+             session: Optional[koji.ClientSession] = ...,

+             by_config: bool = ...,

+             by_policy: bool = ...,

+             policy_data: dict[str, Any] = ...) -> None:

+         ...

+ 

+     def assert_allowed_by_config(

+             self,

+             allowed: str) -> None:

+         ...

+ 

+     def assert_allowed_by_policy(

+             self,

+             session: koji.ClientSession,

+             **extra_data) -> None:

+         ...

+ 

+     sourcedir: str

+ 

+     def checkout(

+             self,

+             scmdir: str,

+             session: Optional[koji.ClientSession] = ...,

+             uploadpath: Optional[str] = ...,

+             logfile: Optional[str] = ...):

+         ...

+ 

+     def get_source(self):

+         ...

+ 

+ 

+ class TaskManager:

+     options: Incomplete

+     session: koji.ClientSession

+     tasks: dict[int, dict]

+     skipped_tasks: dict[int, float]

+     pids: dict[int, int]

+     subsessions: dict[int, int]

+     handlers: dict[str, BaseTaskHandler]

+     status: str

+     restart_pending: bool

+     ready: bool

+     hostdata: dict

+     task_load: float

+     host_id: int

+     start_ts: float

+     logger: logging.Logger

+ 

+     def __init__(

+             self,

+             options,

+             session: koji.ClientSession) -> None:

+         ...

+ 

+     def findHandlers(

+             self,

+             vars: dict) -> None:

+         ...

+ 

+     def registerHandler(

+             self,

+             entry: BaseTaskHandler) -> None:

+         ...

+ 

+     def registerCallback(

+             self,

+             entry: BaseTaskHandler) -> None:

+         ...

+ 

+     def registerEntries(

+             self,

+             vars: dict) -> None:

+         ...

+ 

+     def scanPlugin(

+             self,

+             plugin) -> None:

+         ...

+ 

+     def shutdown(self) -> None:

+         ...

+ 

+     def updateBuildroots(

+             self,

+             nolocal: bool = ...) -> None:

+         ...

+ 

+     def updateTasks(self) -> None:

+         ...

+ 

+     def getNextTask(self):

+         ...

+ 

+     def checkAvailDelay(

+             self,

+             task: dict[str, Any],

+             bin_avail: list,

+             our_avail: float):

+         ...

+ 

+     def cleanDelayTimes(self) -> None:

+         ...

+ 

+     def cleanupTask(

+             self,

+             task_id: int,

+             wait: bool = ...):

+         ...

+ 

+     def checkSpace(self):

+         ...

+ 

+     def readyForTask(self):

+         ...

+ 

+     def takeTask(

+             self,

+             task: dict):

+         ...

+ 

+     def forkTask(

+             self,

+             handler: BaseTaskHandler):

+         ...

+ 

+     def runTask(

+             self,

+             handler: BaseTaskHandler) -> None:

+         ...

file added
+80
@@ -0,0 +1,80 @@ 

+ from _typeshed import Incomplete

+ from koji.util import encode_datetime_recurse as encode_datetime_recurse

+ from typing import Callable, Optional, overload

+ 

+ callbacks: dict[str, list[Callable]]

+ 

+ 

+ class PluginTracker:

+     searchpath: Optional[str]

+     prefix: str

+     plugins: dict

+ 

+     def __init__(

+             self,

+             path: Optional[str] = ...,

+             prefix: str = ...) -> None:

+         ...

+ 

+     def load(

+             self,

+             name: str,

+             path: Optional[str] = ...,

+             reload: bool = ...) -> Callable:

+         ...

+ 

+     def get(

+             self,

+             name: str) -> Callable:

+         ...

+ 

+     @overload

+     def pathlist(self, path: str) -> str:

+         ...

+ 

+     @overload

+     def pathlist(self, path: list[str]) -> list[str]:

+         ...

+ 

+ 

+ def export(f: Callable) -> Callable:

+     ...

+ 

+ 

+ def export_cli(f: Callable) -> Callable:

+     ...

+ 

+ 

+ def export_as(alias: str) -> Callable:

+     ...

+ 

+ 

+ def export_in(

+         module,

+         alias: Optional[str] = ...) -> Callable:

+     ...

+ 

+ 

+ def callback(*cbtypes) -> Callable:

+     ...

+ 

+ 

+ def ignore_error(f: Callable) -> Callable:

+     ...

+ 

+ 

+ def convert_datetime(f: Callable) -> Callable:

+     ...

+ 

+ 

+ def register_callback(

+         cbtype: str,

+         func: Callable) -> None:

+     ...

+ 

+ 

+ def run_callbacks(

+         cbtype: str,

+         *args,

+         **kws) -> None:

+     ...

file added
+91
@@ -0,0 +1,91 @@ 

+ from typing import (

+     Optional, Dict, Callable, List, Iterable, Tuple

+ )

+ 

+ 

+ class BaseSimpleTest:

+     name: Optional[str] = None

+ 

+     def __init__(self, str: str) -> None:

+         ...

+ 

+     def run(self, data: dict):

+         ...

+ 

+ 

+ class TrueTest(BaseSimpleTest):

+     name: str

+ 

+     def run(self, data: dict) -> bool:

+         ...

+ 

+ 

+ class FalseTest(BaseSimpleTest):

+     ...

+ 

+ 

+ class AllTest(TrueTest):

+     ...

+ 

+ 

+ class NoneTest(FalseTest):

+     ...

+ 

+ 

+ class HasTest(BaseSimpleTest):

+     field: Optional[str]

+     ...

+ 

+ 

+ class BoolTest(BaseSimpleTest):

+     field: Optional[str]

+     ...

+ 

+ 

+ class MatchTest(BaseSimpleTest):

+     field: Optional[str]

+     ...

+ 

+ 

+ class TargetTest(MatchTest):

+     ...

+ 

+ 

+ class CompareTest(BaseSimpleTest):

+     allow_float: bool = True

+     operators: Dict[str, Callable]

+ 

+ 

+ class SimpleRuleSet:

+ 

+     def __init__(

+             self,

+             rules: Iterable[str],

+             tests: Dict[str, Callable]) -> None:

+         ...

+ 

+     def parse_rules(

+             self,

+             lines: Iterable[str]) -> None:

+         ...

+ 

+     def parse_line(

+             self,

+             line: str) -> Tuple[List[Callable], bool, str]:

+         ...

+ 

+     def get_test_handler(self, str: str):

+         ...

+ 

+     def all_actions(self) -> List[str]:

+         ...

+ 

+     def apply(self, data: dict) -> str:

+         ...

+ 

+     def last_rule(self) -> str:

+         ...

+ 

+ 

+ def findSimpleTests(namespace: str) -> Dict[str, BaseSimpleTest]:

+     ...

file added
+44
@@ -0,0 +1,44 @@ 

+ import json

+ from typing import Any, Optional

+ 

+ 

+ class BytesJSONEncoder(json.JSONEncoder):

+ 

+     def default(self, o):

+         ...

+ 

+ 

+ class Rpmdiff:

+     TAGS: tuple[int]

+     PRCO: tuple[str]

+     PREREQ_FLAG: int

+     DEPFORMAT: str

+     FORMAT: str

+     ADDED: str

+     REMOVED: str

+     result: list[tuple]

+     old_data: dict[str, Any]

+     new_data: dict[str, Any]

+ 

+     def __init__(

+             self,

+             old: str,

+             new: str,

+             ignore: Optional[str] = ...) -> None:

+         ...

+ 

+     def textdiff(self) -> str:

+         ...

+ 

+     def differs(self) -> bool:

+         ...

+ 

+     def sense2str(

+             self,

+             sense: int) -> str:

+         ...

+ 

+     def kojihash(

+             self,

+             new: bool = ...) -> str:

+         ...

file added
+14
@@ -0,0 +1,14 @@ 

+ class ServerError(Exception):

+     ...

+ 

+ 

+ class ServerRedirect(ServerError):

+     ...

+ 

+ 

+ class BadRequest(ServerError):

+     ...

+ 

+ 

+ class RequestTimeout(ServerError):

+     ...

file added
+291
@@ -0,0 +1,291 @@ 

+ import optparse

+ from typing import Any, Optional, List, Union, Dict, TypedDict

+ 

+ 

+ class _HostInfo(TypedDict):

+     arches: str

+     capacity: float

+     comment: str

+     description: str

+     enabled: bool

+     id: int

+     name: str

+     ready: bool

+     task_load: float

+     user_id: int

+ 

+ 

+ class _RepoInfo(TypedDict):

+     create_event: int

+     create_ts: float

+     creation_time: str

+     dist: bool

+     id: int

+     state: int

+     tag_id: int

+     tag_name: str

+     task_id: int

+ 

+ 

+ class _TagInfo(TypedDict):

+     arches: str

+     extra: dict[str, str]

+     id: int

+     locked: bool

+     maven_include_all: bool

+     maven_support: bool

+     name: str

+     perm: str

+     perm_id: int

+ 

+ 

+ class _TaskInfo(TypedDict):

+     arch: str

+     awaited: Optional[bool]

+     channel_id: int

+     completion_time: str

+     completion_ts: float

+     create_time: str

+     create_ts: float

+     host_id: int

+     id: int

+     label: str

+     method: str

+     owner: int

+     parent: int

+     priority: int

+     start_time: str

+     start_ts: float

+     state: int

+     waiting: Union[bool, None]

+     weight: float

+     request: List[Any]

+ 

+ 

+ def scan_mounts(topdir: str) -> List[str]:

+     ...

+ 

+ 

+ def umount_all(topdir: str) -> None:

+     ...

+ 

+ 

+ def safe_rmtree(

+         path: str,

+         unmount: bool = False,

+         strict: bool = True) -> int:

+     ...

+ 

+ 

+ class ServerExit(Exception):

+     ...

+ 

+ 

+ class ServerRestart(Exception):

+     ...

+ 

+ 

+ def parse_task_params(

+         method: str,

+         params: Union[dict, str]) -> dict[str, Any]:

+     ...

+ 

+ 

+ LEGACY_SIGNATURES: dict[str, list]

+ 

+ 

+ class BaseTaskHandler:

+     Methods: List[str]

+     Foreground: bool = ...

+     id: Any = ...

+     method: Any = ...

+     session: Any = ...

+     options: Any = ...

+     workdir: Any = ...

+     logger: Any = ...

+     manager: Any = ...

+ 

+     def __init__(

+             self,

+             id: int,

+             method: str,

+             params: list,

+             session: Any,

+             options: optparse.Values,

+             workdir: Optional[str] = ...) -> None:

+         ...

+ 

+     def setManager(self, manager: Any) -> None:

+         ...

+ 

+     def handler(self) -> None:

+         ...

+ 

+     def run(self):

+         ...

+ 

+     def weight(self) -> float:

+         ...

+ 

+     def createWorkdir(self) -> None:

+         ...

+ 

+     def removeWorkdir(self) -> None:

+         ...

+ 

+     def wait(

+             self,

+             subtasks: Optional[List[int]] = None,

+             all: bool = False,

+             failany: bool = False,

+             canfail: Optional[bool] = None,

+             timeout: Optional[int] = None) -> dict:

+         ...

+ 

+     def getUploadDir(self) -> str:

+         ...

+ 

+     def uploadFile(

+             self,

+             filename: str,

+             relPath: Optional[str] = None,

+             remoteName: Optional[str] = None,

+             volume: Optional[str] = None) -> None:

+         ...

+ 

+     def uploadTree(

+             self,

+             dirpath: str,

+             flatten: bool = False,

+             volume: Optional[str] = None) -> None:

+         ...

+ 

+     def chownTree(

+             self,

+             dirpath: str,

+             uid: int,

+             gid: int) -> None:

+         ...

+ 

+     def localPath(

+             self,

+             relpath: str) -> str:

+         ...

+ 

+     def subtask(

+             self,

+             method: str,

+             arglist: list,

+             **opts: Any) -> int:

+         ...

+ 

+     def subtask2(

+             self,

+             __taskopts: list,

+             __method: str,

+             *args: list,

+             **kwargs: dict) -> int:

+         ...

+ 

+     def find_arch(

+             self,

+             arch: str,

+             host: _HostInfo,

+             tag: _TagInfo,

+             preferred_arch: Optional[str] = None) -> str:

+         ...

+ 

+     def getRepo(

+             self,

+             tag: Any,

+             builds: Optional[Any] = None,

+             wait: bool = False) -> _RepoInfo:

+         ...

+ 

+     def run_callbacks(

+             self,

+             plugin: str,

+             *args: Any,

+             **kwargs: Any) -> None:

+         ...

+ 

+     @property

+     def taskinfo(self) -> _TaskInfo:

+         ...

+ 

+     @taskinfo.setter

+     def taskinfo(self, taskinfo: _TaskInfo) -> None:

+         ...

+ 

+ 

+ class FakeTask(BaseTaskHandler):

+     Methods: List[str]

+     Foreground: bool = ...

+ 

+     def handler(self, *args: list) -> None: # type: ignore[override]

+         ...

+ 

+ 

+ class SleepTask(BaseTaskHandler):

+     def handler(self, n: int) -> None: # type: ignore[override]

+         ...

+ 

+ 

+ class ForkTask(BaseTaskHandler):

+     def handler(self, n: int = 5, m: int = 37) -> None:

+         ...

+ 

+ 

+ class WaitTestTask(BaseTaskHandler):

+     def handler(self, count: int, seconds: int = ...) -> None: # type: ignore[override]

+         ...

+ 

+ 

+ class SubtaskTask(BaseTaskHandler):

+     def handler(self, n: int = ...) -> None:

+         ...

+ 

+ 

+ class DefaultTask(BaseTaskHandler):

+     def handler(self, *args: list, **opts: dict) -> None:

+         ...

+ 

+ 

+ class ShutdownTask(BaseTaskHandler):

+     def handler(self) -> None:

+         ...

+ 

+ 

+ class RestartTask(BaseTaskHandler):

+     def handler(self, host: _HostInfo) -> str: # type: ignore[override]

+         ...

+ 

+ 

+ class RestartVerifyTask(BaseTaskHandler):

+     def handler(self, task_id: int, host: _HostInfo) -> None: # type: ignore[override]

+         ...

+ 

+ 

+ class RestartHostsTask(BaseTaskHandler):

+     def handler(self, options: Optional[dict[str, Any]] = ...) -> None:

+         ...

+ 

+ 

+ class DependantTask(BaseTaskHandler):

+     def handler( # type: ignore[override]

+             self,

+             wait_list: List[int],

+             task_list: List[int]) -> None: 

+         ...

+ 

+ 

+ class MultiPlatformTask(BaseTaskHandler):

+     def buildWrapperRPM(

+             self,

+             spec_url: str,

+             build_task_id: int,

+             build_target: int,

+             build: int,

+             repo_id: int,

+             **opts: dict[str, Any]):

+         ...

file added
+384
@@ -0,0 +1,384 @@ 

+ import base64

+ import koji

+ 

+ from typing import (

+     Any,

+     Callable,

+     Dict,

+     Iterable,

+     List,

+     Optional,

+     Self,

+     TypedDict,

+     Tuple,

+     Union,

+ )

+ 

+ 

+ class _Event(TypedDict):

+     id: int

+     ts: float

+ 

+ 

+ class _TagInfo(TypedDict):

+     arches: str

+     extra: Dict[str, str]

+     id: int

+     locked: bool

+     maven_include_all: bool

+     maven_support: bool

+     name: str

+     perm: str

+     perm_id: int

+ 

+ # koji/util.py follows

+ 

+ 

+ DATE_RE: Any

+ TIME_RE: Any

+ 

+ 

+ def md5_constructor(*args: Any, **kwargs: Any):

+     ...

+ 

+ 

+ def deprecated(message: str) -> None:

+     ...

+ 

+ 

+ def formatChangelog(entries: List[str]) -> str:

+     ...

+ 

+ 

+ def parseTime(val: str) -> Optional[int]:

+     ...

+ 

+ 

+ def checkForBuilds(

+         session: koji.ClientSession,

+         tag,

+         builds,

+         event,

+         latest: bool = False) -> bool:

+     ...

+ 

+ 

+ def duration(start: float) -> str:

+     ...

+ 

+ 

+ def printList(lst: List[str]) -> str:

+     ...

+ 

+ 

+ def base64encode(

+         s: Union[str, bytes],

+         as_bytes: bool = False):

+     ...

+ 

+ 

+ base64decode = base64.b64decode

+ 

+ 

+ def decode_bytes(

+         data: bytes,

+         fallback: str = 'iso8859-15') -> str:

+     ...

+ 

+ 

+ def multi_fnmatch(

+         s: str,

+         patterns: Union[List[str], str]) -> bool:

+     ...

+ 

+ 

+ def dslice(

+         dict_: Dict[str, Any],

+         keys: Iterable[str],

+         strict: bool = True) -> Dict[str, Any]:

+     ...

+ 

+ 

+ def dslice_ex(

+         dict_: Dict[str, Any],

+         keys: Iterable[str],

+         strict: bool = True) -> Dict[str, Any]:

+     ...

+ 

+ 

+ class DataWalker:

+     def __init__(

+             self,

+             data: Any,

+             callback: Callable,

+             kwargs: Optional[dict] = None) -> None:

+         ...

+ 

+     def walk(self):

+         ...

+ 

+ 

+ def encode_datetime(value: Any) -> str:

+     ...

+ 

+ 

+ def encode_datetime_recurse(value: Any):

+     ...

+ 

+ 

+ def call_with_argcheck(

+         func: Callable,

+         args: list,

+         kwargs: Optional[dict] = None):

+     ...

+ 

+ 

+ def apply_argspec(

+         argspec: Iterable,

+         args: Iterable,

+         kwargs: Optional[dict] = None) -> dict:

+     ...

+ 

+ 

+ class HiddenValue:

+     def __init__(self, value: Any) -> None:

+         ...

+ 

+ 

+ class LazyValue:

+     def __init__(

+             self,

+             func: Callable,

+             args: list,

+             kwargs: Optional[dict] = None,

+             cache: bool = False) -> None:

+         ...

+ 

+     def get(self):

+         ...

+ 

+ 

+ class LazyString(LazyValue):

+     ...

+ 

+ 

+ def lazy_eval(value: Any):

+     ...

+ 

+ 

+ class LazyDict(dict):

+     def lazyset(

+             self,

+             key: Any,

+             func: Any,

+             args: list,

+             kwargs: Optional[dict] = None,

+             cache: bool = False) -> None:

+         ...

+ 

+     def get(self, *args: Any, **kwargs: Any):

+         ...

+ 

+     def copy(self) -> Self:

+         ...

+ 

+     def values(self) -> list: # type: ignore[override]

+         ...

+ 

+     def items(self) -> list[tuple]: # type: ignore[override]

+         ...

+ 

+     def itervalues(self) -> None:

+         ...

+ 

+     def iteritems(self) -> None:

+         ...

+ 

+     def pop(self, key: Any, *args: Any, **kwargs: Any):

+         ...

+ 

+     def popitem(self) -> Tuple:

+         ...

+ 

+ 

+ class LazyRecord:

+     def __init__(self, base: Optional[Any] = None) -> None:

+         ...

+ 

+     def __getattribute__(self, name: Any):

+         ...

+ 

+ 

+ def lazysetattr(

+         object: Any,

+         name: str,

+         func: Callable,

+         args: list,

+         kwargs: Optional[dict] = None,

+         cache: bool = False) -> None:

+     ...

+ 

+ 

+ class _RetryRmtree(Exception):

+     ...

+ 

+ 

+ def rmtree(

+         path: str,

+         logger: Optional[Any] = None) -> None:

+     ...

+ 

+ 

+ class SimpleProxyLogger(object):

+     def __init__(self, filename: str) -> None: ...

+     def __enter__(self): ...

+     def __exit__(self, _type, value, traceback) -> bool: ...

+     def log(self,

+             level = int,

+             msg = str,

+             *args,

+             **kwargs) -> None:

+         ...

+     def info(self, msg = str, *args, **kwargs) -> None: ...

+     def warning(self, msg = str, *args, **kwargs) -> None: ...

+     def error(self, msg = str, *args, **kwargs) -> None: ...

+     def debug(self, msg = str, *args, **kwargs) -> None: ...

+     @staticmethod

+     def send(filename: str, logger) -> None: ...

+ 

+ 

+ def safer_move(src: str, dst: str) -> None:

+     ...

+ 

+ 

+ def move_and_symlink(

+         src: str,

+         dst: str,

+         relative: bool = True,

+         create_dir: bool = False) -> None:

+     ...

+ 

+ 

+ def joinpath(

+         path: str,

+         *paths: str) -> str:

+     ...

+ 

+ 

+ def eventFromOpts(

+         session: koji.ClientSession,

+         opts: Any) -> Optional[_Event]:

+     ...

+ 

+ 

+ def filedigestAlgo(hdr: bytes) -> str:

+     ...

+ 

+ 

+ def check_sigmd5(filename: str) -> bool:

+     ...

+ 

+ 

+ def parseStatus(rv: int, prefix: Union[str, Iterable[str]]) -> str:

+     ...

+ 

+ 

+ def isSuccess(rv: int) -> bool:

+     ...

+ 

+ 

+ def setup_rlimits(

+         opts: Any,

+         logger: Optional[Any] = None) -> None:

+     ...

+ 

+ 

+ class adler32_constructor:

+     def __init__(

+             self,

+             arg: str = '') -> None:

+         ...

+ 

+     def update(self, arg: Union[str, bytes]) -> None:

+         ...

+ 

+     def digest(self) -> bytes:

+         ...

+ 

+     def hexdigest(self) -> str:

+         ...

+ 

+     def copy(self) -> Self:

+         ...

+ 

+     digest_size: int = 4

+     block_size: int = 1

+ 

+ 

+ def tsort(parts: Iterable) -> list:

+     ...

+ 

+ 

+ class MavenConfigOptAdapter:

+     def __init__(

+             self,

+             conf: Any,

+             section: str) -> None:

+         ...

+ 

+ 

+ def maven_opts(

+         values: dict,

+         chain: bool = False,

+         scratch: bool = False) -> dict:

+     ...

+ 

+ 

+ def maven_params(

+         config: Any,

+         package: str,

+         chain: bool = False,

+         scratch: bool = False) -> dict:

+     ...

+ 

+ 

+ def wrapper_params(

+         config: Any,

+         package: str,

+         chain: bool = False,

+         scratch: bool = False) -> dict:

+     ...

+ 

+ 

+ def parse_maven_params(

+         confs: Any,

+         chain: bool = False,

+         scratch: bool = False) -> dict:

+     ...

+ 

+ 

+ def parse_maven_param(

+         confs: Any,

+         chain: bool = False,

+         scratch: bool = False,

+         section: Optional[str] = None) -> dict:

+     ...

+ 

+ 

+ def parse_maven_chain(

+         confs: Any,

+         scratch: bool = False) -> dict:

+     ...

+ 

+ 

+ def to_list(lst: Iterable) -> list:

+     ...

+ 

+ 

+ def format_shell_cmd(

+         cmd: List[str],

+         text_width: int = 80) -> str:

+     ...

+ 

+ def extract_build_task(binfo: dict[str, Any]) -> int:

+     ...

file added
+44
@@ -0,0 +1,44 @@ 

+ import types

+ #import six.moves.xmlrpc_client as xmlrpc_client

+ from _typeshed import Incomplete

+ from typing import Callable, Optional, Union

+ 

+ getparser: Incomplete

+ loads: Incomplete

+ Fault: Incomplete

+ DateTime: Incomplete

+ 

+ 

+ class ExtendedMarshaller(object):

+     dispatch: Incomplete

+ 

+     def dump_generator(

+             self,

+             value: types.GeneratorType,

+             write: Callable) -> None:

+         ...

+ 

+     MAXI8: int

+     MINI8: int

+ 

+     def dump_int(

+             self,

+             value: int,

+             write: Callable):

+         ...

+ 

+     def dump_re(

+             self,

+             value,

+             write: Callable):

+         ...

+ 

+ 

+ def dumps(

+         params,

+         methodname: Optional[str] = ...,

+         methodresponse: Optional[Union[bool, int]] = ...,

+         encoding: Optional[str] = ...,

+         allow_none: Union[bool, int] = ...,

+         marshaller: Optional[Incomplete] = ...) -> str:

+     ...

empty or binary file added
file added
+59
@@ -0,0 +1,59 @@ 

+ from typing import Any, Optional

+ 

+ RetryWhitelist: Any

+ 

+ class Session:

+     logged_in: bool = ...

+     id: Any = ...

+     master: Any = ...

+     key: Any = ...

+     user_id: Any = ...

+     authtype: Any = ...

+     hostip: Any = ...

+     user_data: Any = ...

+     message: str = ...

+     exclusive: bool = ...

+     lockerror: Any = ...

+     callnum: Any = ...

+     session_data: Any = ...

+     def __init__(self, args: Optional[Any] = ..., hostip: Optional[Any] = ...): ...

+     def __getattr__(self, name: Any): ...

+     def validate(self): ...

+     def get_remote_ip(self, override: Optional[Any] = ...): ...

+     def checkLoginAllowed(self, user_id: Any) -> None: ...

+     def login(self, user: Any, password: Any, opts: Optional[Any] = ...): ...

+     def getConnInfo(self): ...

+     def sslLogin(self, proxyuser: Optional[Any] = ...): ...

+     def makeExclusive(self, force: bool = ...) -> None: ...

+     def makeShared(self) -> None: ...

+     def logout(self) -> None: ...

+     def logoutChild(self, session_id: Any) -> None: ...

+     def createSession(self, user_id: Any, hostip: Any, authtype: Any, master: Optional[Any] = ...): ...

+     def subsession(self): ...

+     def getPerms(self): ...

+     def hasPerm(self, name: Any): ...

+     def assertPerm(self, name: Any) -> None: ...

+     def assertLogin(self) -> None: ...

+     def hasGroup(self, group_id: Any): ...

+     def isUser(self, user_id: Any): ...

+     def assertUser(self, user_id: Any) -> None: ...

+     def getHostId(self): ...

+     def getUserId(self, username: Any): ...

+     def getUserIdFromKerberos(self, krb_principal: Any): ...

+     def createUser(self, name: Any, usertype: Optional[Any] = ..., status: Optional[Any] = ..., krb_principal: Optional[Any] = ..., krb_princ_check: bool = ...): ...

+     def setKrbPrincipal(self, name: Any, krb_principal: Any, krb_princ_check: bool = ...): ...

+     def removeKrbPrincipal(self, name: Any, krb_principal: Any): ...

+     def createUserFromKerberos(self, krb_principal: Any): ...

+     def checkKrbPrincipal(self, krb_principal: Any) -> None: ...

+ 

+ def get_user_groups(user_id: Any): ...

+ def get_user_perms(user_id: Any): ...

+ def get_user_data(user_id: Any): ...

+ def login(*args: Any, **opts: Any): ...

+ def krbLogin(*args: Any, **opts: Any): ...

+ def sslLogin(*args: Any, **opts: Any): ...

+ def logout(): ...

+ def subsession(): ...

+ def logoutChild(session_id: Any): ...

+ def exclusiveSession(*args: Any, **opts: Any): ...

+ def sharedSession(): ...

file added
+269
@@ -0,0 +1,269 @@ 

+ from _typeshed import Incomplete

+ from typing import Any, Iterable, Optional, Callable, Tuple, Union, TypeAlias

+ import logging

+ 

+ context: Incomplete

+ POSITIONAL_RE: Any

+ NAMED_RE: Any

+ logger: Incomplete

+ 

+ '''

+ class _QueryOpts(TypedDict, total=False):

+     countOnly: bool

+     order: str

+     offset: int

+     limit: int

+ '''

+ _QueryOpts: TypeAlias = dict[str, Any]

+ 

+ 

+ class DBWrapper:

+     cnx: Incomplete

+ 

+     def __init__(self, cnx: Any) -> None:

+         ...

+ 

+     def __getattr__(self, key: Any):

+         ...

+ 

+     def cursor(self, *args: Any, **kw: Any):

+         ...

+ 

+     def close(self) -> None:

+         ...

+ 

+ 

+ class CursorWrapper:

+     cursor: Incomplete

+     logger: logging.Logger

+     def __init__(self, cursor) -> None: ...

+     def __getattr__(self, key: str) -> Any: ...

+     def fetchone(self, *args, **kwargs): ...

+     def fetchall(self, *args, **kwargs): ...

+     def quote(self, operation: str, parameters: dict[str, Any]) -> str: ...

+     def preformat(self, sql: str, params: dict[str, Any]): ...

+     def execute(self, operation: str, parameters=list, log_errors: bool = ...): ...

+ 

+ 

+ def provideDBopts(**opts: Any) -> None: ...

+ def setDBopts(**opts: Any) -> None: ...

+ def getDBopts() -> dict[str, Any]: ...

+ def connect() -> DBWrapper: ...

+ 

+ 

+ class QueryProcessor:

+     iterchunksize: int

+     columns: Optional[list[str]]

+     aliases: Optional[list[str]]

+     colsByAlias: dict[str, str]

+     tables: Optional[list[str]]

+     joins: Optional[list[str]]

+     clauses: Optional[list[str]]

+     cursors: int

+     values: dict[str, Any]

+     transform: Callable

+     opts: _QueryOpts

+     enable_group: bool

+     logger: logging.Logger

+ 

+     def __init__(self,

+                  columns: Optional[Iterable[str]] = ...,

+                  aliases: Optional[Iterable[str]] = ...,

+                  tables: Optional[Iterable[str]] = ...,

+                  joins: Optional[Iterable[str]] = ...,

+                  clauses: Optional[Iterable[str]] = ...,

+                  values: Optional[dict[str, Any]] = ...,

+                  transform: Optional[Callable] = ...,

+                  opts: Optional[_QueryOpts] = ...,

+                  enable_group: bool = ...) -> None:

+         ...

+ 

+     def countOnly(self, count: int) -> None: ...

+     def singleValue(self, strict: bool = ...): ...

+     def execute(self) -> list[dict[str, Any]]: ...

+     #def execute(self) -> None: ...

+     def iterate(self) -> Iterable[dict[str, Any]]: ...

+     def executeOne(self, strict: bool = ...) -> Optional[dict[str, Any]]: ...

+ 

+ 

+ class QueryView:

+     tables = list[str]

+     joins = list[str]

+     joinmap = dict[str, str]

+     fieldmap = dict[str, str]

+     default_fields: Iterable[str]

+     clauses: Optional[list[str]]

+     fields: Optional[Iterable[str]]

+     opts: _QueryOpts

+     extra_joins: list

+     values: dict

+     order_map: dict[str, str]

+ 

+     def __init__(self,

+                  clauses: Optional[Iterable[str]] = None,

+                  fields: Optional[Iterable[str]] = None,

+                  opts: Optional[_QueryOpts] = None) -> None:

+         ...

+ 

+     @property

+     def query(self): ...

+ 

+ 

+     def get_query(self): ...

+     def get_fields(self, fields): ...

+     def check_opts(self) -> None: ...

+     def map_field(self, field): ...

+     def get_clauses(self): ...

+     def get_joins(self): ...

+     def execute(self): ...

+     def executeOne(self, strict: bool = False): ...

+     def iterate(self): ...

+     def singleValue(self, strict: bool = True): ...

+ 

+ def get_event() -> int: ...

+ def nextval(sequence: str) -> int: ...

+ def currval(sequence: str) -> int: ...

+ def db_lock(name: str, wait: bool = ...) -> bool: ...

+ 

+ class Savepoint:

+     name: str

+     def __init__(self, name: str) -> None: ...

+     def rollback(self) -> None: ...

+ 

+ class InsertProcessor:

+     table: str

+     data: dict[str, Any]

+     rawdata: dict[str, Any]

+ 

+     def __init__(self,

+                  table: str,

+                  data: Optional[dict[str, Any]] = ...,

+                  rawdata: Optional[dict[str, Any]] = ...) -> None:

+         ...

+ 

+     def set(self, **kwargs: Any) -> None: ...

+     def rawset(self, **kwargs: Any) -> None: ...

+     def make_create(self,

+                     event_id: Optional[int] = ...,

+                     user_id: Optional[int] = ...) -> None:

+         ...

+ 

+     def dup_check(self) -> bool: ...

+     def execute(self) -> int: ...

+ 

+ 

+ class UpdateProcessor:

+     table: str

+     data: dict[str, Any]

+     rawdata: dict[str, Any]

+     clauses: list[str]

+     values: dict[str, Any]

+     def __init__(self,

+                  table: str,

+                  data: Optional[dict[str, Any]] = ...,

+                  rawdata: Optional[dict[str, Any]] = ...,

+                  clauses: Optional[Iterable[str]] = ...,

+                  values: Optional[dict[str, Any]] = ...) -> None:

+         ...

+ 

+     def get_values(self) -> dict[str, Any]: ...

+     def set(self, **kwargs: Any) -> None: ...

+     def rawset(self, **kwargs: Any) -> None: ...

+     def make_revoke(self,

+                     event_id: Optional[int] = ...,

+                     user_id: Optional[int] = ...) -> None:

+         ...

+ 

+     def execute(self) -> int: ...

+ 

+ 

+ class DeleteProcessor:

+     table: str

+     clauses: list[str]

+     values: dict[str, Any]

+     def __init__(self,

+                  table: str,

+                  clauses: Optional[Iterable[str]] = ...,

+                  values: Optional[dict[str, Any]] = ...) -> None:

+         ...

+ 

+     def get_values(self) -> dict[str, Any]: ...

+     def execute(self) -> int: ...

+ 

+ 

+ class BulkInsertProcessor:

+     table: str

+     data: dict[str, Any]

+     columns: list[str]

+     strict: bool

+     batch: int

+     def __init__(

+         self,

+         table: str,

+         data: Optional[list[dict[str, Any]]] = ...,

+         columns: Optional[list[str]] = ...,

+         strict: bool = ...,

+         batch: int = ...) -> None:

+         ...

+ 

+     def __str__(self) -> str: ...

+     def _get_insert(self, data: list[dict[str, Any]]) -> Tuple[str, dict[str, Any]]: ...

+     def __repr__(self) -> str: ...

+     def add_record(self, **kwargs: Any) -> None: ...

+     def execute(self) -> None: ...

+     def _one_insert(self, data: dict[str, Any]) -> None: ...

+ 

+ class UpsertProcessor(InsertProcessor):

+     keys: Optional[Iterable[str]]

+     skip_dup: bool

+ 

+     def __init__(

+             self,

+             table,

+             data: Optional[dict[str, Any]] = None,

+             rawdata: Optional[dict] = None,

+             keys: Optional[Iterable[str]]  = None,

+             skip_dup: bool = False) -> None:

+         ...

+ 

+ def _applyQueryOpts(

+         results: list[dict[str, Any]],

+         queryOpts: _QueryOpts) -> Union[int, list[dict]]:

+     ...

+ 

+ def _dml(

+     operation: str,

+     values: dict[str, Any],

+     log_errors: bool = True):

+     ...

+ 

+ 

+ def _fetchMulti(

+     query: str,

+     values: dict[str, Any]):

+     ...

+ 

+ def _fetchSingle(

+         query: str,

+         values: dict[str, Any],

+         strict: bool = False):

+     ...

+ 

+ def _singleValue(

+         query: str,

+         values: Optional[dict[str, Any]] = None,

+         strict: bool =True):

+     ...

+ 

+ def _multiRow(

+         query: str,

+         values: dict[str, Any],

+         fields: Iterable[str]):

+     ...

+ 

+ def _singleRow(

+         query: str,

+         values: dict[str, Any],

+         fields: Iterable[str],

+         strict: bool = False):

+     ...

file added
+783
@@ -0,0 +1,783 @@ 

+ from typing import Any, Optional, Union

+ 

+ import logging

+ import koji.policy

+ import koji.xmlrpcplus

+ from koji import _NVRInfo

+ 

+ logger: logging.Logger

+ 

+ NUMERIC_TYPES: tuple[type]

+ 

+ def log_error(msg: Any) -> None: ...

+ def xform_user_krb(entry: dict) -> dict: ...

+ 

+ def convert_value(

+     value: Any,

+     cast: Optional[type] = ...,

+     message: Optional[str] = ...,

+     exc_type: Exception = ...,

+     none_allowed: bool = ...,

+     check_only: bool = ...):

+     ...

+ 

+ 

+ class Task:

+     fields: Any = ...

+     id: Any = ...

+     logger: Any = ...

+     def __init__(self, id: Any) -> None: ...

+     def verifyHost(self, host_id: Optional[Any] = ...): ...

+     def assertHost(self, host_id: Any) -> None: ...

+     def getOwner(self): ...

+     def verifyOwner(self, user_id: Optional[Any] = ...): ...

+     def assertOwner(self, user_id: Optional[Any] = ...) -> None: ...

+     def lock(self, host_id: Any, newstate: str = ..., force: bool = ...): ...

+     def assign(self, host_id: Any, force: bool = ...): ...

+     def open(self, host_id: Any): ...

+     def free(self): ...

+     def setWeight(self, weight: Any) -> None: ...

+     def setPriority(self, priority: Any, recurse: bool = ...) -> None: ...

+     def close(self, result: Any) -> None: ...

+     def fail(self, result: Any) -> None: ...

+     def getState(self): ...

+     def isFinished(self): ...

+     def isCanceled(self): ...

+     def isFailed(self): ...

+     def cancel(self, recurse: bool = ...): ...

+     def cancelChildren(self) -> None: ...

+     def cancelFull(self, strict: bool = ...): ...

+     def getRequest(self): ...

+     def getResult(self, raise_fault: bool = ...): ...

+     def getInfo(self, strict: bool = ..., request: bool = ...): ...

+     def getChildren(self, request: bool = ...): ...

+     def runCallbacks(self, cbtype: Any, old_info: Any, attr: Any, new_val: Any) -> None: ...

+ 

+ def make_task(method: Any, arglist: Any, **opts: Any): ...

+ def eventCondition(event: Any, table: Optional[Any] = ...): ...

+ def readInheritanceData(tag_id: Any, event: Optional[Any] = ...): ...

+ def readDescendantsData(tag_id: Any, event: Optional[Any] = ...): ...

+ def writeInheritanceData(tag_id: Any, changes: Any, clear: bool = ...) -> None: ...

+ def readFullInheritance(tag_id: Any, event: Optional[Any] = ..., reverse: bool = ...): ...

+ def readFullInheritanceRecurse(tag_id: Any, event: Any, order: Any, top: Any, hist: Any, currdepth: Any, maxdepth: Any, noconfig: Any, pfilter: Any, reverse: Any) -> None: ...

+ def pkglist_add(taginfo: Any, pkginfo: Any, owner: Optional[Any] = ..., block: Optional[Any] = ..., extra_arches: Optional[Any] = ..., force: bool = ..., update: bool = ...): ...

+ def pkglist_remove(taginfo: Any, pkginfo: Any, force: bool = ...) -> None: ...

+ def pkglist_block(taginfo: Any, pkginfo: Any, force: bool = ...) -> None: ...

+ def pkglist_unblock(taginfo: Any, pkginfo: Any, force: bool = ...) -> None: ...

+ def pkglist_setowner(taginfo: Any, pkginfo: Any, owner: Any, force: bool = ...) -> None: ...

+ def pkglist_setarches(taginfo: Any, pkginfo: Any, arches: Any, force: bool = ...) -> None: ...

+ def readPackageList(tagID: Optional[Any] = ..., userID: Optional[Any] = ..., pkgID: Optional[Any] = ..., event: Optional[Any] = ..., inherit: bool = ..., with_dups: bool = ..., with_owners: bool = ...): ...

+ def list_tags(build: Optional[Any] = ..., package: Optional[Any] = ..., perms: bool = ..., queryOpts: Optional[Any] = ..., pattern: Optional[Any] = ...): ...

+ def readTaggedBuilds(tag: Any, event: Optional[Any] = ..., inherit: bool = ..., latest: bool = ..., package: Optional[Any] = ..., owner: Optional[Any] = ..., type: Optional[Any] = ...): ...

+ def readTaggedRPMS(tag: Any, package: Optional[Any] = ..., arch: Optional[Any] = ..., event: Optional[Any] = ..., inherit: bool = ..., latest: bool = ..., rpmsigs: bool = ..., owner: Optional[Any] = ..., type: Optional[Any] = ...): ...

+ def readTaggedArchives(tag: Any, package: Optional[Any] = ..., event: Optional[Any] = ..., inherit: bool = ..., latest: bool = ..., type: Optional[Any] = ...): ...

+ def check_tag_access(tag_id: Any, user_id: Optional[Any] = ...): ...

+ def assert_tag_access(tag_id: Any, user_id: Optional[Any] = ..., force: bool = ...) -> None: ...

+ def grplist_add(taginfo: Any, grpinfo: Any, block: bool = ..., force: bool = ..., **opts: Any) -> None: ...

+ def grplist_remove(taginfo: Any, grpinfo: Any, force: bool = ...) -> None: ...

+ def grplist_block(taginfo: Any, grpinfo: Any) -> None: ...

+ def grplist_unblock(taginfo: Any, grpinfo: Any) -> None: ...

+ def grp_pkg_add(taginfo: Any, grpinfo: Any, pkg_name: Any, block: bool = ..., force: bool = ..., **opts: Any) -> None: ...

+ def grp_pkg_remove(taginfo: Any, grpinfo: Any, pkg_name: Any, force: bool = ...) -> None: ...

+ def grp_pkg_block(taginfo: Any, grpinfo: Any, pkg_name: Any) -> None: ...

+ def grp_pkg_unblock(taginfo: Any, grpinfo: Any, pkg_name: Any) -> None: ...

+ def grp_req_add(taginfo: Any, grpinfo: Any, reqinfo: Any, block: bool = ..., force: bool = ..., **opts: Any) -> None: ...

+ def grp_req_remove(taginfo: Any, grpinfo: Any, reqinfo: Any, force: bool = ...) -> None: ...

+ def grp_req_block(taginfo: Any, grpinfo: Any, reqinfo: Any) -> None: ...

+ def grp_req_unblock(taginfo: Any, grpinfo: Any, reqinfo: Any) -> None: ...

+ def get_tag_groups(tag: Any, event: Optional[Any] = ..., inherit: bool = ..., incl_pkgs: bool = ..., incl_reqs: bool = ...): ...

+ def readTagGroups(tag: Any, event: Optional[Any] = ..., inherit: bool = ..., incl_pkgs: bool = ..., incl_reqs: bool = ..., incl_blocked: bool = ...): ...

+ def set_host_enabled(hostname: Any, enabled: bool = ...) -> None: ...

+ def add_host_to_channel(hostname: Any, channel_name: Any, create: bool = ..., force: bool = ...) -> None: ...

+ def remove_host_from_channel(hostname: Any, channel_name: Any) -> None: ...

+ def rename_channel(old: Any, new: Any) -> None: ...

+ def edit_channel(channelInfo: Any, **kw: Any): ...

+ def remove_channel(channel_name: Any, force: bool = ...) -> None: ...

+ def add_channel(channel_name: Any, description: Optional[Any] = ...): ...

+ def set_channel_enabled(channelname: Any, enabled: bool = ..., comment: Optional[Any] = ...) -> None: ...

+ def get_ready_hosts(): ...

+ def get_all_arches(): ...

+ def get_active_tasks(host: Optional[Any] = ...): ...

+ def get_task_descendents(task: Any, childMap: Optional[Any] = ..., request: bool = ...): ...

+ def maven_tag_archives(tag_id: Any, event_id: Optional[Any] = ..., inherit: bool = ...): ...

+ def repo_init(tag: Any, task_id: Optional[Any] = ..., with_src: bool = ..., with_debuginfo: bool = ..., event: Optional[Any] = ..., with_separate_src: bool = ...): ...

+ def dist_repo_init(tag: Any, keys: Any, task_opts: Any): ...

+ def repo_set_state(repo_id: Any, state: Any, check: bool = ...) -> None: ...

+ def repo_info(repo_id: Any, strict: bool = ...): ...

+ def repo_ready(repo_id: Any) -> None: ...

+ def repo_expire(repo_id: Any) -> None: ...

+ def repo_problem(repo_id: Any) -> None: ...

+ def repo_delete(repo_id: Any): ...

+ def repo_expire_older(tag_id: Any, event_id: Any, dist: Optional[Any] = ...) -> None: ...

+ def repo_references(repo_id: Any): ...

+ def get_active_repos(): ...

+ def tag_changed_since_event(event: Any, taglist: Any): ...

+ def set_tag_update(tag_id: Any, utype: Any, event_id: Optional[Any] = ..., user_id: Optional[Any] = ...) -> None: ...

+ def create_build_target(name: Any, build_tag: Any, dest_tag: Any): ...

+ def edit_build_target(buildTargetInfo: Any, name: Any, build_tag: Any, dest_tag: Any) -> None: ...

+ def delete_build_target(buildTargetInfo: Any) -> None: ...

+ def get_build_targets(info: Optional[Any] = ..., event: Optional[Any] = ..., buildTagID: Optional[Any] = ..., destTagID: Optional[Any] = ..., queryOpts: Optional[Any] = ...): ...

+ def get_build_target(info: Any, event: Optional[Any] = ..., strict: bool = ...): ...

+ 

+ def lookup_name(

+         table: str,

+         info: Union[str, int],

+         strict: bool = ...,

+         create: bool = ...) -> Optional[dict[str, Any]]:

+     ...

+ 

+ def get_id(table: Any, info: Any, strict: bool = ..., create: bool = ...): ...

+ def get_tag_id(info: Any, strict: bool = ..., create: bool = ...): ...

+ def lookup_tag(info: Any, strict: bool = ..., create: bool = ...): ...

+ def get_perm_id(info: Any, strict: bool = ..., create: bool = ...): ...

+ def lookup_perm(info: Any, strict: bool = ..., create: bool = ...): ...

+ def get_package_id(info: Any, strict: bool = ..., create: bool = ...): ...

+ def lookup_package(info: Any, strict: bool = ..., create: bool = ...): ...

+ def get_channel_id(info: Any, strict: bool = ..., create: bool = ...): ...

+ def lookup_channel(info: Any, strict: bool = ..., create: bool = ...): ...

+ def get_group_id(info: Any, strict: bool = ..., create: bool = ...): ...

+ def lookup_group(info: Any, strict: bool = ..., create: bool = ...): ...

+ def get_build_target_id(info: Any, strict: bool = ..., create: bool = ...): ...

+ def lookup_build_target(info: Any, strict: bool = ..., create: bool = ...): ...

+ def create_tag(name: Any, parent: Optional[Any] = ..., arches: Optional[Any] = ..., perm: Optional[Any] = ..., locked: bool = ..., maven_support: bool = ..., maven_include_all: bool = ..., extra: Optional[Any] = ...): ...

+ def get_tag(tagInfo: Any, strict: bool = ..., event: Optional[Any] = ..., blocked: bool = ...): ...

+ def get_tag_extra(tagInfo: Any, event: Optional[Any] = ..., blocked: bool = ...): ...

+ def edit_tag(tagInfo: Any, **kwargs: Any) -> None: ...

+ def old_edit_tag(tagInfo: Any, name: Any, arches: Any, locked: Any, permissionID: Any, extra: Optional[Any] = ...): ...

+ def delete_tag(tagInfo: Any) -> None: ...

+ def get_external_repo_id(info: Any, strict: bool = ..., create: bool = ...): ...

+ def create_external_repo(name: Any, url: Any): ...

+ def get_external_repos(info: Optional[Any] = ..., url: Optional[Any] = ..., event: Optional[Any] = ..., queryOpts: Optional[Any] = ...): ...

+ def get_external_repo(info: Any, strict: bool = ..., event: Optional[Any] = ...): ...

+ def edit_external_repo(info: Any, name: Optional[Any] = ..., url: Optional[Any] = ...) -> None: ...

+ def delete_external_repo(info: Any) -> None: ...

+ def add_external_repo_to_tag(tag_info: Any, repo_info: Any, priority: Any, merge_mode: str = ..., arches: Optional[Any] = ...) -> None: ...

+ def remove_external_repo_from_tag(tag_info: Any, repo_info: Any) -> None: ...

+ def edit_tag_external_repo(tag_info: Any, repo_info: Any, priority: Optional[Any] = ..., merge_mode: Optional[Any] = ..., arches: Optional[Any] = ...): ...

+ def get_tag_external_repos(tag_info: Optional[Any] = ..., repo_info: Optional[Any] = ..., event: Optional[Any] = ...): ...

+ def get_external_repo_list(tag_info: Any, event: Optional[Any] = ...): ...

+ def get_user(userInfo: Optional[Any] = ..., strict: bool = ..., krb_princs: bool = ...): ...

+ def edit_user(userInfo: Any, name: Optional[Any] = ..., krb_principal_mappings: Optional[Any] = ...) -> None: ...

+ def list_user_krb_principals(user_info: Optional[Any] = ...): ...

+ def get_user_by_krb_principal(krb_principal: Any, strict: bool = ..., krb_princs: bool = ...): ...

+ def find_build_id(X: Any, strict: bool = ...): ...

+ 

+ def get_build(

+         buildInfo: Any,

+         strict: bool = ...) -> _NVRInfo:

+     ...

+ 

+ def get_build_logs(build: Any): ...

+ 

+ def get_next_release(build_info: Any): ...

+ def get_rpm(rpminfo: Any, strict: bool = ..., multi: bool = ...): ...

+ def list_rpms(buildID: Optional[Any] = ..., buildrootID: Optional[Any] = ..., imageID: Optional[Any] = ..., componentBuildrootID: Optional[Any] = ..., hostID: Optional[Any] = ..., arches: Optional[Any] = ..., queryOpts: Optional[Any] = ...): ...

+ def get_maven_build(buildInfo: Any, strict: bool = ...): ...

+ def get_win_build(buildInfo: Any, strict: bool = ...): ...

+ def get_image_build(buildInfo: Any, strict: bool = ...): ...

+ def get_build_type(buildInfo: Any, strict: bool = ...): ...

+ def list_btypes(query: Optional[Any] = ..., queryOpts: Optional[Any] = ...): ...

+ def add_btype(name: Any) -> None: ...

+ def list_archives(buildID: Optional[Any] = ..., buildrootID: Optional[Any] = ..., componentBuildrootID: Optional[Any] = ..., hostID: Optional[Any] = ..., type: Optional[Any] = ..., filename: Optional[Any] = ..., size: Optional[Any] = ..., checksum: Optional[Any] = ..., typeInfo: Optional[Any] = ..., queryOpts: Optional[Any] = ..., imageID: Optional[Any] = ..., archiveID: Optional[Any] = ..., strict: bool = ...): ...

+ def get_archive(archive_id: Any, strict: bool = ...): ...

+ def get_maven_archive(archive_id: Any, strict: bool = ...): ...

+ def get_win_archive(archive_id: Any, strict: bool = ...): ...

+ def get_image_archive(archive_id: Any, strict: bool = ...): ...

+ def list_archive_files(archive_id: Any, queryOpts: Optional[Any] = ..., strict: bool = ...): ...

+ def get_archive_file(archive_id: Any, filename: Any, strict: bool = ...): ...

+ def list_task_output(taskID: Any, stat: bool = ..., all_volumes: bool = ..., strict: bool = ...): ...

+ def get_host(hostInfo: Any, strict: bool = ..., event: Optional[Any] = ...): ...

+ def edit_host(hostInfo: Any, **kw: Any): ...

+ def get_channel(channelInfo: Any, strict: bool = ...): ...

+ def query_buildroots(hostID: Optional[Any] = ..., tagID: Optional[Any] = ..., state: Optional[Any] = ..., rpmID: Optional[Any] = ..., archiveID: Optional[Any] = ..., taskID: Optional[Any] = ..., buildrootID: Optional[Any] = ..., queryOpts: Optional[Any] = ...): ...

+ def get_buildroot(buildrootID: Any, strict: bool = ...): ...

+ def list_channels(hostID: Optional[Any] = ..., event: Optional[Any] = ..., enabled: Optional[Any] = ...): ...

+ def new_package(name: Any, strict: bool = ...): ...

+ def add_volume(name: Any, strict: bool = ...): ...

+ def remove_volume(volume: Any) -> None: ...

+ def list_volumes(): ...

+ def change_build_volume(build: Any, volume: Any, strict: bool = ...) -> None: ...

+ def ensure_volume_symlink(binfo: Any) -> None: ...

+ def check_volume_policy(data: Any, strict: bool = ..., default: Optional[Any] = ...): ...

+ def apply_volume_policy(build: Any, strict: bool = ...) -> None: ...

+ def new_build(data: Any, strict: bool = ...): ...

+ def recycle_build(old: Any, data: Any) -> None: ...

+ def check_noarch_rpms(basepath: Any, rpms: Any, logs: Optional[Any] = ...): ...

+ def import_build(srpm: Any, rpms: Any, brmap: Optional[Any] = ..., task_id: Optional[Any] = ..., build_id: Optional[Any] = ..., logs: Optional[Any] = ...): ...

+ def import_rpm(fn: Any, buildinfo: Optional[Any] = ..., brootid: Optional[Any] = ..., wrapper: bool = ..., fileinfo: Optional[Any] = ...): ...

+ def generate_token(nbytes: int = ...): ...

+ def get_reservation_token(build_id: Any): ...

+ def clear_reservation(build_id: Any) -> None: ...

+ def cg_init_build(cg: Any, data: Any): ...

+ def cg_refund_build(cg: Any, build_id: Any, token: Any, state: Any = ...) -> None: ...

+ def cg_import(metadata: Any, directory: Any, token: Optional[Any] = ...): ...

+ 

+ class CG_Importer:

+     buildinfo: Any = ...

+     metadata_only: bool = ...

+     def __init__(self) -> None: ...

+     directory: Any = ...

+     def do_import(self, metadata: Any, directory: Any, token: Optional[Any] = ...): ...

+     metadata: Any = ...

+     raw_metadata: Any = ...

+     def get_metadata(self, metadata: Any, directory: Any): ...

+     cg: Any = ...

+     def assert_cg_access(self) -> None: ...

+     def assert_policy(self) -> None: ...

+     def set_volume(self) -> None: ...

+     def check_build_dir(self, delete: bool = ...) -> None: ...

+     typeinfo: Any = ...

+     def prep_build(self, token: Optional[Any] = ...): ...

+     def get_build(self, token: Optional[Any] = ...): ...

+     def update_build(self): ...

+     def import_metadata(self) -> None: ...

+     br_prep: Any = ...

+     def prep_brs(self) -> None: ...

+     brmap: Any = ...

+     def import_brs(self) -> None: ...

+     def prep_buildroot(self, brdata: Any): ...

+     def import_buildroot(self, entry: Any): ...

+     def match_components(self, components: Any): ...

+     def match_rpm(self, comp: Any): ...

+     def match_file(self, comp: Any): ...

+     def match_kojifile(self, comp: Any): ...

+     prepped_outputs: Any = ...

+     def prep_outputs(self) -> None: ...

+     def import_outputs(self) -> None: ...

+     def prep_archive(self, fileinfo: Any) -> None: ...

+     def import_rpm(self, buildinfo: Any, brinfo: Any, fileinfo: Any) -> None: ...

+     def import_log(self, buildinfo: Any, fileinfo: Any) -> None: ...

+     def import_archive(self, buildinfo: Any, brinfo: Any, fileinfo: Any) -> None: ...

+     def import_components(self, archive_id: Any, fileinfo: Any) -> None: ...

+ 

+ def add_external_rpm(rpminfo: Any, external_repo: Any, strict: bool = ...): ...

+ def import_build_log(fn: Any, buildinfo: Any, subdir: Optional[Any] = ...) -> None: ...

+ def import_rpm_file(fn: Any, buildinfo: Any, rpminfo: Any) -> None: ...

+ def merge_scratch(task_id: Any): ...

+ def get_archive_types(): ...

+ def get_archive_type(filename: Optional[Any] = ..., type_name: Optional[Any] = ..., type_id: Optional[Any] = ..., strict: bool = ...): ...

+ def add_archive_type(name: str, description: str, extensions: Any, compression_type: str) -> None: ...

+ def new_maven_build(build: Any, maven_info: Any) -> None: ...

+ def new_win_build(build_info: Any, win_info: Any) -> None: ...

+ def new_image_build(build_info: Any) -> None: ...

+ def new_typed_build(build_info: Any, btype: Any) -> None: ...

+ def import_archive(filepath: Any, buildinfo: Any, type: Any, typeInfo: Any, buildroot_id: Optional[Any] = ...): ...

+ def import_archive_internal(filepath: Any, buildinfo: Any, type: Any, typeInfo: Any, buildroot_id: Optional[Any] = ..., fileinfo: Optional[Any] = ...): ...

+ def add_rpm_sig(an_rpm: Any, sighdr: Any) -> None: ...

+ def delete_rpm_sig(rpminfo: Any, sigkey: Optional[Any] = ..., all_sigs: bool = ...) -> None: ...

+ def check_rpm_sig(an_rpm: Any, sigkey: Any, sighdr: Any) -> None: ...

+ def query_rpm_sigs(rpm_id: Optional[Any] = ..., sigkey: Optional[Any] = ..., queryOpts: Optional[Any] = ...): ...

+ def write_signed_rpm(an_rpm: Any, sigkey: Any, force: bool = ...) -> None: ...

+ def query_history(tables: Optional[Any] = ..., **kwargs: Any): ...

+ def untagged_builds(name: Optional[Any] = ..., queryOpts: Optional[Any] = ...): ...

+ def build_references(build_id: Any, limit: Optional[Any] = ..., lazy: bool = ...): ...

+ def delete_build(build: Any, strict: bool = ..., min_ref_age: int = ...): ...

+ def reset_build(build: Any) -> None: ...

+ def cancel_build(build_id: Any, cancel_task: bool = ...): ...

+ def get_notification_recipients(build: Any, tag_id: Any, state: Any): ...

+ def tag_notification(is_successful: Any, tag_id: Any, from_id: Any, build_id: Any, user_id: Any, ignore_success: bool = ..., failure_msg: str = ...): ...

+ def build_notification(task_id: Any, build_id: Any) -> None: ...

+ def get_build_notifications(user_id: Any): ...

+ def get_build_notification_blocks(user_id: Any): ...

+ def new_group(name: Any): ...

+ def add_group_member(group: Any, user: Any, strict: bool = ...) -> None: ...

+ def drop_group_member(group: Any, user: Any) -> None: ...

+ def get_group_members(group: Any): ...

+ def set_user_status(user: Any, status: Any) -> None: ...

+ def list_cgs(): ...

+ def grant_cg_access(user: Any, cg: Any, create: bool = ...) -> None: ...

+ def revoke_cg_access(user: Any, cg: Any) -> None: ...

+ def assert_cg(cg: Any, user: Optional[Any] = ...) -> None: ...

+ def get_event(): ...

+ def nextval(sequence: Any): ...

+ 

+ class Savepoint:

+     name: Any = ...

+     def __init__(self, name: Any) -> None: ...

+     def rollback(self) -> None: ...

+ 

+ def parse_json(value: Any, desc: Optional[Any] = ..., errstr: Optional[Any] = ...): ...

+ 

+ class BulkInsertProcessor:

+     table: Any = ...

+     data: Any = ...

+     columns: Any = ...

+     strict: Any = ...

+     batch: Any = ...

+     def __init__(self, table: Any, data: Optional[Any] = ..., columns: Optional[Any] = ..., strict: bool = ..., batch: int = ...) -> None: ...

+     def add_record(self, **kwargs: Any) -> None: ...

+     def execute(self) -> None: ...

+ 

+ class InsertProcessor:

+     table: Any = ...

+     data: Any = ...

+     rawdata: Any = ...

+     def __init__(self, table: Any, data: Optional[Any] = ..., rawdata: Optional[Any] = ...) -> None: ...

+     def set(self, **kwargs: Any) -> None: ...

+     def rawset(self, **kwargs: Any) -> None: ...

+     def make_create(self, event_id: Optional[Any] = ..., user_id: Optional[Any] = ...) -> None: ...

+     def dup_check(self): ...

+     def execute(self): ...

+ 

+ class UpdateProcessor:

+     table: Any = ...

+     data: Any = ...

+     rawdata: Any = ...

+     clauses: Any = ...

+     values: Any = ...

+     def __init__(self, table: Any, data: Optional[Any] = ..., rawdata: Optional[Any] = ..., clauses: Optional[Any] = ..., values: Optional[Any] = ...) -> None: ...

+     def get_values(self): ...

+     def set(self, **kwargs: Any) -> None: ...

+     def rawset(self, **kwargs: Any) -> None: ...

+     def make_revoke(self, event_id: Optional[Any] = ..., user_id: Optional[Any] = ...) -> None: ...

+     def execute(self): ...

+ 

+ class OperationTest(koji.policy.MatchTest):

+     name: str = ...

+     field: str = ...

+ 

+ def policy_get_user(data: Any): ...

+ def policy_get_pkg(data: Any): ...

+ def policy_get_version(data: Any): ...

+ def policy_get_release(data: Any): ...

+ def policy_get_brs(data: Any): ...

+ def policy_get_cgs(data: Any): ...

+ def policy_get_build_tags(data: Any, taginfo: bool = ...): ...

+ def policy_get_build_types(data: Any): ...

+ 

+ class NewPackageTest(koji.policy.BaseSimpleTest):

+     name: str = ...

+     def run(self, data: Any): ...

+ 

+ class PackageTest(koji.policy.MatchTest):

+     name: str = ...

+     field: str = ...

+     def run(self, data: Any): ...

+ 

+ class VersionTest(koji.policy.MatchTest):

+     name: str = ...

+     field: str = ...

+     def run(self, data: Any): ...

+ 

+ class ReleaseTest(koji.policy.MatchTest):

+     name: str = ...

+     field: str = ...

+     def run(self, data: Any): ...

+ 

+ class VolumeTest(koji.policy.MatchTest):

+     name: str = ...

+     field: str = ...

+     def run(self, data: Any): ...

+ 

+ class CGMatchAnyTest(koji.policy.BaseSimpleTest):

+     name: str = ...

+     def run(self, data: Any): ...

+ 

+ class CGMatchAllTest(koji.policy.BaseSimpleTest):

+     name: str = ...

+     def run(self, data: Any): ...

+ 

+ class TagTest(koji.policy.MatchTest):

+     name: str = ...

+     field: str = ...

+     def get_tag(self, data: Any): ...

+     def run(self, data: Any): ...

+ 

+ class FromTagTest(TagTest):

+     name: str = ...

+     def get_tag(self, data: Any): ...

+ 

+ class HasTagTest(koji.policy.BaseSimpleTest):

+     name: str = ...

+     def run(self, data: Any): ...

+ 

+ class SkipTagTest(koji.policy.BaseSimpleTest):

+     name: str = ...

+     def run(self, data: Any): ...

+ 

+ class BuildTagTest(koji.policy.BaseSimpleTest):

+     name: str = ...

+     def run(self, data: Any): ...

+ 

+ class BuildTagInheritsFromTest(koji.policy.BaseSimpleTest):

+     name: str = ...

+     def run(self, data: Any): ...

+ 

+ class BuildTypeTest(koji.policy.BaseSimpleTest):

+     name: str = ...

+     def run(self, data: Any): ...

+ 

+ class ImportedTest(koji.policy.BaseSimpleTest):

+     name: str = ...

+     def run(self, data: Any): ...

+ 

+ class ChildTaskTest(koji.policy.BoolTest):

+     name: str = ...

+     field: str = ...

+ 

+ class MethodTest(koji.policy.MatchTest):

+     name: str = ...

+     field: str = ...

+ 

+ class UserTest(koji.policy.MatchTest):

+     name: str = ...

+     field: str = ...

+     def run(self, data: Any): ...

+ 

+ class VMTest(koji.policy.MatchTest):

+     name: str = ...

+     field: str = ...

+ 

+ class IsBuildOwnerTest(koji.policy.BaseSimpleTest):

+     name: str = ...

+     def run(self, data: Any): ...

+ 

+ class UserInGroupTest(koji.policy.BaseSimpleTest):

+     name: str = ...

+     def run(self, data: Any): ...

+ 

+ class HasPermTest(koji.policy.BaseSimpleTest):

+     name: str = ...

+     def run(self, data: Any): ...

+ 

+ class SourceTest(koji.policy.MatchTest):

+     name: str = ...

+     field: str = ...

+     def run(self, data: Any): ...

+ 

+ class PolicyTest(koji.policy.BaseSimpleTest):

+     name: str = ...

+     def __init__(self, str: Any) -> None: ...

+     def run(self, data: Any): ...

+ 

+ def check_policy(name: Any, data: Any, default: str = ..., strict: bool = ..., force: bool = ...): ...

+ def eval_policy(name: Any, data: Any): ...

+ def policy_data_from_task(task_id: Any): ...

+ def policy_data_from_task_args(method: Any, arglist: Any): ...

+ def assert_policy(name: Any, data: Any, default: str = ..., force: bool = ...) -> None: ...

+ def rpmdiff(basepath: Any, rpmlist: Any, hashes: Any) -> None: ...

+ def importImageInternal(task_id: Any, build_info: Any, imgdata: Any) -> None: ...

+ 

+ class RootExports:

+     def restartHosts(self, priority: int = ..., options: Optional[Any] = ...): ...

+     def build(self, src: Any, target: Any, opts: Optional[Any] = ..., priority: Optional[Any] = ..., channel: Optional[Any] = ...): ...

+     def chainBuild(self, srcs: Any, target: Any, opts: Optional[Any] = ..., priority: Optional[Any] = ..., channel: Optional[Any] = ...): ...

+     def mavenBuild(self, url: Any, target: Any, opts: Optional[Any] = ..., priority: Optional[Any] = ..., channel: str = ...): ...

+     def wrapperRPM(self, build: Any, url: Any, target: Any, priority: Optional[Any] = ..., channel: str = ..., opts: Optional[Any] = ...): ...

+     def chainMaven(self, builds: Any, target: Any, opts: Optional[Any] = ..., priority: Optional[Any] = ..., channel: str = ...): ...

+     def winBuild(self, vm: Any, url: Any, target: Any, opts: Optional[Any] = ..., priority: Optional[Any] = ..., channel: str = ...): ...

+     def buildImage(self, name: Any, version: Any, arch: Any, target: Any, ksfile: Any, img_type: Any, opts: Optional[Any] = ..., priority: Optional[Any] = ...): ...

+     def buildImageIndirection(self, opts: Optional[Any] = ..., priority: Optional[Any] = ...): ...

+     def buildImageOz(self, name: Any, version: Any, arches: Any, target: Any, inst_tree: Any, opts: Optional[Any] = ..., priority: Optional[Any] = ...): ...

+     def hello(self, *args: Any): ...

+     def fault(self) -> None: ...

+     def error(self) -> None: ...

+     def echo(self, *args: Any): ...

+     def getKojiVersion(self): ...

+     def getAPIVersion(self): ...

+     def mavenEnabled(self): ...

+     def winEnabled(self): ...

+     def showSession(self): ...

+     def getSessionInfo(self): ...

+     def showOpts(self): ...

+     def getEvent(self, id: Any): ...

+     def getLastEvent(self, before: Optional[Any] = ...): ...

+     evalPolicy: Any = ...

+     def makeTask(self, *args: Any, **opts: Any): ...

+     def uploadFile(self, path: Any, name: Any, size: Any, md5sum: Any, offset: Any, data: Any, volume: Optional[Any] = ..., checksum: Optional[Any] = ...): ...

+     def checkUpload(self, path: Any, name: Any, verify: Optional[Any] = ..., tail: Optional[Any] = ..., volume: Optional[Any] = ...): ...

+     def downloadTaskOutput(self, taskID: Any, fileName: Any, offset: int = ..., size: int = ..., volume: Optional[Any] = ...): ...

+     listTaskOutput: Any = ...

+     createTag: Any = ...

+     editTag: Any = ...

+     editTag2: Any = ...

+     deleteTag: Any = ...

+     createExternalRepo: Any = ...

+     listExternalRepos: Any = ...

+     getExternalRepo: Any = ...

+     editExternalRepo: Any = ...

+     deleteExternalRepo: Any = ...

+     def addExternalRepoToTag(self, tag_info: Any, repo_info: Any, priority: Any, merge_mode: str = ..., arches: Optional[Any] = ...) -> None: ...

+     def removeExternalRepoFromTag(self, tag_info: Any, repo_info: Any) -> None: ...

+     editTagExternalRepo: Any = ...

+     getTagExternalRepos: Any = ...

+     getExternalRepoList: Any = ...

+     resetBuild: Any = ...

+     def importArchive(self, filepath: Any, buildinfo: Any, type: Any, typeInfo: Any) -> None: ...

+     CGInitBuild: Any = ...

+     CGRefundBuild: Any = ...

+     CGImport: Any = ...

+     untaggedBuilds: Any = ...

+     queryHistory: Any = ...

+     deleteBuild: Any = ...

+     def buildReferences(self, build: Any, limit: Optional[Any] = ..., lazy: bool = ...): ...

+     addVolume: Any = ...

+     removeVolume: Any = ...

+     listVolumes: Any = ...

+     changeBuildVolume: Any = ...

+     def getVolume(self, volume: Any, strict: bool = ...): ...

+     def applyVolumePolicy(self, build: Any, strict: bool = ...): ...

+     def createEmptyBuild(self, name: Any, version: Any, release: Any, epoch: Any, owner: Optional[Any] = ...): ...

+     def createMavenBuild(self, build_info: Any, maven_info: Any) -> None: ...

+     def createWinBuild(self, build_info: Any, win_info: Any) -> None: ...

+     def createImageBuild(self, build_info: Any) -> None: ...

+     def importRPM(self, path: Any, basename: Any) -> None: ...

+     def mergeScratch(self, task_id: Any): ...

+     def addExternalRPM(self, rpminfo: Any, external_repo: Any, strict: bool = ...) -> None: ...

+     def tagBuildBypass(self, tag: Any, build: Any, force: bool = ..., notify: bool = ...) -> None: ...

+     def tagBuild(self, tag: Any, build: Any, force: bool = ..., fromtag: Optional[Any] = ...): ...

+     def untagBuild(self, tag: Any, build: Any, strict: bool = ..., force: bool = ...) -> None: ...

+     def untagBuildBypass(self, tag: Any, build: Any, strict: bool = ..., force: bool = ..., notify: bool = ...) -> None: ...

+     def moveBuild(self, tag1: Any, tag2: Any, build: Any, force: bool = ...): ...

+     def moveAllBuilds(self, tag1: Any, tag2: Any, package: Any, force: bool = ...): ...

+     listTags: Any = ...

+     getBuild: Any = ...

+     getBuildLogs: Any = ...

+     getNextRelease: Any = ...

+     getMavenBuild: Any = ...

+     getWinBuild: Any = ...

+     getImageBuild: Any = ...

+     getBuildType: Any = ...

+     getArchiveTypes: Any = ...

+     getArchiveType: Any = ...

+     listArchives: Any = ...

+     getArchive: Any = ...

+     getMavenArchive: Any = ...

+     getWinArchive: Any = ...

+     getImageArchive: Any = ...

+     listArchiveFiles: Any = ...

+     getArchiveFile: Any = ...

+     listBTypes: Any = ...

+     addBType: Any = ...

+     addArchiveType: Any = ...

+     def getChangelogEntries(self, buildID: Optional[Any] = ..., taskID: Optional[Any] = ..., filepath: Optional[Any] = ..., author: Optional[Any] = ..., before: Optional[Any] = ..., after: Optional[Any] = ..., queryOpts: Optional[Any] = ..., strict: bool = ...): ...

+     def cancelBuild(self, buildID: Any): ...

+     def assignTask(self, task_id: Any, host: Any, force: bool = ...): ...

+     def freeTask(self, task_id: Any) -> None: ...

+     def cancelTask(self, task_id: Any, recurse: bool = ...) -> None: ...

+     def cancelTaskFull(self, task_id: Any, strict: bool = ...) -> None: ...

+     def cancelTaskChildren(self, task_id: Any) -> None: ...

+     def setTaskPriority(self, task_id: Any, priority: Any, recurse: bool = ...) -> None: ...

+     def listTagged(self, tag: Any, event: Optional[Any] = ..., inherit: bool = ..., prefix: Optional[Any] = ..., latest: bool = ..., package: Optional[Any] = ..., owner: Optional[Any] = ..., type: Optional[Any] = ...): ...

+     def listTaggedRPMS(self, tag: Any, event: Optional[Any] = ..., inherit: bool = ..., latest: bool = ..., package: Optional[Any] = ..., arch: Optional[Any] = ..., rpmsigs: bool = ..., owner: Optional[Any] = ..., type: Optional[Any] = ...): ...

+     def listTaggedArchives(self, tag: Any, event: Optional[Any] = ..., inherit: bool = ..., latest: bool = ..., package: Optional[Any] = ..., type: Optional[Any] = ...): ...

+     def listBuilds(self, packageID: Optional[Any] = ..., userID: Optional[Any] = ..., taskID: Optional[Any] = ..., prefix: Optional[Any] = ..., state: Optional[Any] = ..., volumeID: Optional[Any] = ..., source: Optional[Any] = ..., createdBefore: Optional[Any] = ..., createdAfter: Optional[Any] = ..., completeBefore: Optional[Any] = ..., completeAfter: Optional[Any] = ..., type: Optional[Any] = ..., typeInfo: Optional[Any] = ..., queryOpts: Optional[Any] = ..., pattern: Optional[Any] = ...): ...

+     def getLatestBuilds(self, tag: Any, event: Optional[Any] = ..., package: Optional[Any] = ..., type: Optional[Any] = ...): ...

+     def getLatestRPMS(self, tag: Any, package: Optional[Any] = ..., arch: Optional[Any] = ..., event: Optional[Any] = ..., rpmsigs: bool = ..., type: Optional[Any] = ...): ...

+     def getLatestMavenArchives(self, tag: Any, event: Optional[Any] = ..., inherit: bool = ...): ...

+     def getAverageBuildDuration(self, package: Any, age: Optional[Any] = ...): ...

+     packageListAdd: Any = ...

+     packageListRemove: Any = ...

+     packageListBlock: Any = ...

+     packageListUnblock: Any = ...

+     packageListSetOwner: Any = ...

+     packageListSetArches: Any = ...

+     groupListAdd: Any = ...

+     groupListRemove: Any = ...

+     groupListBlock: Any = ...

+     groupListUnblock: Any = ...

+     groupPackageListAdd: Any = ...

+     groupPackageListRemove: Any = ...

+     groupPackageListBlock: Any = ...

+     groupPackageListUnblock: Any = ...

+     groupReqListAdd: Any = ...

+     groupReqListRemove: Any = ...

+     groupReqListBlock: Any = ...

+     groupReqListUnblock: Any = ...

+     getTagGroups: Any = ...

+     checkTagAccess: Any = ...

+     def getInheritanceData(self, tag: Any, event: Optional[Any] = ...): ...

+     def setInheritanceData(self, tag: Any, data: Any, clear: bool = ...): ...

+     def getFullInheritance(self, tag: Any, event: Optional[Any] = ..., reverse: bool = ...): ...

+     listRPMs: Any = ...

+     def listBuildRPMs(self, build: Any): ...

+     getRPM: Any = ...

+     def getRPMDeps(self, rpmID: Any, depType: Optional[Any] = ..., queryOpts: Optional[Any] = ..., strict: bool = ...): ...

+     def listRPMFiles(self, rpmID: Any, queryOpts: Optional[Any] = ...): ...

+     def getRPMFile(self, rpmID: Any, filename: Any, strict: bool = ...): ...

+     def getRPMHeaders(self, rpmID: Optional[Any] = ..., taskID: Optional[Any] = ..., filepath: Optional[Any] = ..., headers: Optional[Any] = ...): ...

+     queryRPMSigs: Any = ...

+     def writeSignedRPM(self, an_rpm: Any, sigkey: Any, force: bool = ...): ...

+     def addRPMSig(self, an_rpm: Any, data: Any): ...

+     def deleteRPMSig(self, rpminfo: Any, sigkey: Optional[Any] = ..., all_sigs: bool = ...): ...

+     findBuildID: Any = ...

+     getTagID: Any = ...

+     getTag: Any = ...

+     def getPackageID(self, name: Any, strict: bool = ...): ...

+     getPackage: Any = ...

+     def listPackages(self, tagID: Optional[Any] = ..., userID: Optional[Any] = ..., pkgID: Optional[Any] = ..., prefix: Optional[Any] = ..., inherited: bool = ..., with_dups: bool = ..., event: Optional[Any] = ..., queryOpts: Optional[Any] = ..., with_owners: bool = ...): ...

+     def listPackagesSimple(self, prefix: Optional[Any] = ..., queryOpts: Optional[Any] = ...): ...

+     def checkTagPackage(self, tag: Any, pkg: Any): ...

+     def getPackageConfig(self, tag: Any, pkg: Any, event: Optional[Any] = ...): ...

+     getUser: Any = ...

+     editUser: Any = ...

+     def grantPermission(self, userinfo: Any, permission: Any, create: bool = ...) -> None: ...

+     def revokePermission(self, userinfo: Any, permission: Any) -> None: ...

+     def createUser(self, username: Any, status: Optional[Any] = ..., krb_principal: Optional[Any] = ...): ...

+     def addUserKrbPrincipal(self, user: Any, krb_principal: Any): ...

+     def removeUserKrbPrincipal(self, user: Any, krb_principal: Any): ...

+     def enableUser(self, username: Any) -> None: ...

+     def disableUser(self, username: Any) -> None: ...

+     listCGs: Any = ...

+     grantCGAccess: Any = ...

+     revokeCGAccess: Any = ...

+     newGroup: Any = ...

+     addGroupMember: Any = ...

+     dropGroupMember: Any = ...

+     getGroupMembers: Any = ...

+     def listUsers(self, userType: Any = ..., prefix: Optional[Any] = ..., queryOpts: Optional[Any] = ...): ...

+     def getBuildConfig(self, tag: Any, event: Optional[Any] = ...): ...

+     def getRepo(self, tag: Any, state: Optional[Any] = ..., event: Optional[Any] = ..., dist: bool = ...): ...

+     repoInfo: Any = ...

+     getActiveRepos: Any = ...

+     def distRepo(self, tag: Any, keys: Any, **task_opts: Any): ...

+     def newRepo(self, tag: Any, event: Optional[Any] = ..., src: bool = ..., debuginfo: bool = ..., separate_src: bool = ...): ...

+     def repoExpire(self, repo_id: Any) -> None: ...

+     def repoDelete(self, repo_id: Any): ...

+     def repoProblem(self, repo_id: Any) -> None: ...

+     tagChangedSinceEvent: Any = ...

+     createBuildTarget: Any = ...

+     editBuildTarget: Any = ...

+     deleteBuildTarget: Any = ...

+     getBuildTargets: Any = ...

+     getBuildTarget: Any = ...

+     def taskFinished(self, taskId: Any): ...

+     def getTaskRequest(self, taskId: Any): ...

+     def getTaskResult(self, taskId: Any, raise_fault: bool = ...): ...

+     def getTaskInfo(self, task_id: Any, request: bool = ..., strict: bool = ...): ...

+     def getTaskChildren(self, task_id: Any, request: bool = ..., strict: bool = ...): ...

+     def getTaskDescendents(self, task_id: Any, request: bool = ...): ...

+     def listTasks(self, opts: Optional[Any] = ..., queryOpts: Optional[Any] = ...): ...

+     def taskReport(self, owner: Optional[Any] = ...): ...

+     def resubmitTask(self, taskID: Any): ...

+     def addHost(self, hostname: Any, arches: Any, krb_principal: Optional[Any] = ..., force: bool = ...): ...

+     def enableHost(self, hostname: Any) -> None: ...

+     def disableHost(self, hostname: Any) -> None: ...

+     def enableChannel(self, channelname: Any, comment: Optional[Any] = ...) -> None: ...

+     def disableChannel(self, channelname: Any, comment: Optional[Any] = ...) -> None: ...

+     getHost: Any = ...

+     editHost: Any = ...

+     addHostToChannel: Any = ...

+     removeHostFromChannel: Any = ...

+     renameChannel: Any = ...

+     editChannel: Any = ...

+     removeChannel: Any = ...

+     addChannel: Any = ...

+     def listHosts(self, arches: Optional[Any] = ..., channelID: Optional[Any] = ..., ready: Optional[Any] = ..., enabled: Optional[Any] = ..., userID: Optional[Any] = ..., queryOpts: Optional[Any] = ...): ...

+     def getLastHostUpdate(self, hostID: Any, ts: bool = ...): ...

+     getAllArches: Any = ...

+     getChannel: Any = ...

+     listChannels: Any = ...

+     getBuildroot: Any = ...

+     def getBuildrootListing(self, id: Any): ...

+     listBuildroots: Any = ...

+     def hasPerm(self, perm: Any, strict: bool = ...): ...

+     def getPerms(self): ...

+     def getUserPerms(self, userID: Optional[Any] = ...): ...

+     def getAllPerms(self): ...

+     def getLoggedInUser(self): ...

+     def setBuildOwner(self, build: Any, user: Any) -> None: ...

+     def setBuildTimestamp(self, build: Any, ts: Any) -> None: ...

+     def count(self, methodName: Any, *args: Any, **kw: Any): ...

+     def filterResults(self, methodName: Any, *args: Any, **kw: Any): ...

+     def countAndFilterResults(self, methodName: Any, *args: Any, **kw: Any): ...

+     def getBuildNotifications(self, userID: Optional[Any] = ...): ...

+     def getBuildNotification(self, id: Any, strict: bool = ...): ...

+     def getBuildNotificationBlocks(self, userID: Optional[Any] = ...): ...

+     def getBuildNotificationBlock(self, id: Any, strict: bool = ...): ...

+     def updateNotification(self, id: Any, package_id: Any, tag_id: Any, success_only: Any) -> None: ...

+     def createNotification(self, user_id: Any, package_id: Any, tag_id: Any, success_only: Any) -> None: ...

+     def deleteNotification(self, id: Any) -> None: ...

+     def createNotificationBlock(self, user_id: Any, package_id: Optional[Any] = ..., tag_id: Optional[Any] = ...) -> None: ...

+     def deleteNotificationBlock(self, id: Any) -> None: ...

+     def search(self, terms: Any, type: Any, matchType: Any, queryOpts: Optional[Any] = ...): ...

+ 

+ class BuildRoot:

+     id: Any = ...

+     def __init__(self, id: Optional[Any] = ...) -> None: ...

+     data: Any = ...

+     is_standard: bool = ...

+     def load(self, id: Any) -> None: ...

+     def new(self, host: Any, repo: Any, arch: Any, task_id: Optional[Any] = ..., ctype: str = ...): ...

+     def cg_new(self, data: Any): ...

+     def assertStandard(self) -> None: ...

+     def verifyTask(self, task_id: Any): ...

+     def assertTask(self, task_id: Any) -> None: ...

+     def verifyHost(self, host_id: Any): ...

+     def assertHost(self, host_id: Any) -> None: ...

+     def setState(self, state: Any) -> None: ...

+     def getList(self): ...

+     def setList(self, rpmlist: Any) -> None: ...

+     def updateList(self, rpmlist: Any) -> None: ...

+     def getArchiveList(self, queryOpts: Optional[Any] = ...): ...

+     def updateArchiveList(self, archives: Any, project: bool = ...) -> None: ...

+     def setTools(self, tools: Any) -> None: ...

+ 

+ class Host:

+     id: Any = ...

+     same_host: Any = ...

+     def __init__(self, id: Optional[Any] = ...) -> None: ...

+     def verify(self): ...

+     def taskUnwait(self, parent: Any) -> None: ...

+     def taskSetWait(self, parent: Any, tasks: Any) -> None: ...

+     def taskWaitCheck(self, parent: Any): ...

+     def taskWait(self, parent: Any): ...

+     def taskWaitResults(self, parent: Any, tasks: Any, canfail: Optional[Any] = ...): ...

+     def getHostTasks(self): ...

+     def updateHost(self, task_load: Any, ready: Any) -> None: ...

+     def getLoadData(self): ...

+     def getTask(self): ...

+     def isEnabled(self): ...

+ 

+ class HostExports:

+     def getID(self): ...

+     def updateHost(self, task_load: Any, ready: Any) -> None: ...

+     def getLoadData(self): ...

+     def getHost(self): ...

+     def openTask(self, task_id: Any): ...

+     def closeTask(self, task_id: Any, response: Any): ...

+     def failTask(self, task_id: Any, response: Any): ...

+     def freeTasks(self, tasks: Any) -> None: ...

+     def setTaskWeight(self, task_id: Any, weight: Any): ...

+     def getHostTasks(self): ...

+     def taskSetWait(self, parent: Any, tasks: Any): ...

+     def taskWait(self, parent: Any): ...

+     def taskWaitResults(self, parent: Any, tasks: Any, canfail: Optional[Any] = ...): ...

+     def subtask(self, method: Any, arglist: Any, parent: Any, **opts: Any): ...

+     def subtask2(self, __parent: Any, __taskopts: Any, __method: Any, *args: Any, **opts: Any): ...

+     def moveBuildToScratch(self, task_id: Any, srpm: Any, rpms: Any, logs: Optional[Any] = ...) -> None: ...

+     def moveMavenBuildToScratch(self, task_id: Any, results: Any, rpm_results: Any) -> None: ...

+     def moveWinBuildToScratch(self, task_id: Any, results: Any, rpm_results: Any) -> None: ...

+     def moveImageBuildToScratch(self, task_id: Any, results: Any) -> None: ...

+     def initBuild(self, data: Any): ...

+     def completeBuild(self, task_id: Any, build_id: Any, srpm: Any, rpms: Any, brmap: Optional[Any] = ..., logs: Optional[Any] = ...): ...

+     def completeImageBuild(self, task_id: Any, build_id: Any, results: Any) -> None: ...

+     def initMavenBuild(self, task_id: Any, build_info: Any, maven_info: Any): ...

+     def createMavenBuild(self, build_info: Any, maven_info: Any) -> None: ...

+     def completeMavenBuild(self, task_id: Any, build_id: Any, maven_results: Any, rpm_results: Any) -> None: ...

+     def importArchive(self, filepath: Any, buildinfo: Any, type: Any, typeInfo: Any) -> None: ...

+     def importWrapperRPMs(self, task_id: Any, build_id: Any, rpm_results: Any) -> None: ...

+     def initImageBuild(self, task_id: Any, build_info: Any): ...

+     def initWinBuild(self, task_id: Any, build_info: Any, win_info: Any): ...

+     def completeWinBuild(self, task_id: Any, build_id: Any, results: Any, rpm_results: Any) -> None: ...

+     def failBuild(self, task_id: Any, build_id: Any) -> None: ...

+     def tagBuild(self, task_id: Any, tag: Any, build: Any, force: bool = ..., fromtag: Optional[Any] = ...) -> None: ...

+     def importImage(self, task_id: Any, build_info: Any, results: Any) -> None: ...

+     def tagNotification(self, is_successful: Any, tag_id: Any, from_id: Any, build_id: Any, user_id: Any, ignore_success: bool = ..., failure_msg: str = ...) -> None: ...

+     def checkPolicy(self, name: Any, data: Any, default: str = ..., strict: bool = ...): ...

+     def assertPolicy(self, name: Any, data: Any, default: str = ...) -> None: ...

+     def evalPolicy(self, name: Any, data: Any): ...

+     def newBuildRoot(self, repo: Any, arch: Any, task_id: Optional[Any] = ...): ...

+     def setBuildRootState(self, brootid: Any, state: Any, task_id: Optional[Any] = ...): ...

+     def setBuildRootList(self, brootid: Any, rpmlist: Any, task_id: Optional[Any] = ...): ...

+     def updateBuildRootList(self, brootid: Any, rpmlist: Any, task_id: Optional[Any] = ...): ...

+     def updateBuildrootArchives(self, brootid: Any, task_id: Any, archives: Any, project: bool = ...): ...

+     def updateMavenBuildRootList(self, brootid: Any, task_id: Any, mavenlist: Any, ignore: Optional[Any] = ..., project: bool = ..., ignore_unknown: bool = ..., extra_deps: Optional[Any] = ...): ...

+     def repoInit(self, tag: Any, task_id: Optional[Any] = ..., with_src: bool = ..., with_debuginfo: bool = ..., event: Optional[Any] = ..., with_separate_src: bool = ...): ...

+     def repoDone(self, repo_id: Any, data: Any, expire: bool = ...) -> None: ...

+     def distRepoMove(self, repo_id: Any, uploadpath: Any, arch: Any) -> None: ...

+     def isEnabled(self): ...

+ 

+ def get_upload_path(reldir: Any, name: Any, create: bool = ..., volume: Optional[Any] = ...): ...

+ def get_verify_class(verify: Any): ...

+ def handle_upload(environ: Any): ...

@@ -0,0 +1,59 @@ 

+ import logging

+ from koji.xmlrpcplus import ExtendedMarshaller

+ from typing import Any, Optional

+ 

+ class Marshaller(ExtendedMarshaller):

+     dispatch: Any = ...

+     def dump_datetime(self, value: Any, write: Any) -> None: ...

+ 

+ class HandlerRegistry:

+     funcs: Any = ...

+     argspec_cache: Any = ...

+     def __init__(self) -> None: ...

+     def register_function(self, function: Any, name: Optional[Any] = ...) -> None: ...

+     def register_module(self, instance: Any, prefix: Optional[Any] = ...) -> None: ...

+     def register_instance(self, instance: Any) -> None: ...

+     def register_plugin(self, plugin: Any) -> None: ...

+     def getargspec(self, func: Any): ...

+     def list_api(self): ...

+     def system_listMethods(self): ...

+     def system_methodSignature(self, method: Any): ...

+     def system_methodHelp(self, method: Any): ...

+     def get(self, name: Any): ...

+ 

+ class HandlerAccess:

+     def __init__(self, registry: Any) -> None: ...

+     def call(self, __name: Any, *args: Any, **kwargs: Any): ...

+     def get(self, name: Any): ...

+ 

+ class ModXMLRPCRequestHandler:

+     traceback: bool = ...

+     handlers: Any = ...

+     logger: Any = ...

+     def __init__(self, handlers: Any) -> None: ...

+     def handle_upload(self, environ: Any): ...

+     def handle_rpc(self, environ: Any): ...

+     def check_session(self) -> None: ...

+     def enforce_lockout(self) -> None: ...

+     def multiCall(self, calls: Any): ...

+     def handle_request(self, req: Any) -> None: ...

+ 

+ def offline_reply(start_response: Any, msg: Optional[Any] = ...): ...

+ def load_config(environ: Any): ...

+ def load_plugins(opts: Any): ...

+ def get_policy(opts: Any, plugins: Any): ...

+ 

+ class HubFormatter(logging.Formatter):

+     def format(self, record: Any): ...

+ 

+ def setup_logging1() -> None: ...

+ def setup_logging2(opts: Any) -> None: ...

+ def load_scripts(environ: Any) -> None: ...

+ def get_memory_usage(): ...

+ def server_setup(environ: Any) -> None: ...

+ 

+ firstcall: bool

+ firstcall_lock: Any

+ 

+ def application(environ: Any, start_response: Any): ...

+ def get_registry(opts: Any, plugins: Any): ...

file added
+133
@@ -0,0 +1,133 @@ 

+ from _typeshed import Incomplete

+ from typing import Callable, Iterable, Optional, TypeAlias, TypedDict

+ 

+ from . import kojihub as kojihub

+ from .db import (

+     DeleteProcessor,

+     InsertProcessor,

+     QueryProcessor,

+     QueryView,

+     UpdateProcessor,

+     UpsertProcessor,

+     db_lock,

+ )

+ 

+ logger: Incomplete

+ 

+ _Tables: TypeAlias = list[str]

+ _Clauses: TypeAlias = Iterable[str]

+ _JoinMap: TypeAlias = dict[str, str]

+ _FieldMap: TypeAlias = dict[str, list[str|None]]

+ _DefaultFields: TypeAlias = tuple[str]

+ _Fields: TypeAlias = Iterable[str]

+ _TaskRun: TypeAlias = dict

+ 

+ class _HostInfo(TypedDict):

+     id: int

+     user_id: int

+     name: str

+     update_ts: float

+     ready: bool

+     task_load: float

+     arches: str

+     capacity: float

+     description: str

+     comment: str

+     enabled: bool

+ 

+ def log_db(msg, task_id: Optional[int] = None, host_id: Optional[int] = None) -> None:

+     ...

+ 

+ def log_both(msg, task_id: Optional[int] = None, host_id: Optional[int] = None, level=...) -> None:

+     ...

+ 

+ class LogMessagesQuery(QueryView):

+     tables: _Tables

+     joinmap: _JoinMap

+     fieldmap: _FieldMap

+     default_fields: _DefaultFields

+ 

+ def get_log_messages(

+         clauses: Optional[_Clauses] = None,

+         fields: Optional[Iterable[str]] = None):

+     ...

+ 

+ def get_tasks_for_host(hostID: Optional[int], retry: bool = True):

+     ...

+ 

+ def set_refusal(

+         hostID: int,

+         taskID: int,

+         soft: bool = True,

+         by_host: bool = False,

+         msg: str = '') -> None:

+     ...

+ 

+ class TaskRefusalsQuery(QueryView):

+     tables: _Tables

+     joinmap: _JoinMap

+     fieldmap: _FieldMap

+     default_fields: _DefaultFields

+ 

+ def get_task_refusals(

+         clauses: Optional[_Clauses] = None,

+         fields: Optional[_Fields] = None):

+     ...

+ 

+ def get_host_data(hostID: Optional[int] = None): ...

+ def set_host_data(hostID: Optional[int], data: dict) -> None: ...

+ 

+ class TaskRunsQuery(QueryView):

+     tables: _Tables

+     joinmap: _JoinMap

+     fieldmap: _FieldMap

+     default_fields: _DefaultFields

+ 

+ def get_task_runs(

+         clauses: Optional[_Clauses] = None,

+         fields: Optional[_Fields] = None):

+     ...

+ 

+ class TaskScheduler:

+     hosts_by_bin: dict[str, list[_HostInfo]]

+     hosts: dict[int, _HostInfo]

+     active_tasks: list[dict]

+     free_tasks: Iterable[dict]

+     maxjobs: int

+     capacity_overcommit: int

+     ready_timeout: int

+     assign_timeout: int

+     soft_refusal_timeout: int

+     host_timeout: int

+     run_interval: int

+     def __init__(self) -> None: ...

+     def run(self, force: bool = False) -> bool: ...

+     def check_ts(self) -> bool: ...

+     def do_schedule(self) -> None: ...

+     def check_active_tasks(self) -> None: ...

+     def check_hosts(self) -> None: ...

+     def get_active_runs(self) -> dict[int, list[_TaskRun]]: ...

+     def get_tasks(self) -> None: ...

+     def get_refusals(self) -> dict[int, dict]: ...

+     def get_hosts(self) -> None: ...

+     def assign(

+             self,

+             task = dict[str, int], # just task_id for now

+             host = _HostInfo,

+             force: bool = False,

+             override: bool = False):

+         ...

+ 

+ def do_assign(

+     task_id: int,

+     host: int,

+     force: bool = False,

+     override: bool = False):

+     ...

+ 

+ class SchedulerExports:

+     getTaskRuns: Callable

+     getTaskRefusals: Callable

+     getHostData: Callable

+     getLogMessages: Callable

+     def doRun(self, force: bool = False) -> bool: ...

file added
+2
@@ -0,0 +1,2 @@ 

+ partial

+ 

file modified
+2 -1
@@ -69,7 +69,8 @@ 

          'koji_cli_plugins': 'plugins/cli',

      },

      package_data={

-         '': ['README.md'],

+         '': ['README.md', 'py.typed'],

+         'koji': ["*.pyi"],

      },

      # doesn't make sense, as we have only example config

      # data_files=[

@mikem @cobrien I've used koji-smoky-dingo as a baseline, reused types directly in stub files, so they don't interfere with the code. If you think it is okish, I'll update also packaging. It seems that normal practice is really to install it to site-packages alongside with .py files.

Btw, main usecase is writing koji scripts. So, ClientSession "bundles" signatures for API calls as in koji-smoky-dingo.

If you're going to distribute, you may also want to add the py.typed file to the distribution to let consumers of the package have their mypy also honor the stubs

https://peps.python.org/pep-0561/#packaging-type-information

Something else I noticed which you may need to update: the ClientSession.getTaskInfo will need to be modified from what's in this PR.

reference:
https://github.com/obriencj/koji-smoky-dingo/blob/master/stubs/koji/__init__.pyi#L459

Something else I noticed which you may need to update: the ClientSession.getTaskInfo will need to be modified from what's in this PR.

It is now corresponding to real API - it is doing more than what is in docstring :-( I'll file separate PR to update that API doc.

I mean to say that the behavior isn't represented correctly when using Union[int,List[int]] as the argument type. typing offers an overload decorator which says essentially "when called with these argument types, you get this result type; when called with these different argument types, you get this different result type" which is how getTaskInfo truly behaves

That's why there are two definitions for getTaskInfo in the KSD variation of the .pyi. mypy verification gets quite unhappy when using the union form instead of the overload form

https://docs.python.org/3/library/typing.html#typing.overload

Ah, nice - I wasn't aware of this.

1 new commit added

  • overload getTaskInfo
2 years ago

rebased onto ca97aa9eae5b4bc8e3c9feb78383e19688938e63

2 years ago

Since the .typi files were accidentally included in the 1.33 wheel on PyPI, I got a chance to Beta test them. Looking forward to having this officially!

Hit a few problems though:

  • ClientSession.listBuilds() returns _BuildInfos which is Collection[_BuildInfo], Collection only has __contains__, __iter__, __len__, but my code did something vaguely similar to build = session.listBuilds(..., 'queryOpts': {'order': '-completion_ts'})[0]. IMO, all list returns should be List[type] (general principle to take generic types, return concrete types.)

  • But on other side, it's a problem that chainMaven takes Collection[_BuildInfos], since xmlrpmc wants specifically a list to marshal. (Not a problem I hit in practice, just looking how BuildInfos is used.)

  • koji.PathInfo.build/rpm are specified as taking _BuildInfo, _RpmInfo, but it can be useful to do .e.g: koji.PathInfo.build({"name": .., "version": ..., "release": ...) without doing a server roundtrip to get all the fields. To get more type safety than a dict, could do class _NVRInfo(TypedDict) with just name/version/release, and make build() take that. With both pyright and mpypy, you'd be able to pass a _BuildInfo into the function since it has a superset of the fields.

  • BaseTaskHandler.run_callbacks() is specified with *args: list, **kwargs: dict, but that means that non-kwarg arguments all have list values, and the kwargs dict arguments (https://peps.python.org/pep-0484/#arbitrary-argument-lists-and-default-argument-values)
    What was meant was probably: *args: Any, **kwargs: Any

  • BaseTaskHandler.__init__ has options: dict, but options is not a dict, it's optparse.Values.

  • koji.DEP_* and koji.RPMSENSE_* constants are missing. (And other constants. To declare a constant in a stub, it is sufficent to do CONSTANT: int)

rebased onto 20f3b10e2154a9ebf115d4b98987da65866d70cb

2 years ago

Thanks! Added some updates (+rebase).

rebased onto 1ccb7fa2708b3fb9bb05a507beee7aabcd87ca23

2 years ago

1 new commit added

  • remove unused import
2 years ago

Not sure what should be the best python 3.x version to stuck with.

rebased onto ef29ebccce737a3d9198ea9a2bf2ef5cad23b9f0

2 years ago

rebased onto 89bfce95e6e4099bfd32530d5559c91cbcca8663

a year ago

rebased onto e83eb0d

11 months ago

I've moved it to https://github.com/tkopecek/koji-stubs for now. It is just a copy of files - needs packaging, etc.

Pull-Request has been closed by tkopecek

7 months ago