Skip to content

Commit 26f7fa3

Browse files
author
Dorian Birraux
committed
Merge pull request #249 in LCL/wolframclientforpython from feature/release-1-1-6 to master
* commit '46623d243c59834aa74c05ae4744e5ab5ceb3638': refactor update changelog fix outdated test update version to 1.1.6
2 parents 6284e0d + 46623d2 commit 26f7fa3

5 files changed

Lines changed: 17 additions & 61 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
# Version 1.1.3
1+
# Version 1.1.5 and 1.1.6
2+
- update Wolfram Language code with latest addition from 12.3.
3+
- fix various deprecated naming convention in class names.
4+
5+
# Version 1.1.4
26
- Async cloud evaluator based on `aiohttp` now use `certifi` to create a default `SSLContext` if none is provided. Other cloud evaluator are based on the `requests` module which also uses this library.
37
- Updating dependency list accordingly in `setup.py`. `certifi` was already listed as a `requests` dependency, so this should have no direct impact on user site package.
8+
49
# Version 1.1.3
510
- Update asynchronous evaluator classes. Remove the `loop` parameter. Most optional loop parameters are deprecated in the Python standart library `asyncio` and in most libraries, mainly because it is misleading and lead to misuses and bugs. The loop parameter is useful when instantiating asynchronous evaluators outside the scope of an event loop. It's implementation was not good enough and was relying on usages deprecated in 3.8.
611
- Removing four asynchronous generators in asynchronous evaluation result classes: `iter_messages`, `iter_messages_name`, `iter_messages_tuple` and `iter_output`. These coroutines are only working on python 3.6+ and are not critical enough to drop support for 3.5. Asynchronous properties: `messages`, `messages_name` and `output` provide the same information.

wolframclient/about.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
__name__ = "wolframclient"
44
__description__ = "A Python library with various tools to interact with the Wolfram Language and the Wolfram Cloud."
5-
__version__ = "1.1.5"
5+
__version__ = "1.1.6"
66
__author__ = "Wolfram Research"
77
__author_email__ = "support@wolfram.com, dorianb@wolfram.com, riccardod@wolfram.com"

wolframclient/cli/commands/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def dependencies():
1818
yield "pyzmq"
1919
yield "requests"
2020
yield "unittest-xml-reporting"
21-
yield 'certifi>=2017.4.17'
21+
yield "certifi>=2017.4.17"
22+
2223

2324
class Command(SimpleCommand):
2425
""" Run test suites from the tests modules.

wolframclient/cli/commands/start_externalevaluate.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ def handle(self, port=None, installpath=None, **opts):
2424
try:
2525
zmq.Context
2626
except ImportError as e:
27-
print("Error importing zmq: %s. Please install zmq. https://zeromq.org/languages/python/" % e, file=sys.stderr)
27+
print(
28+
"Error importing zmq: %s. Please install zmq. https://zeromq.org/languages/python/"
29+
% e,
30+
file=sys.stderr,
31+
)
2832
sys.stderr.flush()
2933
sys.exit(1)
3034

wolframclient/tests/externalevaluate/ev_loop.py

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,12 @@
33
from threading import Thread
44

55
import zmq
6+
67
from wolframclient.language import wl
78
from wolframclient.serializers import export
8-
from wolframclient.utils.externalevaluate import EXPORT_KWARGS, StdoutProxy, start_zmq_loop
9+
from wolframclient.utils.externalevaluate import EXPORT_KWARGS, start_zmq_loop
910
from wolframclient.utils.tests import TestCase as BaseTestCase
1011

11-
STRING = "foo"
12-
STRING_NEWLINE = "abc\nABC"
13-
STRING_MULTILINE = """first
14-
second
15-
third
16-
"""
17-
18-
1912
class TestCase(BaseTestCase):
2013
def compare(self, string_version, result):
2114
self.assertEqual(string_version, export(result, **EXPORT_KWARGS))
@@ -27,7 +20,7 @@ def test_zmq_loop(self):
2720
messages = [("a = 2", wl.Null), ("a", 2)]
2821

2922
def threaded_function(port=port, message_limit=len(messages)):
30-
start_zmq_loop(port=port, message_limit=message_limit, write_to_stdout=False)
23+
start_zmq_loop(port=port, message_limit=message_limit)
3124

3225
thread = Thread(target=threaded_function)
3326
thread.start()
@@ -42,50 +35,3 @@ def threaded_function(port=port, message_limit=len(messages)):
4235
msg = client.recv()
4336

4437
self.compare(msg, result)
45-
46-
def test_stdout_proxy(self):
47-
48-
output = []
49-
50-
class TestStdoutProxy(StdoutProxy):
51-
def send_lines(self, *lines):
52-
# this custom class makes us test that strings are sent correctly
53-
# without dealing with Print and exported code
54-
output.extend(lines)
55-
56-
proxy = TestStdoutProxy(None)
57-
proxy.write(STRING)
58-
59-
self.assertEqual(output, [])
60-
61-
proxy.write("\n")
62-
63-
self.assertEqual(output, ["foo"])
64-
65-
proxy.write(STRING)
66-
67-
self.assertEqual(output, ["foo"])
68-
69-
proxy.write(STRING_NEWLINE)
70-
71-
self.assertEqual(output, ["foo", "fooabc"])
72-
73-
proxy.write(STRING_NEWLINE)
74-
75-
self.assertEqual(output, ["foo", "fooabc", "ABCabc"])
76-
77-
proxy.write(STRING_MULTILINE)
78-
79-
self.assertEqual(output, ["foo", "fooabc", "ABCabc", "ABCfirst", "second", "third"])
80-
81-
proxy.write(STRING_NEWLINE)
82-
83-
self.assertEqual(
84-
output, ["foo", "fooabc", "ABCabc", "ABCfirst", "second", "third", "abc"]
85-
)
86-
87-
proxy.flush()
88-
89-
self.assertEqual(
90-
output, ["foo", "fooabc", "ABCabc", "ABCfirst", "second", "third", "abc", "ABC"]
91-
)

0 commit comments

Comments
 (0)