pymss 2.3.1__tar.gz → 2.3.2__tar.gz

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.
Files changed (179) hide show
  1. {pymss-2.3.1 → pymss-2.3.2}/PKG-INFO +1 -1
  2. {pymss-2.3.1 → pymss-2.3.2}/pymss/plugins/install.py +16 -0
  3. {pymss-2.3.1 → pymss-2.3.2}/pymss.egg-info/PKG-INFO +1 -1
  4. {pymss-2.3.1 → pymss-2.3.2}/pymss.egg-info/SOURCES.txt +1 -0
  5. {pymss-2.3.1 → pymss-2.3.2}/pymss_plugin_manager/_engine.py +2 -1
  6. {pymss-2.3.1 → pymss-2.3.2}/pyproject.toml +1 -1
  7. pymss-2.3.2/test/test_plugin_macos_attributes.py +82 -0
  8. {pymss-2.3.1 → pymss-2.3.2}/test/test_plugin_management.py +50 -0
  9. {pymss-2.3.1 → pymss-2.3.2}/LICENSE +0 -0
  10. {pymss-2.3.1 → pymss-2.3.2}/README.md +0 -0
  11. {pymss-2.3.1 → pymss-2.3.2}/pymss/__init__.py +0 -0
  12. {pymss-2.3.1 → pymss-2.3.2}/pymss/__main__.py +0 -0
  13. {pymss-2.3.1 → pymss-2.3.2}/pymss/_builtin_node_types.py +0 -0
  14. {pymss-2.3.1 → pymss-2.3.2}/pymss/_identifiers.py +0 -0
  15. {pymss-2.3.1 → pymss-2.3.2}/pymss/audio_io.py +0 -0
  16. {pymss-2.3.1 → pymss-2.3.2}/pymss/audio_services.py +0 -0
  17. {pymss-2.3.1 → pymss-2.3.2}/pymss/cli.py +0 -0
  18. {pymss-2.3.1 → pymss-2.3.2}/pymss/config.py +0 -0
  19. {pymss-2.3.1 → pymss-2.3.2}/pymss/ensemble.py +0 -0
  20. {pymss-2.3.1 → pymss-2.3.2}/pymss/graph/__init__.py +0 -0
  21. {pymss-2.3.1 → pymss-2.3.2}/pymss/graph/builtin_nodes.py +0 -0
  22. {pymss-2.3.1 → pymss-2.3.2}/pymss/graph/comfy_loader.py +0 -0
  23. {pymss-2.3.1 → pymss-2.3.2}/pymss/graph/core.py +0 -0
  24. {pymss-2.3.1 → pymss-2.3.2}/pymss/graph/nodes.py +0 -0
  25. {pymss-2.3.1 → pymss-2.3.2}/pymss/graph/runner.py +0 -0
  26. {pymss-2.3.1 → pymss-2.3.2}/pymss/graph/yaml_compiler.py +0 -0
  27. {pymss-2.3.1 → pymss-2.3.2}/pymss/logger.py +0 -0
  28. {pymss-2.3.1 → pymss-2.3.2}/pymss/model_download.py +0 -0
  29. {pymss-2.3.1 → pymss-2.3.2}/pymss/model_registry.py +0 -0
  30. {pymss-2.3.1 → pymss-2.3.2}/pymss/modules/__init__.py +0 -0
  31. {pymss-2.3.1 → pymss-2.3.2}/pymss/modules/_core_shims.py +0 -0
  32. {pymss-2.3.1 → pymss-2.3.2}/pymss/modules/vocal_remover/__init__.py +0 -0
  33. {pymss-2.3.1 → pymss-2.3.2}/pymss/modules/vocal_remover/common_separator.py +0 -0
  34. {pymss-2.3.1 → pymss-2.3.2}/pymss/modules/vocal_remover/uvr_lib_v5/__init__.py +0 -0
  35. {pymss-2.3.1 → pymss-2.3.2}/pymss/modules/vocal_remover/uvr_lib_v5/spec_utils.py +0 -0
  36. {pymss-2.3.1 → pymss-2.3.2}/pymss/modules/vocal_remover/vr_mlx.py +0 -0
  37. {pymss-2.3.1 → pymss-2.3.2}/pymss/modules/vocal_remover/vr_models.py +0 -0
  38. {pymss-2.3.1 → pymss-2.3.2}/pymss/modules/vocal_remover/vr_separator.py +0 -0
  39. {pymss-2.3.1 → pymss-2.3.2}/pymss/operations/__init__.py +0 -0
  40. {pymss-2.3.1 → pymss-2.3.2}/pymss/operations/_command_bootstrap.py +0 -0
  41. {pymss-2.3.1 → pymss-2.3.2}/pymss/operations/_command_process.py +0 -0
  42. {pymss-2.3.1 → pymss-2.3.2}/pymss/operations/_profile_lock.py +0 -0
  43. {pymss-2.3.1 → pymss-2.3.2}/pymss/operations/_python_entry.py +0 -0
  44. {pymss-2.3.1 → pymss-2.3.2}/pymss/operations/_rpc_session.py +0 -0
  45. {pymss-2.3.1 → pymss-2.3.2}/pymss/operations/builtins.py +0 -0
  46. {pymss-2.3.1 → pymss-2.3.2}/pymss/operations/command.py +0 -0
  47. {pymss-2.3.1 → pymss-2.3.2}/pymss/operations/files.py +0 -0
  48. {pymss-2.3.1 → pymss-2.3.2}/pymss/operations/graph_bridge.py +0 -0
  49. {pymss-2.3.1 → pymss-2.3.2}/pymss/operations/host_services.py +0 -0
  50. {pymss-2.3.1 → pymss-2.3.2}/pymss/operations/kit_builtins.py +0 -0
  51. {pymss-2.3.1 → pymss-2.3.2}/pymss/operations/python_profiles.py +0 -0
  52. {pymss-2.3.1 → pymss-2.3.2}/pymss/operations/rpc_process.py +0 -0
  53. {pymss-2.3.1 → pymss-2.3.2}/pymss/plugins/__init__.py +0 -0
  54. {pymss-2.3.1 → pymss-2.3.2}/pymss/plugins/builtins.py +0 -0
  55. {pymss-2.3.1 → pymss-2.3.2}/pymss/plugins/codecs.py +0 -0
  56. {pymss-2.3.1 → pymss-2.3.2}/pymss/plugins/graph_ops.py +0 -0
  57. {pymss-2.3.1 → pymss-2.3.2}/pymss/plugins/kit.py +0 -0
  58. {pymss-2.3.1 → pymss-2.3.2}/pymss/plugins/lifecycle.py +0 -0
  59. {pymss-2.3.1 → pymss-2.3.2}/pymss/plugins/loader.py +0 -0
  60. {pymss-2.3.1 → pymss-2.3.2}/pymss/plugins/manifest.py +0 -0
  61. {pymss-2.3.1 → pymss-2.3.2}/pymss/plugins/marketplace.py +0 -0
  62. {pymss-2.3.1 → pymss-2.3.2}/pymss/plugins/registry.py +0 -0
  63. {pymss-2.3.1 → pymss-2.3.2}/pymss/plugins/service.py +0 -0
  64. {pymss-2.3.1 → pymss-2.3.2}/pymss/plugins/sources.py +0 -0
  65. {pymss-2.3.1 → pymss-2.3.2}/pymss/progress.py +0 -0
  66. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/model_catalog.json +0 -0
  67. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/1band_sr16000_hl512.json +0 -0
  68. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/1band_sr32000_hl512.json +0 -0
  69. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/1band_sr33075_hl384.json +0 -0
  70. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/1band_sr44100_hl1024.json +0 -0
  71. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/1band_sr44100_hl256.json +0 -0
  72. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/1band_sr44100_hl512.json +0 -0
  73. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/1band_sr44100_hl512_cut.json +0 -0
  74. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/1band_sr44100_hl512_nf1024.json +0 -0
  75. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/2band_32000.json +0 -0
  76. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/2band_44100_lofi.json +0 -0
  77. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/2band_48000.json +0 -0
  78. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/3band_44100.json +0 -0
  79. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/3band_44100_mid.json +0 -0
  80. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/3band_44100_msb2.json +0 -0
  81. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/4band_44100.json +0 -0
  82. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/4band_44100_mid.json +0 -0
  83. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/4band_44100_msb.json +0 -0
  84. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/4band_44100_msb2.json +0 -0
  85. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/4band_44100_reverse.json +0 -0
  86. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/4band_44100_sw.json +0 -0
  87. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/4band_v2.json +0 -0
  88. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/4band_v2_sn.json +0 -0
  89. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/4band_v3.json +0 -0
  90. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/4band_v3_sn.json +0 -0
  91. {pymss-2.3.1 → pymss-2.3.2}/pymss/resources/vr_modelparams/4band_v4_ms_fullband.json +0 -0
  92. {pymss-2.3.1 → pymss-2.3.2}/pymss/separator.py +0 -0
  93. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/__init__.py +0 -0
  94. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/app.py +0 -0
  95. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/audio.py +0 -0
  96. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/config.py +0 -0
  97. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/errors.py +0 -0
  98. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/models.py +0 -0
  99. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/state.py +0 -0
  100. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/webui.py +0 -0
  101. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/webui_static/assets/index-C2f3RgYK.js +0 -0
  102. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/webui_static/assets/index-Dd_kG96D.css +0 -0
  103. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/webui_static/assets/noto-sans-cyrillic-ext-wght-normal-DSNfmdVt.woff2 +0 -0
  104. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/webui_static/assets/noto-sans-cyrillic-wght-normal-B2hlT84T.woff2 +0 -0
  105. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/webui_static/assets/noto-sans-devanagari-wght-normal-Cv-Vwajv.woff2 +0 -0
  106. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/webui_static/assets/noto-sans-greek-ext-wght-normal-12T8GTDR.woff2 +0 -0
  107. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/webui_static/assets/noto-sans-greek-wght-normal-Ymb6dZNd.woff2 +0 -0
  108. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/webui_static/assets/noto-sans-latin-ext-wght-normal-W1qJv59z.woff2 +0 -0
  109. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/webui_static/assets/noto-sans-latin-wght-normal-BYSzYMf3.woff2 +0 -0
  110. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/webui_static/assets/noto-sans-vietnamese-wght-normal-DLTJy58D.woff2 +0 -0
  111. {pymss-2.3.1 → pymss-2.3.2}/pymss/server/webui_static/index.html +0 -0
  112. {pymss-2.3.1 → pymss-2.3.2}/pymss/user_models.py +0 -0
  113. {pymss-2.3.1 → pymss-2.3.2}/pymss/utils.py +0 -0
  114. {pymss-2.3.1 → pymss-2.3.2}/pymss/workflow.py +0 -0
  115. {pymss-2.3.1 → pymss-2.3.2}/pymss.egg-info/dependency_links.txt +0 -0
  116. {pymss-2.3.1 → pymss-2.3.2}/pymss.egg-info/entry_points.txt +0 -0
  117. {pymss-2.3.1 → pymss-2.3.2}/pymss.egg-info/requires.txt +0 -0
  118. {pymss-2.3.1 → pymss-2.3.2}/pymss.egg-info/top_level.txt +0 -0
  119. {pymss-2.3.1 → pymss-2.3.2}/pymss_plugin_manager/LICENSE +0 -0
  120. {pymss-2.3.1 → pymss-2.3.2}/pymss_plugin_manager/NOTICE +0 -0
  121. {pymss-2.3.1 → pymss-2.3.2}/pymss_plugin_manager/__init__.py +0 -0
  122. {pymss-2.3.1 → pymss-2.3.2}/pymss_plugin_manager/cli.py +0 -0
  123. {pymss-2.3.1 → pymss-2.3.2}/pymss_plugin_manager/context.py +0 -0
  124. {pymss-2.3.1 → pymss-2.3.2}/pymss_plugin_manager/environment.py +0 -0
  125. {pymss-2.3.1 → pymss-2.3.2}/pymss_plugin_manager/inventory.py +0 -0
  126. {pymss-2.3.1 → pymss-2.3.2}/pymss_plugin_manager/leases.py +0 -0
  127. {pymss-2.3.1 → pymss-2.3.2}/pymss_plugin_manager/locks.py +0 -0
  128. {pymss-2.3.1 → pymss-2.3.2}/pymss_plugin_manager/profiles.py +0 -0
  129. {pymss-2.3.1 → pymss-2.3.2}/pymss_plugin_manager/service.py +0 -0
  130. {pymss-2.3.1 → pymss-2.3.2}/setup.cfg +0 -0
  131. {pymss-2.3.1 → pymss-2.3.2}/test/test_all.py +0 -0
  132. {pymss-2.3.1 → pymss-2.3.2}/test/test_audio_downmix.py +0 -0
  133. {pymss-2.3.1 → pymss-2.3.2}/test/test_audio_formats.py +0 -0
  134. {pymss-2.3.1 → pymss-2.3.2}/test/test_audio_layout_metadata.py +0 -0
  135. {pymss-2.3.1 → pymss-2.3.2}/test/test_audio_materialization.py +0 -0
  136. {pymss-2.3.1 → pymss-2.3.2}/test/test_audio_resample.py +0 -0
  137. {pymss-2.3.1 → pymss-2.3.2}/test/test_audio_services.py +0 -0
  138. {pymss-2.3.1 → pymss-2.3.2}/test/test_builtin_capabilities.py +0 -0
  139. {pymss-2.3.1 → pymss-2.3.2}/test/test_builtin_operations.py +0 -0
  140. {pymss-2.3.1 → pymss-2.3.2}/test/test_codec_capabilities.py +0 -0
  141. {pymss-2.3.1 → pymss-2.3.2}/test/test_command_bootstrap.py +0 -0
  142. {pymss-2.3.1 → pymss-2.3.2}/test/test_command_operations.py +0 -0
  143. {pymss-2.3.1 → pymss-2.3.2}/test/test_command_process.py +0 -0
  144. {pymss-2.3.1 → pymss-2.3.2}/test/test_core_shims.py +0 -0
  145. {pymss-2.3.1 → pymss-2.3.2}/test/test_graph.py +0 -0
  146. {pymss-2.3.1 → pymss-2.3.2}/test/test_graph_audio_merge.py +0 -0
  147. {pymss-2.3.1 → pymss-2.3.2}/test/test_graph_custom_models.py +0 -0
  148. {pymss-2.3.1 → pymss-2.3.2}/test/test_graph_execution_events.py +0 -0
  149. {pymss-2.3.1 → pymss-2.3.2}/test/test_graph_lifecycle.py +0 -0
  150. {pymss-2.3.1 → pymss-2.3.2}/test/test_graph_resample_service.py +0 -0
  151. {pymss-2.3.1 → pymss-2.3.2}/test/test_graph_runner_lifecycle.py +0 -0
  152. {pymss-2.3.1 → pymss-2.3.2}/test/test_kit_builtins.py +0 -0
  153. {pymss-2.3.1 → pymss-2.3.2}/test/test_legacy_loudnorm_node.py +0 -0
  154. {pymss-2.3.1 → pymss-2.3.2}/test/test_mlx_warmup.py +0 -0
  155. {pymss-2.3.1 → pymss-2.3.2}/test/test_model_catalog_overrides.py +0 -0
  156. {pymss-2.3.1 → pymss-2.3.2}/test/test_model_detection.py +0 -0
  157. {pymss-2.3.1 → pymss-2.3.2}/test/test_model_download_progress.py +0 -0
  158. {pymss-2.3.1 → pymss-2.3.2}/test/test_npu_runtime.py +0 -0
  159. {pymss-2.3.1 → pymss-2.3.2}/test/test_operation_graph_bridge.py +0 -0
  160. {pymss-2.3.1 → pymss-2.3.2}/test/test_operation_invocation.py +0 -0
  161. {pymss-2.3.1 → pymss-2.3.2}/test/test_operations.py +0 -0
  162. {pymss-2.3.1 → pymss-2.3.2}/test/test_overlap_finalize.py +0 -0
  163. {pymss-2.3.1 → pymss-2.3.2}/test/test_plugin_environment.py +0 -0
  164. {pymss-2.3.1 → pymss-2.3.2}/test/test_plugin_kit.py +0 -0
  165. {pymss-2.3.1 → pymss-2.3.2}/test/test_plugin_marketplace.py +0 -0
  166. {pymss-2.3.1 → pymss-2.3.2}/test/test_plugin_node_contract.py +0 -0
  167. {pymss-2.3.1 → pymss-2.3.2}/test/test_plugin_protocol.py +0 -0
  168. {pymss-2.3.1 → pymss-2.3.2}/test/test_plugin_protocol_posix.py +0 -0
  169. {pymss-2.3.1 → pymss-2.3.2}/test/test_plugin_sources.py +0 -0
  170. {pymss-2.3.1 → pymss-2.3.2}/test/test_plugins.py +0 -0
  171. {pymss-2.3.1 → pymss-2.3.2}/test/test_polarformer.py +0 -0
  172. {pymss-2.3.1 → pymss-2.3.2}/test/test_progress.py +0 -0
  173. {pymss-2.3.1 → pymss-2.3.2}/test/test_python_profiles.py +0 -0
  174. {pymss-2.3.1 → pymss-2.3.2}/test/test_rpc_declarations.py +0 -0
  175. {pymss-2.3.1 → pymss-2.3.2}/test/test_rpc_process.py +0 -0
  176. {pymss-2.3.1 → pymss-2.3.2}/test/test_separator_channels.py +0 -0
  177. {pymss-2.3.1 → pymss-2.3.2}/test/test_separator_device_defaults.py +0 -0
  178. {pymss-2.3.1 → pymss-2.3.2}/test/test_use_amp.py +0 -0
  179. {pymss-2.3.1 → pymss-2.3.2}/test/test_workflow.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pymss
