matlab-proxy 0.23.3__py3-none-any.whl → 0.24.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 (55) hide show
  1. matlab_proxy/app_state.py +32 -7
  2. matlab_proxy/gui/index.html +20 -1
  3. matlab_proxy/gui/static/css/index.BSVLACuY.css +10 -0
  4. matlab_proxy/gui/static/js/index.Cm14Eqsb.js +64 -0
  5. matlab_proxy/util/mwi/embedded_connector/helpers.py +2 -2
  6. matlab_proxy/util/mwi/embedded_connector/request.py +1 -1
  7. matlab_proxy/util/mwi/logger.py +1 -2
  8. {matlab_proxy-0.23.3.dist-info → matlab_proxy-0.24.1.dist-info}/METADATA +2 -2
  9. {matlab_proxy-0.23.3.dist-info → matlab_proxy-0.24.1.dist-info}/RECORD +38 -53
  10. matlab_proxy_manager/lib/api.py +21 -18
  11. matlab_proxy_manager/storage/server.py +26 -1
  12. tests/unit/conftest.py +1 -2
  13. tests/unit/test_app_state.py +1 -1
  14. tests/unit/util/mwi/test_logger.py +1 -2
  15. matlab_proxy/gui/asset-manifest.json +0 -44
  16. matlab_proxy/gui/static/css/main.efa05ff9.css +0 -13
  17. matlab_proxy/gui/static/css/main.efa05ff9.css.map +0 -1
  18. matlab_proxy/gui/static/js/main.ce0f5505.js +0 -3
  19. matlab_proxy/gui/static/js/main.ce0f5505.js.LICENSE.txt +0 -59
  20. matlab_proxy/gui/static/js/main.ce0f5505.js.map +0 -1
  21. matlab_proxy/gui/static/media/arrow.0c2968b90bd9a64c8c3f.svg +0 -4
  22. matlab_proxy/gui/static/media/feedback.6e8d50eb812cf35e0e76.svg +0 -1
  23. matlab_proxy/gui/static/media/gripper.9defbc5e76d0de8bb6e0.svg +0 -1
  24. matlab_proxy/gui/static/media/help.15e5bfab03a2b9c7148e.svg +0 -1
  25. matlab_proxy/gui/static/media/ico-header-contact-hover.0958c44200d781def822.svg +0 -17
  26. matlab_proxy/gui/static/media/ico-header-contact.ae9169c8dcae37c6e04b.svg +0 -17
  27. matlab_proxy/gui/static/media/restart.7987508a01e84678361a.svg +0 -1
  28. matlab_proxy/gui/static/media/sign-out.08356b675ec854afaa77.svg +0 -1
  29. matlab_proxy/gui/static/media/start.50c4596fab2049b4a3a3.svg +0 -1
  30. matlab_proxy/gui/static/media/stop.30c9a9ab6d625032235a.svg +0 -1
  31. matlab_proxy/gui/static/media/terminate.7ea1363ee0fa72344ef6.svg +0 -1
  32. /matlab_proxy/gui/static/media/{MATLAB-env-blur.4fc94edbc82d3184e5cb.png → MATLAB-env-blur.NupTbPv_.png} +0 -0
  33. /matlab_proxy/gui/static/media/{glyphicons-halflings-regular.82b1212e45a2bc35dd73.woff → glyphicons-halflings-regular.BKjkU69z.woff} +0 -0
  34. /matlab_proxy/gui/static/media/{glyphicons-halflings-regular.5be1347c682810f199c7.eot → glyphicons-halflings-regular.BUJKDMgK.eot} +0 -0
  35. /matlab_proxy/gui/static/media/{glyphicons-halflings-regular.060b2710bdbbe3dfe48b.svg → glyphicons-halflings-regular.CSehLiBc.svg} +0 -0
  36. /matlab_proxy/gui/static/media/{glyphicons-halflings-regular.4692b9ec53fd5972caa2.ttf → glyphicons-halflings-regular.DrwTMapi.ttf} +0 -0
  37. /matlab_proxy/gui/static/media/{glyphicons-halflings-regular.be810be3a3e14c682a25.woff2 → glyphicons-halflings-regular.DzqM6ju8.woff2} +0 -0
  38. /matlab_proxy/gui/static/media/{ico-header-account-hover.89438e91d0632893b106.svg → ico-header-account-hover.-jQHo6Wx.svg} +0 -0
  39. /matlab_proxy/gui/static/media/{ico-header-account.86b10d7b4a2a511f6ca9.svg → ico-header-account.CJCFoo5a.svg} +0 -0
  40. /matlab_proxy/gui/static/media/{ico-sprite.cbdb66c0ea4c2a7fd21c.png → ico-sprite.DXGLgzq9.png} +0 -0
  41. /matlab_proxy/gui/static/media/{mathworks-eps.4d20e0ee46ea74bccfc1.ttf → mathworks-eps.CGNQALa9.ttf} +0 -0
  42. /matlab_proxy/gui/static/media/{mathworks-eps.df1428dfa69cea896c05.svg → mathworks-eps.DrkCtQtG.svg} +0 -0
  43. /matlab_proxy/gui/static/media/{mathworks-eps.e5c41e8478df02cbdce1.woff → mathworks-eps.Ds7lQbql.woff} +0 -0
  44. /matlab_proxy/gui/static/media/{mathworks-pictograms.3fc6513a06dce552eeb1.woff → mathworks-pictograms.BdqxEfBR.woff} +0 -0
  45. /matlab_proxy/gui/static/media/{mathworks-pictograms.f6f087b008b5a9435f26.svg → mathworks-pictograms.CCLweoD4.svg} +0 -0
  46. /matlab_proxy/gui/static/media/{mathworks-pictograms.6e128c0e7fc1a11f92ee.ttf → mathworks-pictograms.DZhFdRSm.ttf} +0 -0
  47. /matlab_proxy/gui/static/media/{mathworks.80a3218e1ba29f0573fb.svg → mathworks.C-qsbhDy.svg} +0 -0
  48. /matlab_proxy/gui/static/media/{mathworks.c422935b9ae545ac2ab5.ttf → mathworks.Ceplx86V.ttf} +0 -0
  49. /matlab_proxy/gui/static/media/{mathworks.37a563ef6aeda1593bf6.woff → mathworks.D08X1Vp8.woff} +0 -0
  50. /matlab_proxy/gui/static/media/{trigger-error.3f1c4ef23ab8f3e60b0e.svg → trigger-error.QEdsGL-m.svg} +0 -0
  51. /matlab_proxy/gui/static/media/{trigger-ok.7b9c238be42f685c4fa7.svg → trigger-ok.Dzg8OIrk.svg} +0 -0
  52. {matlab_proxy-0.23.3.dist-info → matlab_proxy-0.24.1.dist-info}/LICENSE.md +0 -0
  53. {matlab_proxy-0.23.3.dist-info → matlab_proxy-0.24.1.dist-info}/WHEEL +0 -0
  54. {matlab_proxy-0.23.3.dist-info → matlab_proxy-0.24.1.dist-info}/entry_points.txt +0 -0
  55. {matlab_proxy-0.23.3.dist-info → matlab_proxy-0.24.1.dist-info}/top_level.txt +0 -0
