Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
refactor: update emoji package to 2.0.0
Fix: #8359
  • Loading branch information
Kevin Kirsche
Kevin Kirsche committed Jul 28, 2022
commit 57edd4d662a6832f7c070402c203fa11a9b75111
2 changes: 1 addition & 1 deletion stubs/emoji/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "1.7.*"
version = "2.0.*"

[tool.stubtest]
ignore_missing_stub = false
50 changes: 26 additions & 24 deletions stubs/emoji/emoji/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
from .core import (
from emoji.core import (
emojize as emojize,
demojize as demojize,
distinct_emoji_lis as distinct_emoji_lis,
distinct_emoji_list as distinct_emoji_list,
emoji_count as emoji_count,
emoji_lis as emoji_lis,
emoji_list as emoji_list,
emojize as emojize,
get_emoji_regexp as get_emoji_regexp,
is_emoji as is_emoji,
distinct_emoji_list as distinct_emoji_list,
replace_emoji as replace_emoji,
version as version,
is_emoji as is_emoji,
)
from .unicode_codes import (
EMOJI_ALIAS_UNICODE_ENGLISH as EMOJI_ALIAS_UNICODE_ENGLISH,
EMOJI_DATA as EMOJI_DATA,
EMOJI_UNICODE_ENGLISH as EMOJI_UNICODE_ENGLISH,
EMOJI_UNICODE_FRENCH as EMOJI_UNICODE_FRENCH,
EMOJI_UNICODE_GERMAN as EMOJI_UNICODE_GERMAN,
EMOJI_UNICODE_ITALIAN as EMOJI_UNICODE_ITALIAN,
EMOJI_UNICODE_PORTUGUESE as EMOJI_UNICODE_PORTUGUESE,
EMOJI_UNICODE_SPANISH as EMOJI_UNICODE_SPANISH,
UNICODE_EMOJI_ALIAS_ENGLISH as UNICODE_EMOJI_ALIAS_ENGLISH,
UNICODE_EMOJI_ENGLISH as UNICODE_EMOJI_ENGLISH,
UNICODE_EMOJI_FRENCH as UNICODE_EMOJI_FRENCH,
UNICODE_EMOJI_GERMAN as UNICODE_EMOJI_GERMAN,
UNICODE_EMOJI_ITALIAN as UNICODE_EMOJI_ITALIAN,
UNICODE_EMOJI_PORTUGUESE as UNICODE_EMOJI_PORTUGUESE,
UNICODE_EMOJI_SPANISH as UNICODE_EMOJI_SPANISH,
)
from emoji.unicode_codes import EMOJI_DATA, STATUS, LANGUAGES

__all__ = [
# emoji.core
"emojize",
"demojize",
"emoji_count",
"emoji_list",
"distinct_emoji_list",
"replace_emoji",
"version",
"is_emoji",
# emoji.unicode_codes
"EMOJI_DATA",
"STATUS",
"LANGUAGES",
]
__version__: str
__author__: str
__email__: str
__source__: str
__license__: str
16 changes: 3 additions & 13 deletions stubs/emoji/emoji/core.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
from collections.abc import Callable
from re import Pattern
from re import Pattern, Match
from typing_extensions import Literal, TypedDict

_DEFAULT_DELIMITER: str

class _DeprecatedParameter: ...

class _EmojiLisReturn(TypedDict):
emoji: str
location: int
Expand All @@ -17,31 +15,23 @@ class _EmojiListReturn(TypedDict):

def emojize(
string: str,
use_aliases: bool | type[_DeprecatedParameter] = ...,
delimiters: tuple[str, str] = ...,
variant: Literal["text_type", "emoji_type", None] = ...,
language: str = ...,
version: float | None = ...,
handle_version: str | Callable[[str, dict[str, str]], str] | None = ...,
) -> str: ...
def replace(match: Match[str]) -> str: ...
def demojize(
string: str,
use_aliases: bool | type[_DeprecatedParameter] = ...,
delimiters: tuple[str, str] = ...,
language: str = ...,
version: float | None = ...,
handle_version: str | Callable[[str, dict[str, str]], str] | None = ...,
) -> str: ...
def replace_emoji(
string: str,
replace: str | Callable[[str, dict[str, str]], str] = ...,
language: str | type[_DeprecatedParameter] = ...,
version: float | None = ...,
) -> str: ...
def replace_emoji(string: str, replace: str | Callable[[str, dict[str, str]], str] = ..., version: float | None = ...) -> str: ...
Comment thread
kkirsche marked this conversation as resolved.
Outdated
def get_emoji_regexp(language: str | None = ...) -> Pattern[str]: ...
def emoji_lis(string: str, language: str | type[_DeprecatedParameter] = ...) -> list[_EmojiLisReturn]: ...
def emoji_list(string: str) -> list[_EmojiListReturn]: ...
def distinct_emoji_lis(string: str, language: str | type[_DeprecatedParameter] = ...) -> list[str]: ...
def distinct_emoji_list(string: str) -> list[str]: ...
def emoji_count(string: str, unique: bool = ...) -> int: ...
def version(string: str) -> float: ...
Expand Down
29 changes: 5 additions & 24 deletions stubs/emoji/emoji/unicode_codes/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,26 +1,7 @@
EMOJI_ALIAS_UNICODE_ENGLISH: dict[str, str]
EMOJI_UNICODE_ENGLISH: dict[str, str]
UNICODE_EMOJI_ENGLISH: dict[str, str]
UNICODE_EMOJI_ALIAS_ENGLISH: dict[str, str]
from _typeshed import Incomplete
from .data_dict import EMOJI_DATA as EMOJI_DATA, STATUS as STATUS, LANGUAGES as LANGUAGES

EMOJI_UNICODE_GERMAN: dict[str, str]
UNICODE_EMOJI_GERMAN: dict[str, str]
__all__ = ["get_emoji_unicode_dict", "get_aliases_unicode_dict", "EMOJI_DATA", "STATUS", "LANGUAGES"]

EMOJI_UNICODE_SPANISH: dict[str, str]
UNICODE_EMOJI_SPANISH: dict[str, str]

EMOJI_UNICODE_FRENCH: dict[str, str]
UNICODE_EMOJI_FRENCH: dict[str, str]

EMOJI_UNICODE_ITALIAN: dict[str, str]
UNICODE_EMOJI_ITALIAN: dict[str, str]

EMOJI_UNICODE_PORTUGUESE: dict[str, str]
UNICODE_EMOJI_PORTUGUESE: dict[str, str]

EMOJI_UNICODE: dict[str, dict[str, str]]
UNICODE_EMOJI: dict[str, dict[str, str]]

EMOJI_DATA: dict[str, dict[str, str]]

STATUS: dict[str, int]
def get_emoji_unicode_dict(lang: str) -> Incomplete: ...
Comment thread
kkirsche marked this conversation as resolved.
Outdated
def get_aliases_unicode_dict() -> dict[str, str]: ...
6 changes: 4 additions & 2 deletions stubs/emoji/emoji/unicode_codes/data_dict.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from _typeshed import Incomplete

STATUS: Incomplete
EMOJI_DATA: Incomplete
__all__ = ["EMOJI_DATA", "STATUS", "LANGUAGES"]
STATUS: dict[str, int]
LANGUAGES: list[str]
EMOJI_DATA: dict[str, dict[str, Incomplete]]