Skip to content

Commit cf7239f

Browse files
authored
Merge pull request #92 from common-workflow-language/emoij_workaround
Workaround for Py2 emoji issues
2 parents 7352fed + 1924c38 commit cf7239f

File tree

5 files changed

+52
-2
lines changed

5 files changed

+52
-2
lines changed

cwltest/utils.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
import json
22

3+
from six import PY2
34
from six.moves import range
45
from typing import Any, Dict, Set, Text, List, Optional
56

67
import junit_xml
8+
if PY2:
9+
from emoji.core import demojize
10+
711
REQUIRED = "required"
812

913

14+
def clean_output(output): # type: (Text) -> Text
15+
if PY2:
16+
return demojize(output)
17+
else:
18+
return output
19+
1020
class TestResult(object):
1121

1222
"""Encapsulate relevant test result data."""
@@ -30,7 +40,8 @@ def create_test_case(self, test):
3040
short_name = test.get(u'short_name')
3141
case = junit_xml.TestCase(
3242
doc, elapsed_sec=self.duration, file=short_name,
33-
category=category, stdout=self.standard_output, stderr=self.error_output,
43+
category=category, stdout=clean_output(self.standard_output),
44+
stderr=self.error_output,
3445
)
3546
if self.return_code > 0:
3647
case.failure_message = self.message

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
version='1.0',
3030
description='Common workflow language testing framework',
3131
long_description=open(README).read(),
32+
long_description_content_type="text/x-rst",
3233
author='Common workflow language working group',
3334
author_email='[email protected]',
3435
url="https://github.com/common-workflow-language/cwltest",
@@ -49,6 +50,6 @@
4950
cmdclass={'egg_info': tagger},
5051
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4',
5152
extras_require={':python_version<"3"': [
52-
'futures >= 3.0.5', 'subprocess32 >= 3.5.0'],
53+
'futures >= 3.0.5', 'subprocess32 >= 3.5.0', 'emoji'],
5354
':python_version<"3.5"': ['typing >= 3.5.2'] }
5455
)

typeshed/2.7/emoji/__init__.pyi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Stubs for emoji (Python 2)
2+
#
3+
# NOTE: This dynamically typed stub was automatically generated by stubgen.
4+
5+
from emoji.core import emojize
6+
from emoji.core import demojize
7+
from emoji.core import get_emoji_regexp
8+
from emoji.unicode_codes import EMOJI_ALIAS_UNICODE
9+
from emoji.unicode_codes import EMOJI_UNICODE
10+
from emoji.unicode_codes import UNICODE_EMOJI
11+
from emoji.unicode_codes import UNICODE_EMOJI_ALIAS
12+
13+
__email__: str
14+
__source__: str
15+
__license__: str
16+
17+

typeshed/2.7/emoji/core.pyi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Stubs for emoji.core (Python 3)
2+
#
3+
# NOTE: This dynamically typed stub was automatically generated by stubgen.
4+
5+
from typing import Any, Text
6+
7+
def emojize(string: Text, use_aliases: bool = ..., delimiters: Any = ...): ...
8+
def demojize(string: Text, delimiters: Any = ...): ...
9+
def get_emoji_regexp(): ...
10+
def emoji_lis(string: Any): ...
11+

typeshed/2.7/emoji/unicode_codes.pyi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Stubs for emoji.unicode_codes (Python 3)
2+
#
3+
# NOTE: This dynamically typed stub was automatically generated by stubgen.
4+
5+
from typing import Any
6+
7+
EMOJI_UNICODE: Any
8+
EMOJI_ALIAS_UNICODE: Any
9+
UNICODE_EMOJI: Any
10+
UNICODE_EMOJI_ALIAS: Any

0 commit comments

Comments
 (0)