3
- Version: 2.3.1
3
+ Version: 2.3.2
4
4
  Summary: Python package for music source separation.
5
5
  Author-email: KitsuneX07 <ghast1085654218@163.com>
6
6
  Maintainer-email: baicai1145 <3423714059@qq.com>
@@ -56,6 +56,21 @@ class InstallError(Exception):
56
56
  """Raised when a plugin install fails."""
57
57
 
58
58
 
59
+ def _clear_macos_attributes(plugin_dir: Path) -> None:
60
+ """Clear attributes on the acquired copy before it can be loaded or published."""
61
+ if sys.platform != "darwin":
62
+ return
63
+ try:
64
+ # -s operates on symlinks themselves so recursive cleanup stays in this copy.
65
+ subprocess.run(
66
+ ["/usr/bin/xattr", "-rc", "-s", str(plugin_dir.absolute())],
67
+ check=True, capture_output=True, text=True, encoding="utf-8", errors="replace", timeout=30,
68
+ )
69
+ except (OSError, subprocess.SubprocessError) as error:
70
+ detail = (error.stderr or str(error)) if isinstance(error, subprocess.CalledProcessError) else str(error)
71
+ raise InstallError(f"macOS plugin attribute cleanup failed: {detail.strip()}") from error
72
+
73
+
59
74
  @dataclass