matlab_proxy/app_state.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2020-2024 The MathWorks, Inc.
1
+ # Copyright 2020-2025 The MathWorks, Inc.
2
2
 
3
3
  import asyncio
4
4
  import contextlib
@@ -436,8 +436,10 @@ class AppState:
436
436
 
437
437
  else:
438
438
  await self.matlab_state_updater_lock.release()
439
- await self._update_matlab_state_based_on_ready_file_and_connector_status(
440
- matlab_endpoint_to_use
439
+ await (
440
+ self._update_matlab_state_based_on_ready_file_and_connector_status(
441
+ matlab_endpoint_to_use
442
+ )
441
443
  )
442
444
  logger.debug(
443
445
  f"{this_task}: Required processes are ready, Embedded Connector status is '{self.get_matlab_state()}'"
@@ -1243,7 +1245,7 @@ class AppState:
1243
1245
  delay (int): time delay in seconds before retrying the file read operation
1244
1246
  """
1245
1247
  logger.debug(
1246
- f'updating matlab_port information from {self.matlab_session_files["matlab_ready_file"]}'
1248
+ f"updating matlab_port information from {self.matlab_session_files['matlab_ready_file']}"
1247
1249
  )
1248
1250
  try:
1249
1251
  await asyncio.wait_for(
@@ -1415,6 +1417,10 @@ class AppState:
1415
1417
  waiters = []
1416
1418
  if matlab is not None:
1417
1419
  if system.is_posix() and matlab.returncode is None:
1420
+ # Close the stderr stream to prevent indefinite hanging on it due to a child
1421
+ # process inheriting it, fixes https://github.com/mathworks/matlab-proxy/issues/44
1422
+ self._close_matlab_stderr_stream(matlab)
1423
+
1418
1424
  # Sending an exit request to the embedded connector takes time.
1419
1425
  # When MATLAB is in a "starting" state (implies the Embedded connector is not up)
1420
1426
  # OR
@@ -1432,6 +1438,7 @@ class AppState:
1432
1438
 
1433
1439
  # Wait for matlab to shutdown gracefully
1434
1440
  await matlab.wait()
1441
+
1435
1442
  assert (
1436
1443
  matlab.returncode == 0
1437
1444
  ), "Failed to gracefully shutdown MATLAB via the embedded connector"
@@ -1446,9 +1453,10 @@ class AppState:
1446
1453
  try:
1447
1454
  matlab.terminate()
1448
1455
  await matlab.wait()
1449
- except:
1450
- pass
1451
-
1456
+ except Exception as ex:
1457
+ logger.debug(
1458
+ "Received an exception while terminating matlab: %s", ex
1459
+ )
1452
1460
  else:
1453
1461
  # In a windows system
1454
1462
  if system.is_windows() and matlab.is_running():
@@ -1518,6 +1526,23 @@ class AppState:
1518
1526
  self.matlab_port = None
1519
1527
  logger.debug("Completed Shutdown!!!")
1520
1528
 
1529
+ def _close_matlab_stderr_stream(self, matlab):
1530
+ """
1531
+ This method attempts to close the stderr stream associated with the MATLAB process
1532
+ to prevent potential resource leaks. It logs a debug message if the stream is
1533
+ successfully closed.
1534
+
1535
+ Args:
1536
+ matlab: The MATLAB process reference.
1537
+ """
1538
+ stderr_stream = matlab._transport.get_pipe_transport(sys.stderr.fileno())
1539
+ if stderr_stream:
1540
+ logger.debug(
1541
+ "Closing matlab process stderr stream: %s",
1542
+ stderr_stream,
1543
+ )
1544
+ stderr_stream.close()
1545
+
1521
1546
  async def handle_matlab_output(self):
1522
1547
  """Parse MATLAB output from stdout and raise errors if any."""
1523
1548
  matlab = self.processes["matlab"]
@@ -1 +1,20 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="MATLAB"/><meta name="internal_mw_identifier" content="MWI_MATLAB_PROXY_IDENTIFIER"/><link rel="manifest" href="./manifest.json"/><title>MATLAB</title><script defer="defer" src="./static/js/main.ce0f5505.js"></script><link href="./static/css/main.efa05ff9.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!-- Copyright 2025 The MathWorks, Inc. -->
2
+
3
+ <!doctype html>
4
+ <html lang="en">
5
+ <head>
6
+ <meta charset="UTF-8" />
7
+ <link rel="icon" href="./favicon.ico" />
8
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
9
+ <meta name="theme-color" content="#000000" />
10
+ <meta name="description" content="MATLAB" />
11
+ <meta name="internal_mw_identifier" content="MWI_MATLAB_PROXY_IDENTIFIER" />
12
+ <link rel="manifest" href="./manifest.json" />
13
+ <title>MATLAB</title>
14
+ <script type="module" crossorigin src="./static/js/index.Cm14Eqsb.js"></script>
15
+ <link rel="stylesheet" crossorigin href="./static/css/index.BSVLACuY.css">
16
+ </head>
17
+ <body>
18
+ <div id="root"></div>
19
+ </body>
20
+ </html>