matlab-proxy 0.15.0__py3-none-any.whl → 0.15.1__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.

Files changed (35) hide show
  1. matlab_proxy/app.py +13 -7
  2. matlab_proxy/gui/asset-manifest.json +3 -3
  3. matlab_proxy/gui/index.html +1 -1
  4. matlab_proxy/gui/static/js/{main.14aa7840.js → main.ff1bfd69.js} +3 -3
  5. matlab_proxy/gui/static/js/main.ff1bfd69.js.map +1 -0
  6. matlab_proxy/util/__init__.py +8 -1
  7. {matlab_proxy-0.15.0.dist-info → matlab_proxy-0.15.1.dist-info}/METADATA +1 -1
  8. {matlab_proxy-0.15.0.dist-info → matlab_proxy-0.15.1.dist-info}/RECORD +34 -14
  9. tests/integration/integration_tests_without_license/test_matlab_is_down_if_unlicensed.py +3 -0
  10. tests/unit/__init__.py +1 -0
  11. tests/unit/conftest.py +67 -0
  12. tests/unit/test_app.py +1113 -0
  13. tests/unit/test_app_state.py +582 -0
  14. tests/unit/test_constants.py +5 -0
  15. tests/unit/test_ddux.py +22 -0
  16. tests/unit/test_devel.py +246 -0
  17. tests/unit/test_non_dev_mode.py +169 -0
  18. tests/unit/test_settings.py +460 -0
  19. tests/unit/util/__init__.py +3 -0
  20. tests/unit/util/mwi/__init__.py +1 -0
  21. tests/unit/util/mwi/embedded_connector/__init__.py +1 -0
  22. tests/unit/util/mwi/embedded_connector/test_helpers.py +29 -0
  23. tests/unit/util/mwi/embedded_connector/test_request.py +64 -0
  24. tests/unit/util/mwi/test_custom_http_headers.py +281 -0
  25. tests/unit/util/mwi/test_logger.py +49 -0
  26. tests/unit/util/mwi/test_token_auth.py +289 -0
  27. tests/unit/util/mwi/test_validators.py +331 -0
  28. tests/unit/util/test_mw.py +550 -0
  29. tests/unit/util/test_util.py +135 -0
  30. matlab_proxy/gui/static/js/main.14aa7840.js.map +0 -1
  31. /matlab_proxy/gui/static/js/{main.14aa7840.js.LICENSE.txt → main.ff1bfd69.js.LICENSE.txt} +0 -0
  32. {matlab_proxy-0.15.0.dist-info → matlab_proxy-0.15.1.dist-info}/LICENSE.md +0 -0
  33. {matlab_proxy-0.15.0.dist-info → matlab_proxy-0.15.1.dist-info}/WHEEL +0 -0
  34. {matlab_proxy-0.15.0.dist-info → matlab_proxy-0.15.1.dist-info}/entry_points.txt +0 -0
  35. {matlab_proxy-0.15.0.dist-info → matlab_proxy-0.15.1.dist-info}/top_level.txt +0 -0
@@ -3,6 +3,7 @@
3
3
  import argparse
4
4
  import os
5
5
  import socket
6
+ import time
6
7
 
7
8
  from pathlib import Path
8
9
 
@@ -198,7 +199,9 @@ def get_child_processes(parent_process):
198
199
  # to get hold child processes
199
200
  parent_process_psutil = psutil.Process(parent_process.pid)
200
201
 
201
- while True:
202
+ max_attempts = 10
203
+ child_processes = None
204
+ for _ in range(max_attempts):
202
205
  try:
203
206
  # Before checking for any child processes, ensure that the parent process is running