60
75
  class InstallResult:
61
76
  name: str
@@ -399,6 +414,7 @@ def install(
399
414
  _write_install_manifest(staged, name=name, source=source, url=url,
400
415
  subpath=subpath, ref=ref, meta=meta, registry_url=resolved_registry_url,
401
416
  resolved_commit=source_meta.get("resolved_commit"))
417
+ _clear_macos_attributes(staged)
402
418
  staged.rename(dest)
403
419
  return InstallResult(name=name, path=dest, source=source,
404
420
  version=meta.get("version"), dependencies_installed=installed_deps)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pymss
3
- Version: 2.3.1
3
+ Version: 2.3.2
4
4
  Summary: Python package for music source separation.
5
5
  Author-email: KitsuneX07 <ghast1085654218@163.com>
6
6
  Maintainer-email: baicai1145 <3423714059@qq.com>
@@ -158,6 +158,7 @@ test/test_operations.py
158
158
  test/test_overlap_finalize.py
159
159
  test/test_plugin_environment.py
160
160
  test/test_plugin_kit.py
161
+ test/test_plugin_macos_attributes.py
161
162
  test/test_plugin_management.py
162
163
  test/test_plugin_marketplace.py
163
164
  test/test_plugin_node_contract.py
@@ -828,7 +828,7 @@ def _verify_candidate(root: Path, candidate: Path, name: str, *, candidate_depen
828
828
 
829
829
  def _acquire_source(target: str, directory: Path, subpath: str | None = None):
830
830
  from datetime import datetime, timezone
831
- from pymss.plugins.install import InstallResult, install, list_available
831
+ from pymss.plugins.install import InstallResult, install, list_available, _clear_macos_attributes
832
832
 
833
833
  local_root = _LOCAL_SOURCE.get()
834
834
  from_default = bool(local_root and _NAME.fullmatch(target))
@@ -888,6 +888,7 @@ def _acquire_source(target: str, directory: Path, subpath: str | None = None):
888
888
  "defaultRepository": from_default,
889
889
  **({"sourceContext": {"registryUrl": _REGISTRY_URL.get(), "localSource": str(local_root)}} if from_default else {}),
890
890
  }), encoding="utf-8")
