matlab-proxy 0.19.0__py3-none-any.whl → 0.20.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of matlab-proxy might be problematic. Click here for more details.
- matlab_proxy/app.py +22 -15
- matlab_proxy/gui/asset-manifest.json +3 -3
- matlab_proxy/gui/index.html +1 -1
- matlab_proxy/gui/static/js/{main.e07799e7.js → main.9c68c75c.js} +3 -3
- matlab_proxy/gui/static/js/main.9c68c75c.js.map +1 -0
- matlab_proxy/util/mwi/logger.py +22 -2
- matlab_proxy/util/windows.py +4 -1
- {matlab_proxy-0.19.0.dist-info → matlab_proxy-0.20.0.dist-info}/METADATA +15 -15
- {matlab_proxy-0.19.0.dist-info → matlab_proxy-0.20.0.dist-info}/RECORD +15 -15
- {matlab_proxy-0.19.0.dist-info → matlab_proxy-0.20.0.dist-info}/WHEEL +1 -1
- tests/unit/util/mwi/test_logger.py +38 -4
- matlab_proxy/gui/static/js/main.e07799e7.js.map +0 -1
- /matlab_proxy/gui/static/js/{main.e07799e7.js.LICENSE.txt → main.9c68c75c.js.LICENSE.txt} +0 -0
- {matlab_proxy-0.19.0.dist-info → matlab_proxy-0.20.0.dist-info}/LICENSE.md +0 -0
- {matlab_proxy-0.19.0.dist-info → matlab_proxy-0.20.0.dist-info}/entry_points.txt +0 -0
- {matlab_proxy-0.19.0.dist-info → matlab_proxy-0.20.0.dist-info}/top_level.txt +0 -0
matlab_proxy/util/mwi/logger.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2020-
|
|
1
|
+
# Copyright 2020-2024 The MathWorks, Inc.
|
|
2
2
|
"""Functions to access & control the logging behavior of the app
|
|
3
3
|
"""
|
|
4
4
|
|
|
@@ -52,7 +52,17 @@ def __set_logging_configuration():
|
|
|
52
52
|
# query for user specified environment variables
|
|
53
53
|
log_level = os.getenv(
|
|
54
54
|
mwi_env.get_env_name_logging_level(), __get_default_log_level()
|
|
55
|
-
)
|
|
55
|
+
).upper()
|
|
56
|
+
|
|
57
|
+
valid = __is_valid_log_level(log_level)
|
|
58
|
+
|
|
59
|
+
if not valid:
|
|
60
|
+
default_log_level = __get_default_log_level()
|
|
61
|
+
logging.warn(
|
|
62
|
+
f"Unknown log level '{log_level}' set. Defaulting to log level '{default_log_level}'..."
|
|
63
|
+
)
|
|
64
|
+
log_level = default_log_level
|
|
65
|
+
|
|
56
66
|
log_file = os.getenv(mwi_env.get_env_name_log_file(), None)
|
|
57
67
|
|
|
58
68
|
## Set logging object
|
|
@@ -110,3 +120,13 @@ def __get_default_log_level():
|
|
|
110
120
|
String: The default logging level
|
|
111
121
|
"""
|
|
112
122
|
return "INFO"
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def __is_valid_log_level(log_level):
|
|
126
|
+
"""Helper to check if the log level is valid.
|
|
127
|
+
|
|
128
|
+
Returns:
|
|
129
|
+
Boolean: Whether log level exists
|
|
130
|
+
"""
|
|
131
|
+
|
|
132
|
+
return hasattr(logging, log_level)
|
matlab_proxy/util/windows.py
CHANGED
|
@@ -49,10 +49,13 @@ async def start_matlab(matlab_cmd, matlab_env):
|
|
|
49
49
|
"""
|
|
50
50
|
import psutil
|
|
51
51
|
|
|
52
|
+
# The stdout is used to suppress the MATLAB outputs from being shown in the terminal.
|
|
53
|
+
# We set it to DEVNULL instead of PIPE because PIPE has a limited buffer size and can
|
|
54
|
+
# block the process if the output exceeds the buffer limit.
|
|
52
55
|
intermediate_proc = await asyncio.create_subprocess_exec(
|
|
53
56
|
*matlab_cmd,
|
|
54
57
|
env=matlab_env,
|
|
55
|
-
stdout=asyncio.subprocess.
|
|
58
|
+
stdout=asyncio.subprocess.DEVNULL,
|
|
56
59
|
stderr=asyncio.subprocess.STDOUT,
|
|
57
60
|
)
|
|
58
61
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: matlab-proxy
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.20.0
|
|
4
4
|
Summary: Python® package enables you to launch MATLAB® and access it from a web browser.
|
|
5
5
|
Home-page: https://github.com/mathworks/matlab-proxy/
|
|
6
6
|
Author: The MathWorks, Inc.
|
|
@@ -17,24 +17,24 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
18
|
Requires-Python: ~=3.8
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
|
-
Requires-Dist: aiohttp
|
|
20
|
+
Requires-Dist: aiohttp>=3.7.4
|
|
21
21
|
Requires-Dist: aiohttp-session[secure]
|
|
22
22
|
Requires-Dist: importlib-metadata
|
|
23
23
|
Requires-Dist: importlib-resources
|
|
24
24
|
Requires-Dist: psutil
|
|
25
25
|
Provides-Extra: dev
|
|
26
|
-
Requires-Dist: aiohttp-devtools
|
|
27
|
-
Requires-Dist: black
|
|
28
|
-
Requires-Dist: pytest
|
|
29
|
-
Requires-Dist: pytest-env
|
|
30
|
-
Requires-Dist: pytest-cov
|
|
31
|
-
Requires-Dist: pytest-timeout
|
|
32
|
-
Requires-Dist: pytest-mock
|
|
33
|
-
Requires-Dist: pytest-aiohttp
|
|
34
|
-
Requires-Dist: psutil
|
|
35
|
-
Requires-Dist: urllib3
|
|
36
|
-
Requires-Dist: requests
|
|
37
|
-
Requires-Dist: pytest-playwright
|
|
26
|
+
Requires-Dist: aiohttp-devtools; extra == "dev"
|
|
27
|
+
Requires-Dist: black; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-env; extra == "dev"
|
|
30
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
31
|
+
Requires-Dist: pytest-timeout; extra == "dev"
|
|
32
|
+
Requires-Dist: pytest-mock; extra == "dev"
|
|
33
|
+
Requires-Dist: pytest-aiohttp; extra == "dev"
|
|
34
|
+
Requires-Dist: psutil; extra == "dev"
|
|
35
|
+
Requires-Dist: urllib3; extra == "dev"
|
|
36
|
+
Requires-Dist: requests; extra == "dev"
|
|
37
|
+
Requires-Dist: pytest-playwright; extra == "dev"
|
|
38
38
|
|
|
39
39
|
# MATLAB Proxy
|
|
40
40
|
[](https://github.com/mathworks/matlab-proxy/actions) [](https://pypi.python.org/pypi/matlab-proxy) [](https://codecov.io/gh/mathworks/matlab-proxy) [](https://pepy.tech/project/matlab-proxy)
|
|
@@ -201,7 +201,7 @@ $ pip install --upgrade matlab-proxy>=0.5.0
|
|
|
201
201
|
|
|
202
202
|
### Windows Subsystem for Linux (WSL 2)
|
|
203
203
|
|
|
204
|
-
To install `matlab-proxy` in WSL 2, follow the steps mentioned in the [Installation Guide for WSL 2](./
|
|
204
|
+
To install `matlab-proxy` in WSL 2, follow the steps mentioned in the [Installation Guide for WSL 2](./install_guides/wsl2/README.md).
|
|
205
205
|
|
|
206
206
|
## Using an already activated MATLAB with matlab-proxy
|
|
207
207
|
`matlab-proxy` version `v0.7.0` introduces support for using an existing MATLAB license. Use the Existing License option only if you have an activated MATLAB. This allows you to start MATLAB without authenticating every time.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
matlab_proxy/__init__.py,sha256=6cwi8buKCMtw9OeWaOYUHEoqwl5MyJ_s6GxgNuqPuNg,1673
|
|
2
|
-
matlab_proxy/app.py,sha256=
|
|
2
|
+
matlab_proxy/app.py,sha256=0conSbbVwaYdWtbA_ZTUk2lLDZYsLIBQiBqNKYj0rho,34713
|
|
3
3
|
matlab_proxy/app_state.py,sha256=pt6s3Yy6NV6LB-GxT1Y4cOpeDaTFMm_ItN_qPstDTwE,71296
|
|
4
4
|
matlab_proxy/constants.py,sha256=-gEUNjBATe3_4Cd7CN-VhkEn-iMRfiZ-zdDDD6fM_II,1161
|
|
5
5
|
matlab_proxy/default_configuration.py,sha256=DxQaHzAivzstiPl_nDfxs8SOyP9oaK9v3RP4LtroJl4,843
|
|
6
6
|
matlab_proxy/devel.py,sha256=nR6XPVBUEdQ-RZGtYvX1YHTp8gj9cuw5Hp8ahasMBc8,14310
|
|
7
7
|
matlab_proxy/settings.py,sha256=Jrk6vkYCKt-cFogkkNpfMcEzZcrDgzfeHqSl6ndgkUA,26722
|
|
8
8
|
matlab_proxy/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
matlab_proxy/gui/asset-manifest.json,sha256=
|
|
9
|
+
matlab_proxy/gui/asset-manifest.json,sha256=FIqY-YJXdswnTR3PplkXTm1ovUWpvfsN9EvnweOFJaA,3516
|
|
10
10
|
matlab_proxy/gui/favicon.ico,sha256=7w7Ki1uQP2Rgwc64dOV4-NrTu97I3WsZw8OvRSoY1A0,130876
|
|
11
|
-
matlab_proxy/gui/index.html,sha256=
|
|
11
|
+
matlab_proxy/gui/index.html,sha256=g044AdWTU8FxXh9klGlneK8YF4swSUr_A8ZNe5mG6kk,637
|
|
12
12
|
matlab_proxy/gui/manifest.json,sha256=NwDbrALM5auYyj2bbEf4aGwAUDqNl1FzMFQpPiG2Ty4,286
|
|
13
13
|
matlab_proxy/gui/robots.txt,sha256=kNJLw79pisHhc3OVAimMzKcq3x9WT6sF9IS4xI0crdI,67
|
|
14
14
|
matlab_proxy/gui/static/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -16,9 +16,9 @@ matlab_proxy/gui/static/css/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
|
|
|
16
16
|
matlab_proxy/gui/static/css/main.da9c4eb8.css,sha256=etg2mMerqvNiYKBJgve5vBUc-X8ZnnCVnf5gc-DMaPA,274453
|
|
17
17
|
matlab_proxy/gui/static/css/main.da9c4eb8.css.map,sha256=favITMsubUPvF7E0vWcdc2RXJ9Pj5ljIWdPuhSBfDVU,351326
|
|
18
18
|
matlab_proxy/gui/static/js/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
-
matlab_proxy/gui/static/js/main.
|
|
20
|
-
matlab_proxy/gui/static/js/main.
|
|
21
|
-
matlab_proxy/gui/static/js/main.
|
|
19
|
+
matlab_proxy/gui/static/js/main.9c68c75c.js,sha256=iJwMC3mRnN8nVfU1tv4nkDQ0P5lp7ziT6Q0mupcchPk,298434
|
|
20
|
+
matlab_proxy/gui/static/js/main.9c68c75c.js.LICENSE.txt,sha256=3cj3DrwM51esz1ogL9VVU1ZyXyXJ6u-Ec2CI9CCcI_A,1689
|
|
21
|
+
matlab_proxy/gui/static/js/main.9c68c75c.js.map,sha256=VUnC1tai6A0N5CaBcyXMLlcy2eo_30-JcCTnq6uLqhM,955703
|
|
22
22
|
matlab_proxy/gui/static/media/MATLAB-env-blur.4fc94edbc82d3184e5cb.png,sha256=QpmQTLDvBu2-b7ev83Rvpt0Q72R6wdQGkuJMPPpjv7M,220290
|
|
23
23
|
matlab_proxy/gui/static/media/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
24
|
matlab_proxy/gui/static/media/arrow.0c2968b90bd9a64c8c3f.svg,sha256=XtmvDWzGZnwCZm08TKBnqt5hc1wphJnNupG0Fx_faAY,327
|
|
@@ -59,13 +59,13 @@ matlab_proxy/util/event_loop.py,sha256=sX_0tKlirCY5ImLxkss_XO4Ksj65u6JHtwMj25oGL
|
|
|
59
59
|
matlab_proxy/util/list_servers.py,sha256=M93coVZjyQCdIvCCxsNOU_XDWNjBSysOJ5tWXaTjP8Y,1369
|
|
60
60
|
matlab_proxy/util/mw.py,sha256=dLGSdfcTZiwKR1MMZA-39o-8na13IEPZOGBqcaHmKVI,11086
|
|
61
61
|
matlab_proxy/util/system.py,sha256=XoT3Rv5MwPkdfhk2oMvUwxxlzZmADMlxzi9IRQyGgbA,1692
|
|
62
|
-
matlab_proxy/util/windows.py,sha256=
|
|
62
|
+
matlab_proxy/util/windows.py,sha256=_5gl2IyHIfw8-D3_G5uHkycZVGGFVXtjkd6_aP3g2Ts,3785
|
|
63
63
|
matlab_proxy/util/mwi/__init__.py,sha256=zI-X1lafr8H3j17PyA0oSZ0q5nINfK-WDA7VmJKmSAQ,158
|
|
64
64
|
matlab_proxy/util/mwi/custom_http_headers.py,sha256=kfDjSnEXEVzoF2pZuEn76LKayeD2WKoQEDu2Y9EMOAo,7154
|
|
65
65
|
matlab_proxy/util/mwi/download.py,sha256=-GJj3yOsL4vF_9baqRXkgBI-vu_OwjZMQVkJXFS8GMc,4965
|
|
66
66
|
matlab_proxy/util/mwi/environment_variables.py,sha256=sOfmL8PjQONgkJdegdotLbsqHsWJDsjS7kak0TJtVKU,7441
|
|
67
67
|
matlab_proxy/util/mwi/exceptions.py,sha256=3jklFU6br2_pSSsATCRDY3A5fTzk6ekJ4M69sunwxBk,5114
|
|
68
|
-
matlab_proxy/util/mwi/logger.py,sha256=
|
|
68
|
+
matlab_proxy/util/mwi/logger.py,sha256=EHHr6OWlXe6yVX0RPh57HSE7lz6MhWmwLQIpe_SlsC0,3803
|
|
69
69
|
matlab_proxy/util/mwi/token_auth.py,sha256=UbIWqo7qADaZdijFvorLYsZbxzaB8TycGP8nk305ru0,9997
|
|
70
70
|
matlab_proxy/util/mwi/validators.py,sha256=br-22Gyef_vxVSSH2Qkb97Nfph9sfl7fyhQ8-LWkBP4,12600
|
|
71
71
|
matlab_proxy/util/mwi/embedded_connector/__init__.py,sha256=Vfl2hNC7V1IwoK9_wrwfENs4BC8P-Mvvqh4BNGi2n48,119
|
|
@@ -96,7 +96,7 @@ tests/unit/util/test_util.py,sha256=gecUFSVIg4a9s3Ljl0A7eSSY5jN4vH668CbjnTpi198,
|
|
|
96
96
|
tests/unit/util/mwi/__init__.py,sha256=pl5jqyCHEwZEviiL8OC-SHulb1rBecstQCFF6qVjL9Y,37
|
|
97
97
|
tests/unit/util/mwi/test_custom_http_headers.py,sha256=UfrhclS0j6WhShtg1ki2oF1kK8JqRC29uevH4tuDqF4,11182
|
|
98
98
|
tests/unit/util/mwi/test_download.py,sha256=jYwPJFYGrPKqnkIJW42XYSe1fowmzChAkOx0k0xVldo,4779
|
|
99
|
-
tests/unit/util/mwi/test_logger.py,sha256=
|
|
99
|
+
tests/unit/util/mwi/test_logger.py,sha256=2VFoVlMLgsSWtDn0iVxHNArGBfN-IgWehuoaLvWlS6U,3151
|
|
100
100
|
tests/unit/util/mwi/test_token_auth.py,sha256=-eBsaQ5JC7pyd9PXt48Rqs4cWjg6I-eOkp_gFVEwYhk,10538
|
|
101
101
|
tests/unit/util/mwi/test_validators.py,sha256=rzSmifQdPWZ5ZjecShBpC_RYL55_smCsG248h2JzUDU,11467
|
|
102
102
|
tests/unit/util/mwi/embedded_connector/__init__.py,sha256=pl5jqyCHEwZEviiL8OC-SHulb1rBecstQCFF6qVjL9Y,37
|
|
@@ -104,9 +104,9 @@ tests/unit/util/mwi/embedded_connector/test_helpers.py,sha256=vYTWNUTuDeaygo16JG
|
|
|
104
104
|
tests/unit/util/mwi/embedded_connector/test_request.py,sha256=PR-jddnXDEiip-lD7A_QSvRwEkwo3eQ8owZlk-r9vnk,1867
|
|
105
105
|
tests/utils/__init__.py,sha256=ttzJ8xKWGxOJZz56qOiWOn6sp5LGomkZMn_w4KJLRMU,42
|
|
106
106
|
tests/utils/logging_util.py,sha256=VBy_NRvwau3C_CVTBjK5RMROrQimnJYHO2U0aKSZiRw,2234
|
|
107
|
-
matlab_proxy-0.
|
|
108
|
-
matlab_proxy-0.
|
|
109
|
-
matlab_proxy-0.
|
|
110
|
-
matlab_proxy-0.
|
|
111
|
-
matlab_proxy-0.
|
|
112
|
-
matlab_proxy-0.
|
|
107
|
+
matlab_proxy-0.20.0.dist-info/LICENSE.md,sha256=oF0h3UdSF-rlUiMGYwi086ZHqelzz7yOOk9HFDv9ELo,2344
|
|
108
|
+
matlab_proxy-0.20.0.dist-info/METADATA,sha256=xQBYP0FaWmdGuubXOWSYQs-EhU61M1A139fkywkLbvg,10166
|
|
109
|
+
matlab_proxy-0.20.0.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
|
110
|
+
matlab_proxy-0.20.0.dist-info/entry_points.txt,sha256=DbBLYgnRt8UGiOpd0zHigRTyyMdZYhMdvCvSYP7wPN0,244
|
|
111
|
+
matlab_proxy-0.20.0.dist-info/top_level.txt,sha256=9uVTjsUCAS4TwsxueTBxrBg3PdBiTSsYowAkHPv9VY0,19
|
|
112
|
+
matlab_proxy-0.20.0.dist-info/RECORD,,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2020-
|
|
1
|
+
# Copyright 2020-2024 The MathWorks, Inc.
|
|
2
2
|
"""This file tests methods present in matlab_proxy/util/mwi_logger.py
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import logging
|
|
6
6
|
import os
|
|
7
|
-
|
|
7
|
+
import pytest
|
|
8
8
|
from matlab_proxy.util.mwi import logger as mwi_logger
|
|
9
9
|
|
|
10
10
|
|
|
@@ -22,7 +22,7 @@ def test_get_mw_logger_name():
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
def test_get_with_no_environment_variables(monkeypatch):
|
|
25
|
-
"""This test checks if the get method returns a logger with default settings"""
|
|
25
|
+
"""This test checks if the get method returns a logger with default settings if no environment variable is set"""
|
|
26
26
|
# Delete the environment variables if they do exist
|
|
27
27
|
env_names_list = mwi_logger.get_environment_variable_names()
|
|
28
28
|
monkeypatch.delenv(env_names_list[0], raising=False)
|
|
@@ -34,7 +34,7 @@ def test_get_with_no_environment_variables(monkeypatch):
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
def test_get_with_environment_variables(monkeypatch, tmp_path):
|
|
37
|
-
"""This test checks if the get method returns a logger with
|
|
37
|
+
"""This test checks if the get method returns a logger with the specified settings"""
|
|
38
38
|
env_names_list = mwi_logger.get_environment_variable_names()
|
|
39
39
|
monkeypatch.setenv(env_names_list[0], "CRITICAL")
|
|
40
40
|
monkeypatch.setenv(env_names_list[1], str(tmp_path / "testing123.log"))
|
|
@@ -47,3 +47,37 @@ def test_get_with_environment_variables(monkeypatch, tmp_path):
|
|
|
47
47
|
# Verify that environment variable setting the file is respected
|
|
48
48
|
assert len(logger.handlers) == 1
|
|
49
49
|
assert os.path.basename(logger.handlers[0].baseFilename) == "testing123.log"
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@pytest.mark.parametrize(
|
|
53
|
+
"log_level, expected_level",
|
|
54
|
+
[
|
|
55
|
+
("DEBUG", logging.DEBUG),
|
|
56
|
+
("INFO", logging.INFO),
|
|
57
|
+
("WARNING", logging.WARNING),
|
|
58
|
+
("debug", logging.DEBUG),
|
|
59
|
+
("info", logging.INFO),
|
|
60
|
+
("warning", logging.WARNING),
|
|
61
|
+
],
|
|
62
|
+
)
|
|
63
|
+
def test_set_logging_configuration_known_logging_levels(
|
|
64
|
+
monkeypatch, log_level, expected_level
|
|
65
|
+
):
|
|
66
|
+
"""This test checks if the logger is set with correct level for known log levels"""
|
|
67
|
+
env_names_list = mwi_logger.get_environment_variable_names()
|
|
68
|
+
monkeypatch.setenv(env_names_list[0], log_level)
|
|
69
|
+
logger = mwi_logger.get(init=True)
|
|
70
|
+
assert (
|
|
71
|
+
logger.isEnabledFor(expected_level) == True
|
|
72
|
+
), f"Error in initialising the logger with {log_level}"
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@pytest.mark.parametrize("log_level", ["ABC", "abc"])
|
|
76
|
+
def test_set_logging_configuration_unknown_logging_levels(monkeypatch, log_level):
|
|
77
|
+
"""This test checks if the logger is set with INFO level for unknown log levels"""
|
|
78
|
+
env_names_list = mwi_logger.get_environment_variable_names()
|
|
79
|
+
monkeypatch.setenv(env_names_list[0], log_level)
|
|
80
|
+
logger = mwi_logger.get(init=True)
|
|
81
|
+
assert (
|
|
82
|
+
logger.isEnabledFor(logging.INFO) == True
|
|
83
|
+
), "Error in initialising the default logger"
|