15
0
forked from pool/python-emoji

Accepting request 910392 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/910392
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-emoji?expand=0&rev=10
This commit is contained in:
2021-08-06 20:44:48 +00:00
committed by Git OBS Bridge
5 changed files with 39 additions and 6 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:496f432058567985838c13d67dde84ca081614a8286c0b9cdc7d63dfa89d51a3
size 131476

3
emoji-1.4.2.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:21257f311e24468031e85685867c00b87249dc7612b82dc763a771ba5fb00c01
size 184985

22
fix-python2.patch Normal file
View File

@@ -0,0 +1,22 @@
From: Matthias Bach <marix@marix.org>
Date: 2021-07-31 11:57:53 2021 +0200
Subject: Fix matching of non-ASCII emoji names on Python 2
References: https://github.com/carpedm20/emoji/pull/181
Upstream: merged
A fix to get the tests passing for the French language in 1.4.1 sadly was incomplete and only worked for Python 3. This extends the patch to also work on Python 2.
diff --git a/emoji/core.py b/emoji/core.py
index 7221937..ade232e 100644
--- a/emoji/core.py
+++ b/emoji/core.py
@@ -55,7 +55,7 @@ def emojize(
Python is fun ❤️ #red heart, not black heart
"""
EMOJI_UNICODE = unicode_codes.EMOJI_UNICODE[language]
- pattern = re.compile(u'(%s[\\w\\-&.’”“()!#*+?,/]+%s)' % delimiters)
+ pattern = re.compile(u'(%s[\\w\\-&.’”“()!#*+?,/]+%s)' % delimiters, flags=re.UNICODE)
def replace(match):
mg = match.group(1).replace(delimiters[0], _DEFAULT_DELIMITER).replace(

View File

@@ -1,3 +1,14 @@
-------------------------------------------------------------------
Wed Aug 4 19:23:18 UTC 2021 - Matthias Bach <marix@marix.org> - 1.4.2
- Update to 1.4.2
* Added support for German naming of emojis.
* Added support for French naming of emojis.
* Added new function `replace_emoji` which strips emojis from
output.
- Add patch `fix-python2.patch`: Fixes unicode emoji names on Python
2.
-------------------------------------------------------------------
Wed Jan 27 19:45:51 UTC 2021 - Matthias Bach <marix@marix.org> - 1.2.0

View File

@@ -18,14 +18,14 @@
Name: python-emoji
Version: 1.2.0
Version: 1.4.2
Release: 0
Summary: Emoji for Python
License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://github.com/carpedm20/emoji/
Source: https://files.pythonhosted.org/packages/source/e/emoji/emoji-%{version}.tar.gz
# https://github.com/carpedm20/emoji/pull/118
Patch1: fix-python2.patch
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
@@ -47,7 +47,7 @@ Python is 👍
By default, the language is English (``language='en'``) but Spanish (``'es'``), Portuguese (``'pt'``) and Italian (``'it'``) are also supported.
%prep
%setup -q -n emoji-%{version}
%autosetup -n emoji-%{version} -p1
%build
%python_build