891
+ _clear_macos_attributes(destination)
891
892
  return InstallResult(name=name, path=destination, source="path", version=version)
892
893
 
893
894
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pymss"
7
- version = "2.3.1"
7
+ version = "2.3.2"
8
8
  description = "Python package for music source separation."
9
9
  readme = { file = "README.md", content-type = "text/markdown" }
10
10
  requires-python = ">=3.11"
@@ -0,0 +1,82 @@
1
+ from __future__ import annotations
2
+
3
+ import importlib
4
+ from pathlib import Path
5
+ import shutil
6
+ import subprocess
7
+ from types import SimpleNamespace
8
+ from unittest.mock import Mock
9
+
10
+ import pytest
11
+
12
+ install_mod = importlib.import_module("pymss.plugins.install")
13
+
14
+
15
+ def package(tmp_path):
16
+ source = tmp_path / "source"
17
+ source.mkdir()
18
+ (source / "pyproject.toml").write_text(
19
+ '[project]\nname="provider"\nversion="1.0"\n'
20
+ '[tool.pymss.plugin]\nid="author.provider"\napi_version=2\n', encoding="utf-8")
21
+ (source / "__init__.py").write_text("def setup(plugin): pass\n", encoding="utf-8")
22
+ return source
23
+
24
+
25
+ @pytest.mark.parametrize("remote", [False, True])
26
+ def test_macos_install_clears_only_the_staged_plugin_before_publication(tmp_path, monkeypatch, remote):
27
+ source = package(tmp_path)
28
+ store = tmp_path / "installed"
29
+ calls = []
30
+
31
+ def run(command, **options):
32
+ staged = Path(command[-1])
33
+ assert staged.is_relative_to(store)
34
+ assert staged != source
35
+ assert (staged / "pyproject.toml").is_file()
36
+ assert not (store / "author.provider").exists()
37
+ calls.append((command, options))
38
+ return subprocess.CompletedProcess(command, 0, "", "")
39
+
40
+ def clone(url, destination, **options):
41
+ shutil.copytree(source, destination)
42
+ return {"resolved_commit": "a" * 40}
43
+
44
+ monkeypatch.setattr(install_mod, "sys", SimpleNamespace(platform="darwin"))
45
+ monkeypatch.setattr(install_mod.subprocess, "run", run)
46
+ monkeypatch.setattr(install_mod, "_clone", clone)
47
+ result = install_mod.install("https://github.com/author/plugin" if remote else str(source),
48
+ plugins_dir=store, no_deps=True)
49
+ assert result.path == store / "author.provider"
50
+ assert len(calls) == 1
51
+ command, options = calls[0]
52
+ assert command[:3] == ["/usr/bin/xattr", "-rc", "-s"]
53
+ assert options["check"] is True
54
+ assert options["timeout"] == 30
55
+ assert (source / "__init__.py").read_text() == "def setup(plugin): pass\n"
56
+
57
+
58
+ @pytest.mark.parametrize("platform", ["win32", "linux"])
59
+ def test_other_platforms_do_not_run_xattr(tmp_path, monkeypatch, platform):
60
+ source = package(tmp_path)
61
+ run = Mock(side_effect=AssertionError("Unexpected native command"))
62
+ monkeypatch.setattr(install_mod, "sys", SimpleNamespace(platform=platform))
63
+ monkeypatch.setattr(install_mod.subprocess, "run", run)
64
+ result = install_mod.install(str(source), plugins_dir=tmp_path / "installed", no_deps=True)
65
+ assert result.path.is_dir()
66
+ run.assert_not_called()
67
+
68
+
69
+ @pytest.mark.parametrize("error", [
70
+ subprocess.CalledProcessError(1, "xattr", stderr="Operation not permitted"),
71
+ subprocess.TimeoutExpired("xattr", 30),
72
+ FileNotFoundError("xattr unavailable"),
73
+ ])
74
+ def test_cleanup_failure_aborts_before_publishing_the_plugin(tmp_path, monkeypatch, error):
75
+ source = package(tmp_path)
76
+ monkeypatch.setattr(install_mod, "sys", SimpleNamespace(platform="darwin"))
77
+ monkeypatch.setattr(install_mod.subprocess, "run", Mock(side_effect=error))
78
+ store = tmp_path / "installed"
79
+ with pytest.raises(install_mod.InstallError, match="macOS plugin attribute cleanup failed"):
80
+ install_mod.install(str(source), plugins_dir=store, no_deps=True)
81
+ assert not (store / "author.provider").exists()
82
+ assert (source / "pyproject.toml").is_file()
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import importlib
3
4
  import json