204
207
  assert (
@@ -216,6 +219,10 @@ def get_child_processes(parent_process):
216
219
 
217
220
  if child_processes:
218
221
  break
222
+ time.sleep(0.1)
223
+
224
+ if not child_processes:
225
+ raise RuntimeError("No child processes found after multiple attempts.")
219
226
 
220
227
  return child_processes
221
228
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: matlab-proxy
3
- Version: 0.15.0
3
+ Version: 0.15.1
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.
@@ -1,14 +1,14 @@
1
1
  matlab_proxy/__init__.py,sha256=6cwi8buKCMtw9OeWaOYUHEoqwl5MyJ_s6GxgNuqPuNg,1673
2
- matlab_proxy/app.py,sha256=ABCfuYtHE6zoVm3fUkNdaFMUvbKx8n53JOM5WeklWjo,33584
2
+ matlab_proxy/app.py,sha256=-QcfNOCyXAQu58Gq-bSU4iHtJrVglxgD0c-n6nTzumo,33819
3
3
  matlab_proxy/app_state.py,sha256=HV4_igTkUVf-CQWPKc7s3z4Ea_MkSBbV7k3I-AG-m28,55374
4
4
  matlab_proxy/constants.py,sha256=k9vESSF1HSrr2-tCgIEomJ47Q7UR4wbrMCWzZnLLoPc,924
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=YjchyZAzvLfl-CiwxAPtSaTTo7aRgD6inS4-jZmsuNY,24687
8
8
  matlab_proxy/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- matlab_proxy/gui/asset-manifest.json,sha256=0eynKD0QHNdOgsiH3IuXXNkRQph4sd_QV4S89qocW2k,3516
9
+ matlab_proxy/gui/asset-manifest.json,sha256=2i4oSd9fAzwDgW_jBPUrOvvrelhiEh0iUIXge7tpVZ4,3516
10
10
  matlab_proxy/gui/favicon.ico,sha256=7w7Ki1uQP2Rgwc64dOV4-NrTu97I3WsZw8OvRSoY1A0,130876
11
- matlab_proxy/gui/index.html,sha256=IxsvWXcW8bVcVPdnnMQoolow1BFirTUyCo-O9uYGYTQ,637
11
+ matlab_proxy/gui/index.html,sha256=iSRij24ekBNqZqWd0urs_FUmEs9lrbf9mIBMpLXNlB0,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.47712126.css,sha256=OT5ccyC0a6fVg956C-8b6uDVbZZVgcpXbHjdO6v4ZBI,274313
17
17
  matlab_proxy/gui/static/css/main.47712126.css.map,sha256=RdfmXfQvzvvh4XZuDWShm8CD8pA2Gb2K6MtMzrgJyKM,350495
18
18
  matlab_proxy/gui/static/js/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- matlab_proxy/gui/static/js/main.14aa7840.js,sha256=Eu6ZKinNe4gYoD1KV-CsYDJHg0DNKVq4-Qxy2sT2A-U,294128
20
- matlab_proxy/gui/static/js/main.14aa7840.js.LICENSE.txt,sha256=3cj3DrwM51esz1ogL9VVU1ZyXyXJ6u-Ec2CI9CCcI_A,1689
21
- matlab_proxy/gui/static/js/main.14aa7840.js.map,sha256=JbKOBbRaQIVoticAYynd6nEc1msGas1RXxnzvA1eWDs,935545
19
+ matlab_proxy/gui/static/js/main.ff1bfd69.js,sha256=hu8hJKKivhC7JHB7mRjzRf1bz503WR5fX7FiIPhdPJ4,294194
20
+ matlab_proxy/gui/static/js/main.ff1bfd69.js.LICENSE.txt,sha256=3cj3DrwM51esz1ogL9VVU1ZyXyXJ6u-Ec2CI9CCcI_A,1689
21
+ matlab_proxy/gui/static/js/main.ff1bfd69.js.map,sha256=y7nJxSw1bPSVkRLkIoFB6WxvoTGwbUR26MlqSz8mQ5U,937068
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
@@ -53,7 +53,7 @@ matlab_proxy/gui/static/media/trigger-error.3f1c4ef23ab8f3e60b0e.svg,sha256=3zzT
53
53
  matlab_proxy/gui/static/media/trigger-ok.7b9c238be42f685c4fa7.svg,sha256=mD-7N9cc4ARdMBFcplnogJv6nA4Yh3jQuYbZDUi18LU,4997
54
54
  matlab_proxy/icons/matlab.svg,sha256=xh5uYebQd8I-ISvenjU9A-PkClzW_lU9wvm3doXOFKM,13366
55
55
  matlab_proxy/matlab/startup.m,sha256=YRtI8P2flDJSDcPxJ2008B2l1T9JpqiUbzhQxA0frbc,1558
56
- matlab_proxy/util/__init__.py,sha256=bRfvYEbxsaiYhtWq5imTZM7PRrSEJ7GTlVBptvunaYQ,7902
56
+ matlab_proxy/util/__init__.py,sha256=ikj07VxQdIThUWzWLOrdIsO-R1VtEhunB0mjrfnD5jE,8114
57
57
  matlab_proxy/util/event_loop.py,sha256=Zqd282jlvPHHyc4kg8IjIzlzh9zLM_SAc5xjqUOrm04,1144
58
58
  matlab_proxy/util/list_servers.py,sha256=M93coVZjyQCdIvCCxsNOU_XDWNjBSysOJ5tWXaTjP8Y,1369
59
59
  matlab_proxy/util/mw.py,sha256=dLGSdfcTZiwKR1MMZA-39o-8na13IEPZOGBqcaHmKVI,11086
@@ -76,15 +76,35 @@ tests/integration/integration_tests_with_license/conftest.py,sha256=sCaIXB8d4vf0
76
76
  tests/integration/integration_tests_with_license/test_http_end_points.py,sha256=fDA2VyauxM8x0Gw9ArZLI4YFOVduX6Wg-UiHdr5tmHk,7411
77
77
  tests/integration/integration_tests_without_license/__init__.py,sha256=vVYZCur-QhmIGCxUmn-WZjIywtDQidaLDmlmrRHRlgY,37
78
78
  tests/integration/integration_tests_without_license/conftest.py,sha256=z5r_hALWo7Lh0kyN-h1N2oCj1jIug3-0RXQm92XTtPI,3426
79
- tests/integration/integration_tests_without_license/test_matlab_is_down_if_unlicensed.py,sha256=Nd87UkEjZk6eh_3y8VybKrB0uQUErw90w_Jnu02OHXY,1536
79
+ tests/integration/integration_tests_without_license/test_matlab_is_down_if_unlicensed.py,sha256=tkdyhfZBpfJpbnEzjURyV-GE0p43YxOa9xooJf-JoM4,1653
80
80
  tests/integration/utils/__init__.py,sha256=ttzJ8xKWGxOJZz56qOiWOn6sp5LGomkZMn_w4KJLRMU,42
81
81
  tests/integration/utils/integration_tests_utils.py,sha256=IbJ9CedFHiz3k85FBY-8GwotTnjPF3jF4AHdKio7jqk,10321
82
82
  tests/integration/utils/licensing.py,sha256=rEBjvMXO8R3mL6KnePu2lojmOsjD4GXl9frf9N0Wacs,4842
83
+ tests/unit/__init__.py,sha256=KfwQxxM5a1kMRtNbhz8tb7YfHp8e2d0tNLB55wYvDS8,37
84
+ tests/unit/conftest.py,sha256=Hfxq3h8IZuLJkRMh5jdEFiq78CIAdKvm-6KryRDZ0FY,1918
85
+ tests/unit/test_app.py,sha256=0JK5xak31wIC_of5fNAtoCgi6E-z4JR-AAqtIlNAZ0k,37313
86
+ tests/unit/test_app_state.py,sha256=M1jsEVfg4XnseQ_PSJjcCm40extosayRaA7NzdJ9FkY,18596
87
+ tests/unit/test_constants.py,sha256=ZSsj1-xHrlqxhnjv2x2een6E_U2vSCONoQVWO_QpbYI,124
88
+ tests/unit/test_ddux.py,sha256=a2J2iM8j_nnfJVuMI38p5AjwrRdoMj3N88gFgS2I4hg,713
89
+ tests/unit/test_devel.py,sha256=A-1iVhSSwmywaW65QIRcUS2Fk7nJxceCcCm7CJtNdEc,7982
90
+ tests/unit/test_non_dev_mode.py,sha256=0v27y27SLOWvw6jf_GhLLNg-RMsZS_OyGAnqoQYPpSA,5515
91
+ tests/unit/test_settings.py,sha256=6KuYcOIqilR5RmaYxHw5mr_4CqDS3iMsouS-IrT9wGk,16644
92
+ tests/unit/util/__init__.py,sha256=GInSQBb2SoVD5LZfmSCQa9-UZJT_UP-jNfrojkgCybU,87
93
+ tests/unit/util/test_mw.py,sha256=YC4mjn6G6_XuHELt8uW9F6g2K0_fWtQl1R0kWFvWbAo,18565
94
+ tests/unit/util/test_util.py,sha256=jhZOgErpD6b3JeusLBOPVvu6iZ3_ttwlEVV8uKLUvrw,5060
95
+ tests/unit/util/mwi/__init__.py,sha256=pl5jqyCHEwZEviiL8OC-SHulb1rBecstQCFF6qVjL9Y,37
96
+ tests/unit/util/mwi/test_custom_http_headers.py,sha256=UfrhclS0j6WhShtg1ki2oF1kK8JqRC29uevH4tuDqF4,11182
97
+ tests/unit/util/mwi/test_logger.py,sha256=zWImNitMYKPJunXWJjEDEtCEKwBz615PC844ZLwoxIg,1845
98
+ tests/unit/util/mwi/test_token_auth.py,sha256=-G5u4tFYefhzb-W4tTS-F4HxNYxNNrPa0FOLncHjMN8,10173
99
+ tests/unit/util/mwi/test_validators.py,sha256=YeOP0-T7SFNeiC7JIQj7cV4ja3d6PhswsTz27IEgJHQ,10852
100
+ tests/unit/util/mwi/embedded_connector/__init__.py,sha256=pl5jqyCHEwZEviiL8OC-SHulb1rBecstQCFF6qVjL9Y,37
101
+ tests/unit/util/mwi/embedded_connector/test_helpers.py,sha256=vYTWNUTuDeaygo16JGMTvWeI_CLOnvPkwNJmLndvJhE,890
102
+ tests/unit/util/mwi/embedded_connector/test_request.py,sha256=PR-jddnXDEiip-lD7A_QSvRwEkwo3eQ8owZlk-r9vnk,1867
83
103
  tests/utils/__init__.py,sha256=ttzJ8xKWGxOJZz56qOiWOn6sp5LGomkZMn_w4KJLRMU,42
84
104
  tests/utils/logging_util.py,sha256=VBy_NRvwau3C_CVTBjK5RMROrQimnJYHO2U0aKSZiRw,2234
85
- matlab_proxy-0.15.0.dist-info/LICENSE.md,sha256=oF0h3UdSF-rlUiMGYwi086ZHqelzz7yOOk9HFDv9ELo,2344
86
- matlab_proxy-0.15.0.dist-info/METADATA,sha256=TFAiv_gJ5Mt79rX7mf8RPrIMkU6uvYRGaRA4_zTWDHw,10108
87
- matlab_proxy-0.15.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
88
- matlab_proxy-0.15.0.dist-info/entry_points.txt,sha256=DbBLYgnRt8UGiOpd0zHigRTyyMdZYhMdvCvSYP7wPN0,244
89
- matlab_proxy-0.15.0.dist-info/top_level.txt,sha256=9uVTjsUCAS4TwsxueTBxrBg3PdBiTSsYowAkHPv9VY0,19
90
- matlab_proxy-0.15.0.dist-info/RECORD,,
105
+ matlab_proxy-0.15.1.dist-info/LICENSE.md,sha256=oF0h3UdSF-rlUiMGYwi086ZHqelzz7yOOk9HFDv9ELo,2344
106
+ matlab_proxy-0.15.1.dist-info/METADATA,sha256=P95V-BiQ49UlFBPIFIEwMm_gpjfFmutEHKBW3VMPH-Q,10108
107
+ matlab_proxy-0.15.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
108
+ matlab_proxy-0.15.1.dist-info/entry_points.txt,sha256=DbBLYgnRt8UGiOpd0zHigRTyyMdZYhMdvCvSYP7wPN0,244
109
+ matlab_proxy-0.15.1.dist-info/top_level.txt,sha256=9uVTjsUCAS4TwsxueTBxrBg3PdBiTSsYowAkHPv9VY0,19
110
+ matlab_proxy-0.15.1.dist-info/RECORD,,
@@ -6,6 +6,9 @@ import requests
6
6
  from requests.adapters import HTTPAdapter, Retry
7
7
  from tests.integration.utils import integration_tests_utils as utils
8
8
  from urllib.parse import urlparse
9
+ from tests.utils.logging_util import create_integ_test_logger
10
+
11
+ _logger = create_integ_test_logger(log_name=__name__)
9
12
 
10
13
 
11
14
  def test_matlab_down(parse_matlab_proxy_url):
tests/unit/__init__.py ADDED
@@ -0,0 +1 @@
1
+ # Copyright 2024 The MathWorks, Inc.
tests/unit/conftest.py ADDED
@@ -0,0 +1,67 @@
1
+ # Copyright 2020-2022 The MathWorks, Inc.
2
+
3
+ """ The conftest.py file is run by the pytest framework for setting things up for the test session.
4
+ """
5
+
6
+ import os
7
+ import shutil
8
+ import asyncio
9
+
10
+ import pytest
11
+ from matlab_proxy import settings, util
12
+ from matlab_proxy.util.mwi import environment_variables as mwi_env
13
+
14
+
15
+ def pytest_generate_tests(metafunc):
16
+ os.environ[mwi_env.get_env_name_development()] = "true"
17
+
18
+
19
+ def __get_matlab_config_file():
20
+ return settings.get(dev=True)["matlab_config_file"]
21
+
22
+
23
+ def __delete_matlab_config_file():
24
+ os.remove(__get_matlab_config_file())
25
+
26
+
27
+ @pytest.fixture(autouse=True, scope="session")
28
+ def pre_test_cleanup():
29
+ """A pytest fixture which deletes matlab_config_file before executing tests.
30
+
31
+ If a previous pytest run fails, this file may have an empty Dict which leads
32
+ to the server never starting up matlab.
33
+ """
34
+ try:
35
+ __delete_matlab_config_file()
36
+ except FileNotFoundError:
37
+ pass
38
+
39
+
40
+ @pytest.fixture(scope="session", autouse=True)
41
+ def cleanup(request):
42
+ """Cleanup the temp directory once we are finished."""
43
+
44
+ def delete_matlab_test_dir():
45
+ # Delete matlab_config_file & its owning directory
46
+ matlab_config_file = __get_matlab_config_file()
47
+ matlab_config_dir = os.path.dirname(matlab_config_file)
48
+ try:
49
+ shutil.rmtree(matlab_config_dir)
50
+ except FileNotFoundError:
51
+ pass
52
+
53
+ request.addfinalizer(delete_matlab_test_dir)
54
+
55
+
56
+ @pytest.fixture(scope="session")
57
+ def event_loop():
58
+ """Overriding the default event loop of pytest. Intended for windows systems for
59
+ python <= 3.7 where WindowsSelectorEvent Loop is the default event loop. For
60
+ python >= 3.8, WindowsProactorEvent Loop is the default.
61
+
62
+ Yields:
63
+ asyncio.loop: WindowsProactorEvent loop in Windows or UnixSelectorEventLoop in posix.
64
+ """
65
+ loop = util.get_event_loop()
66
+ yield loop
67
+ loop.close()