Remove Python 2 support from entrypoints (#7711)

This commit is contained in:
Sebastian Rittau
2022-04-27 11:47:50 +02:00
committed by GitHub
parent e916fb5f1e
commit 6245bc7432
2 changed files with 22 additions and 27 deletions

View File

@@ -1,2 +1 @@
version = "0.3.*"
python2 = true

View File

@@ -1,6 +1,7 @@
import sys
from _typeshed import Self
from typing import Any, Iterator, Sequence, Text
from collections.abc import Iterator, Sequence
from typing import Any
if sys.version_info >= (3, 0):
from configparser import ConfigParser
@@ -12,46 +13,41 @@ if sys.version_info >= (3, 8):
else:
from typing import Pattern
entry_point_pattern: Pattern[Text]
file_in_zip_pattern: Pattern[Text]
entry_point_pattern: Pattern[str]
file_in_zip_pattern: Pattern[str]
class BadEntryPoint(Exception):
epstr: Text
def __init__(self, epstr: Text) -> None: ...
epstr: str
def __init__(self, epstr: str) -> None: ...
@staticmethod
def err_to_warnings() -> Iterator[None]: ...
class NoSuchEntryPoint(Exception):
group: Text
name: Text
def __init__(self, group: Text, name: Text) -> None: ...
group: str
name: str
def __init__(self, group: str, name: str) -> None: ...
class EntryPoint:
name: Text
module_name: Text
object_name: Text
extras: Sequence[Text] | None
name: str
module_name: str
object_name: str
extras: Sequence[str] | None
distro: Distribution | None
def __init__(
self,
name: Text,
module_name: Text,
object_name: Text,
extras: Sequence[Text] | None = ...,
distro: Distribution | None = ...,
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: Text, name: Text, distro: Distribution | None = ...) -> Self: ...
def from_string(cls: type[Self], epstr: str, name: str, distro: Distribution | None = ...) -> Self: ...
class Distribution:
name: Text
version: Text
def __init__(self, name: Text, version: Text) -> None: ...
name: str
version: str
def __init__(self, name: str, version: str) -> None: ...
def iter_files_distros(
path: Sequence[Text] | None = ..., repeated_distro: Text = ...
path: Sequence[str] | None = ..., repeated_distro: str = ...
) -> Iterator[tuple[ConfigParser, Distribution | None]]: ...
def get_single(group: Text, name: Text, path: Sequence[Text] | None = ...) -> EntryPoint: ...
def get_group_named(group: Text, path: Sequence[Text] | None = ...) -> dict[str, EntryPoint]: ...
def get_group_all(group: Text, path: Sequence[Text] | None = ...) -> list[EntryPoint]: ...
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]: ...