4
5
  import os
5
6
  from concurrent.futures import ThreadPoolExecutor
@@ -45,6 +46,55 @@ def release_leases():
45
46
  release_runtime()
46
47
 
47
48
 
49
+ def test_macos_management_cleans_each_acquired_copy_before_verification(tmp_path, monkeypatch):
50
+ install_mod = importlib.import_module("pymss.plugins.install")
51
+ events = []
52
+ package = source(tmp_path)
53
+
54
+ def cleanup(command, **options):
55
+ assert command[:3] == ["/usr/bin/xattr", "-rc", "-s"]
56
+ candidate = Path(command[-1])
57
+ assert candidate.is_relative_to(tmp_path / "plugins")
58
+ assert candidate != package
59
+ events.append("cleanup")
60
+ return subprocess.CompletedProcess(command, 0, "", "")
61
+
62
+ def probe(root, paths):
63
+ events.append("probe")
64
+ return [{"name": path.name, "managed": True, "loaded": True} for path in (root / "installed").iterdir()]
65
+
66
+ monkeypatch.setattr(install_mod, "sys", SimpleNamespace(platform="darwin"))
67
+ monkeypatch.setattr(install_mod.subprocess, "run", cleanup)
68
+ cpu = PluginService(PluginContext(tmp_path / "plugins/cpu"), PluginPolicy(probe=probe))
69
+ cuda = PluginService(PluginContext(tmp_path / "plugins/cuda"), PluginPolicy(probe=probe))
70
+ actions = [lambda: cpu.install(str(package)), lambda: cpu.update("author.provider"),
71
+ lambda: cpu.manage("repair", name="author.provider"), lambda: cuda.prepare("author.provider")]
72
+ for action in actions:
73
+ events.clear()
74
+ action()
75
+ assert events[0] == "cleanup"
76
+ assert events.count("cleanup") == 1
77
+ assert "probe" in events
78
+
79
+
80
+ def test_failed_macos_cleanup_keeps_the_installed_binding_and_skips_verification(tmp_path, monkeypatch):
81
+ install_mod = importlib.import_module("pymss.plugins.install")
82
+ manager = service(tmp_path / "plugins/cpu")
83
+ package = source(tmp_path)
84
+ manager.install(str(package))
85
+ installed = manager.context.root / "installed/author.provider"
86
+ before = {p.relative_to(installed): p.read_bytes() for p in installed.rglob("*") if p.is_file()}
87
+ probe = mock.Mock(side_effect=AssertionError("The candidate must not be loaded"))
88
+ manager.policy.probe = probe
89
+ monkeypatch.setattr(install_mod, "sys", SimpleNamespace(platform="darwin"))
90
+ monkeypatch.setattr(install_mod.subprocess, "run", mock.Mock(side_effect=
91
+ subprocess.CalledProcessError(1, "xattr", stderr="Operation not permitted")))
92
+ with pytest.raises(install_mod.InstallError, match="Operation not permitted"):
93
+ manager.update("author.provider")
94
+ assert {p.relative_to(installed): p.read_bytes() for p in installed.rglob("*") if p.is_file()} == before
95
+ probe.assert_not_called()
96
+
97
+
48
98
  def test_inventory_api_import_and_query_do_not_initialize_the_core(tmp_path):
49
99
  repository = Path(__file__).resolve().parents[1]
50
100
  code = (
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes