File: entrypoints.pyi

package info (click to toggle)
typeshed 0.0~git20221107.4f381af-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 18,036 kB
  • sloc: python: 3,216; sh: 62; makefile: 13
file content (53 lines) | stat: -rw-r--r-- 1,734 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import sys
from _typeshed import Self
from collections.abc import Iterator, Sequence
from configparser import ConfigParser
from typing import Any

if sys.version_info >= (3, 8):
    from re import Pattern
else:
    from re import Pattern

entry_point_pattern: Pattern[str]
file_in_zip_pattern: Pattern[str]

class BadEntryPoint(Exception):
    epstr: str
    def __init__(self, epstr: str) -> None: ...
    @staticmethod
    def err_to_warnings() -> Iterator[None]: ...

class NoSuchEntryPoint(Exception):
    group: str
    name: str
    def __init__(self, group: str, name: str) -> None: ...

class CaseSensitiveConfigParser(ConfigParser): ...

class EntryPoint:
    name: str
    module_name: str
    object_name: str
    extras: Sequence[str] | None
    distro: Distribution | None
    def __init__(
        self, name: str, module_name: str, object_name: str, extras: Sequence[str] | None = ..., distro: Distribution | None = ...
    ) -> None: ...
    def load(self) -> Any: ...
    @classmethod
    def from_string(cls: type[Self], epstr: str, name: str, distro: Distribution | None = ...) -> Self: ...

class Distribution:
    name: str
    version: str
    def __init__(self, name: str, version: str) -> None: ...
    @classmethod
    def from_name_version(cls: type[Self], name: str) -> Self: ...

def iter_files_distros(
    path: Sequence[str] | None = ..., repeated_distro: str = ...
) -> Iterator[tuple[ConfigParser, Distribution | None]]: ...
def get_single(group: str, name: str, path: Sequence[str] | None = ...) -> EntryPoint: ...
def get_group_named(group: str, path: Sequence[str] | None = ...) -> dict[str, EntryPoint]: ...
def get_group_all(group: str, path: Sequence[str] | None = ...) -> list[EntryPoint]: ...