pymss 2.3.2__tar.gz → 2.3.3__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.2 → pymss-2.3.3}/PKG-INFO +1 -1
  2. {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/install.py +15 -7
  3. {pymss-2.3.2 → pymss-2.3.3}/pymss.egg-info/PKG-INFO +1 -1
  4. {pymss-2.3.2 → pymss-2.3.3}/pyproject.toml +1 -1
  5. {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_sources.py +79 -1
  6. {pymss-2.3.2 → pymss-2.3.3}/LICENSE +0 -0
  7. {pymss-2.3.2 → pymss-2.3.3}/README.md +0 -0
  8. {pymss-2.3.2 → pymss-2.3.3}/pymss/__init__.py +0 -0
  9. {pymss-2.3.2 → pymss-2.3.3}/pymss/__main__.py +0 -0
  10. {pymss-2.3.2 → pymss-2.3.3}/pymss/_builtin_node_types.py +0 -0
  11. {pymss-2.3.2 → pymss-2.3.3}/pymss/_identifiers.py +0 -0
  12. {pymss-2.3.2 → pymss-2.3.3}/pymss/audio_io.py +0 -0
  13. {pymss-2.3.2 → pymss-2.3.3}/pymss/audio_services.py +0 -0
  14. {pymss-2.3.2 → pymss-2.3.3}/pymss/cli.py +0 -0
  15. {pymss-2.3.2 → pymss-2.3.3}/pymss/config.py +0 -0
  16. {pymss-2.3.2 → pymss-2.3.3}/pymss/ensemble.py +0 -0
  17. {pymss-2.3.2 → pymss-2.3.3}/pymss/graph/__init__.py +0 -0
  18. {pymss-2.3.2 → pymss-2.3.3}/pymss/graph/builtin_nodes.py +0 -0
  19. {pymss-2.3.2 → pymss-2.3.3}/pymss/graph/comfy_loader.py +0 -0
  20. {pymss-2.3.2 → pymss-2.3.3}/pymss/graph/core.py +0 -0
  21. {pymss-2.3.2 → pymss-2.3.3}/pymss/graph/nodes.py +0 -0
  22. {pymss-2.3.2 → pymss-2.3.3}/pymss/graph/runner.py +0 -0
  23. {pymss-2.3.2 → pymss-2.3.3}/pymss/graph/yaml_compiler.py +0 -0
  24. {pymss-2.3.2 → pymss-2.3.3}/pymss/logger.py +0 -0
  25. {pymss-2.3.2 → pymss-2.3.3}/pymss/model_download.py +0 -0
  26. {pymss-2.3.2 → pymss-2.3.3}/pymss/model_registry.py +0 -0
  27. {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/__init__.py +0 -0
  28. {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/_core_shims.py +0 -0
  29. {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/vocal_remover/__init__.py +0 -0
  30. {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/vocal_remover/common_separator.py +0 -0
  31. {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/vocal_remover/uvr_lib_v5/__init__.py +0 -0
  32. {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/vocal_remover/uvr_lib_v5/spec_utils.py +0 -0
  33. {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/vocal_remover/vr_mlx.py +0 -0
  34. {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/vocal_remover/vr_models.py +0 -0
  35. {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/vocal_remover/vr_separator.py +0 -0
  36. {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/__init__.py +0 -0
  37. {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/_command_bootstrap.py +0 -0
  38. {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/_command_process.py +0 -0
  39. {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/_profile_lock.py +0 -0
  40. {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/_python_entry.py +0 -0
  41. {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/_rpc_session.py +0 -0
  42. {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/builtins.py +0 -0
  43. {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/command.py +0 -0
  44. {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/files.py +0 -0
  45. {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/graph_bridge.py +0 -0
  46. {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/host_services.py +0 -0
  47. {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/kit_builtins.py +0 -0
  48. {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/python_profiles.py +0 -0
  49. {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/rpc_process.py +0 -0
  50. {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/__init__.py +0 -0
  51. {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/builtins.py +0 -0
  52. {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/codecs.py +0 -0
  53. {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/graph_ops.py +0 -0
  54. {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/kit.py +0 -0
  55. {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/lifecycle.py +0 -0
  56. {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/loader.py +0 -0
  57. {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/manifest.py +0 -0
  58. {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/marketplace.py +0 -0
  59. {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/registry.py +0 -0
  60. {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/service.py +0 -0
  61. {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/sources.py +0 -0
  62. {pymss-2.3.2 → pymss-2.3.3}/pymss/progress.py +0 -0
  63. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/model_catalog.json +0 -0
  64. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/1band_sr16000_hl512.json +0 -0
  65. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/1band_sr32000_hl512.json +0 -0
  66. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/1band_sr33075_hl384.json +0 -0
  67. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/1band_sr44100_hl1024.json +0 -0
  68. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/1band_sr44100_hl256.json +0 -0
  69. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/1band_sr44100_hl512.json +0 -0
  70. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/1band_sr44100_hl512_cut.json +0 -0
  71. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/1band_sr44100_hl512_nf1024.json +0 -0
  72. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/2band_32000.json +0 -0
  73. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/2band_44100_lofi.json +0 -0
  74. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/2band_48000.json +0 -0
  75. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/3band_44100.json +0 -0
  76. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/3band_44100_mid.json +0 -0
  77. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/3band_44100_msb2.json +0 -0
  78. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_44100.json +0 -0
  79. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_44100_mid.json +0 -0
  80. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_44100_msb.json +0 -0
  81. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_44100_msb2.json +0 -0
  82. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_44100_reverse.json +0 -0
  83. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_44100_sw.json +0 -0
  84. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_v2.json +0 -0
  85. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_v2_sn.json +0 -0
  86. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_v3.json +0 -0
  87. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_v3_sn.json +0 -0
  88. {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_v4_ms_fullband.json +0 -0
  89. {pymss-2.3.2 → pymss-2.3.3}/pymss/separator.py +0 -0
  90. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/__init__.py +0 -0
  91. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/app.py +0 -0
  92. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/audio.py +0 -0
  93. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/config.py +0 -0
  94. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/errors.py +0 -0
  95. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/models.py +0 -0
  96. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/state.py +0 -0
  97. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui.py +0 -0
  98. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/index-C2f3RgYK.js +0 -0
  99. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/index-Dd_kG96D.css +0 -0
  100. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/noto-sans-cyrillic-ext-wght-normal-DSNfmdVt.woff2 +0 -0
  101. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/noto-sans-cyrillic-wght-normal-B2hlT84T.woff2 +0 -0
  102. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/noto-sans-devanagari-wght-normal-Cv-Vwajv.woff2 +0 -0
  103. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/noto-sans-greek-ext-wght-normal-12T8GTDR.woff2 +0 -0
  104. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/noto-sans-greek-wght-normal-Ymb6dZNd.woff2 +0 -0
  105. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/noto-sans-latin-ext-wght-normal-W1qJv59z.woff2 +0 -0
  106. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/noto-sans-latin-wght-normal-BYSzYMf3.woff2 +0 -0
  107. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/noto-sans-vietnamese-wght-normal-DLTJy58D.woff2 +0 -0
  108. {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/index.html +0 -0
  109. {pymss-2.3.2 → pymss-2.3.3}/pymss/user_models.py +0 -0
  110. {pymss-2.3.2 → pymss-2.3.3}/pymss/utils.py +0 -0
  111. {pymss-2.3.2 → pymss-2.3.3}/pymss/workflow.py +0 -0
  112. {pymss-2.3.2 → pymss-2.3.3}/pymss.egg-info/SOURCES.txt +0 -0
  113. {pymss-2.3.2 → pymss-2.3.3}/pymss.egg-info/dependency_links.txt +0 -0
  114. {pymss-2.3.2 → pymss-2.3.3}/pymss.egg-info/entry_points.txt +0 -0
  115. {pymss-2.3.2 → pymss-2.3.3}/pymss.egg-info/requires.txt +0 -0
  116. {pymss-2.3.2 → pymss-2.3.3}/pymss.egg-info/top_level.txt +0 -0
  117. {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/LICENSE +0 -0
  118. {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/NOTICE +0 -0
  119. {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/__init__.py +0 -0
  120. {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/_engine.py +0 -0
  121. {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/cli.py +0 -0
  122. {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/context.py +0 -0
  123. {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/environment.py +0 -0
  124. {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/inventory.py +0 -0
  125. {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/leases.py +0 -0
  126. {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/locks.py +0 -0
  127. {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/profiles.py +0 -0
  128. {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/service.py +0 -0
  129. {pymss-2.3.2 → pymss-2.3.3}/setup.cfg +0 -0
  130. {pymss-2.3.2 → pymss-2.3.3}/test/test_all.py +0 -0
  131. {pymss-2.3.2 → pymss-2.3.3}/test/test_audio_downmix.py +0 -0
  132. {pymss-2.3.2 → pymss-2.3.3}/test/test_audio_formats.py +0 -0
  133. {pymss-2.3.2 → pymss-2.3.3}/test/test_audio_layout_metadata.py +0 -0
  134. {pymss-2.3.2 → pymss-2.3.3}/test/test_audio_materialization.py +0 -0
  135. {pymss-2.3.2 → pymss-2.3.3}/test/test_audio_resample.py +0 -0
  136. {pymss-2.3.2 → pymss-2.3.3}/test/test_audio_services.py +0 -0
  137. {pymss-2.3.2 → pymss-2.3.3}/test/test_builtin_capabilities.py +0 -0
  138. {pymss-2.3.2 → pymss-2.3.3}/test/test_builtin_operations.py +0 -0
  139. {pymss-2.3.2 → pymss-2.3.3}/test/test_codec_capabilities.py +0 -0
  140. {pymss-2.3.2 → pymss-2.3.3}/test/test_command_bootstrap.py +0 -0
  141. {pymss-2.3.2 → pymss-2.3.3}/test/test_command_operations.py +0 -0
  142. {pymss-2.3.2 → pymss-2.3.3}/test/test_command_process.py +0 -0
  143. {pymss-2.3.2 → pymss-2.3.3}/test/test_core_shims.py +0 -0
  144. {pymss-2.3.2 → pymss-2.3.3}/test/test_graph.py +0 -0
  145. {pymss-2.3.2 → pymss-2.3.3}/test/test_graph_audio_merge.py +0 -0
  146. {pymss-2.3.2 → pymss-2.3.3}/test/test_graph_custom_models.py +0 -0
  147. {pymss-2.3.2 → pymss-2.3.3}/test/test_graph_execution_events.py +0 -0
  148. {pymss-2.3.2 → pymss-2.3.3}/test/test_graph_lifecycle.py +0 -0
  149. {pymss-2.3.2 → pymss-2.3.3}/test/test_graph_resample_service.py +0 -0
  150. {pymss-2.3.2 → pymss-2.3.3}/test/test_graph_runner_lifecycle.py +0 -0
  151. {pymss-2.3.2 → pymss-2.3.3}/test/test_kit_builtins.py +0 -0
  152. {pymss-2.3.2 → pymss-2.3.3}/test/test_legacy_loudnorm_node.py +0 -0
  153. {pymss-2.3.2 → pymss-2.3.3}/test/test_mlx_warmup.py +0 -0
  154. {pymss-2.3.2 → pymss-2.3.3}/test/test_model_catalog_overrides.py +0 -0
  155. {pymss-2.3.2 → pymss-2.3.3}/test/test_model_detection.py +0 -0
  156. {pymss-2.3.2 → pymss-2.3.3}/test/test_model_download_progress.py +0 -0
  157. {pymss-2.3.2 → pymss-2.3.3}/test/test_npu_runtime.py +0 -0
  158. {pymss-2.3.2 → pymss-2.3.3}/test/test_operation_graph_bridge.py +0 -0
  159. {pymss-2.3.2 → pymss-2.3.3}/test/test_operation_invocation.py +0 -0
  160. {pymss-2.3.2 → pymss-2.3.3}/test/test_operations.py +0 -0
  161. {pymss-2.3.2 → pymss-2.3.3}/test/test_overlap_finalize.py +0 -0
  162. {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_environment.py +0 -0
  163. {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_kit.py +0 -0
  164. {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_macos_attributes.py +0 -0
  165. {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_management.py +0 -0
  166. {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_marketplace.py +0 -0
  167. {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_node_contract.py +0 -0
  168. {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_protocol.py +0 -0
  169. {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_protocol_posix.py +0 -0
  170. {pymss-2.3.2 → pymss-2.3.3}/test/test_plugins.py +0 -0
  171. {pymss-2.3.2 → pymss-2.3.3}/test/test_polarformer.py +0 -0
  172. {pymss-2.3.2 → pymss-2.3.3}/test/test_progress.py +0 -0
  173. {pymss-2.3.2 → pymss-2.3.3}/test/test_python_profiles.py +0 -0
  174. {pymss-2.3.2 → pymss-2.3.3}/test/test_rpc_declarations.py +0 -0
  175. {pymss-2.3.2 → pymss-2.3.3}/test/test_rpc_process.py +0 -0
  176. {pymss-2.3.2 → pymss-2.3.3}/test/test_separator_channels.py +0 -0
  177. {pymss-2.3.2 → pymss-2.3.3}/test/test_separator_device_defaults.py +0 -0
  178. {pymss-2.3.2 → pymss-2.3.3}/test/test_use_amp.py +0 -0
  179. {pymss-2.3.2 → pymss-2.3.3}/test/test_workflow.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pymss
3
- Version: 2.3.2
3
+ Version: 2.3.3
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>
@@ -142,20 +142,28 @@ def _clone(url: str, dest: Path, subpath: str | None = None, ref: str | None = N
142
142
 
143
143
  with tempfile.TemporaryDirectory(prefix="pymss-git-", dir=temporary_root) as temporary:
144
144
  repo = Path(temporary) / "repo"
145
+ git_repo = str(repo)
146
+ if sys.platform == "win32":
147
+ # Git directory arguments do not accept Win32 extended path prefixes.
148
+ if git_repo.startswith("\\\\?\\UNC\\"):
149
+ git_repo = "\\\\" + git_repo[8:]
150
+ elif git_repo.startswith("\\\\?\\") and git_repo[5:7] == ":\\":
151
+ git_repo = git_repo[4:]
152
+ git_command = ["git", "-c", "core.longpaths=true"] if sys.platform == "win32" else ["git"]
145
153
  try:
146
154
  def git(*args: str) -> str:
147
155
  return subprocess.run( # noqa: S603, S607
148
- ["git", *args], check=True, capture_output=True, text=True, timeout=180,
156
+ [*git_command, *args], check=True, capture_output=True, text=True, timeout=180,
149
157
  ).stdout.strip()
150
158
 
151
159
  if ref:
152
- git("init", str(repo))
153
- git("-C", str(repo), "remote", "add", "origin", url)
154
- git("-C", str(repo), "fetch", "--depth", "1", "origin", ref)
155
- git("-C", str(repo), "checkout", "--detach", "FETCH_HEAD")
160
+ git("init", git_repo)
161
+ git("-C", git_repo, "remote", "add", "origin", url)
162
+ git("-C", git_repo, "fetch", "--depth", "1", "origin", ref)
163
+ git("-C", git_repo, "checkout", "--detach", "FETCH_HEAD")
156
164
  else:
157
- git("clone", "--depth", "1", url, str(repo))
158
- commit = git("-C", str(repo), "rev-parse", "HEAD")
165
+ git("clone", "--depth", "1", url, git_repo)
166
+ commit = git("-C", git_repo, "rev-parse", "HEAD")
159
167
  except (subprocess.SubprocessError, OSError) as exc:
160
168
  detail = exc.stderr.strip() if isinstance(exc, subprocess.CalledProcessError) else str(exc)
161
169
  raise InstallError(f"git source acquisition failed: {detail}") from exc
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pymss
3
- Version: 2.3.2
3
+ Version: 2.3.3
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>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pymss"
7
- version = "2.3.2"
7
+ version = "2.3.3"
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"
@@ -1,10 +1,14 @@
1
- """Offline coverage for GitHub plugin acquisition and archive validation."""
1
+ """Offline coverage for plugin source acquisition and archive validation."""
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from contextlib import nullcontext
5
6
  import io
6
7
  import json
7
8
  from pathlib import Path
9
+ import shutil
10
+ import subprocess
11
+ import sys
8
12
  from types import SimpleNamespace
9
13
  import stat
10
14
  from unittest.mock import Mock
@@ -47,6 +51,80 @@ def test_git_source_rejects_unsafe_refs_before_running_git(tmp_path, monkeypatch
47
51
  run.assert_not_called()
48
52
 
49
53
 
54
+ @pytest.mark.skipif(sys.platform != "win32" or shutil.which("git") is None, reason="Requires Git for Windows")
55
+ @pytest.mark.parametrize("pinned", [False, True])
56
+ @pytest.mark.parametrize("long_path", [False, True])
57
+ def test_windows_git_acquisition_handles_extended_paths_with_spaces(tmp_path, monkeypatch, pinned, long_path):
58
+ source = tmp_path / "source repository"
59
+ source.mkdir()
60
+ (source / "pyproject.toml").write_bytes(MANIFEST)
61
+ (source / "__init__.py").write_text("def setup(plugin): pass\n", encoding="utf-8")
62
+ payload = Path("runtime")
63
+ if long_path:
64
+ for index in range(5):
65
+ payload /= f"plugin storage directory {index}"
66
+ payload /= "engine.bin"
67
+ binary = source / payload
68
+ binary.parent.mkdir(parents=True)
69
+ binary.write_bytes(b"\x00\x01\xff")
70
+
71
+ def git(*args):
72
+ return subprocess.run(["git", "-c", "core.longpaths=true", *args],
73
+ check=True, capture_output=True, text=True).stdout.strip()
74
+
75
+ git("init", str(source))
76
+ git("-C", str(source), "add", ".")
77
+ git("-C", str(source), "-c", "user.name=Plugin Test", "-c", "user.email=plugin@example.invalid",
78
+ "commit", "-m", "Add plugin")
79
+ commit = git("-C", str(source), "rev-parse", "HEAD")
80
+ store = Path("\\\\?\\" + str(tmp_path / "Studio install"))
81
+ transactions = store / "transactions"
82
+ transactions.mkdir(parents=True)
83
+ url = "https://gitcode.com/owner/plugin"
84
+ monkeypatch.setenv("GIT_CONFIG_COUNT", "1")
85
+ monkeypatch.setenv("GIT_CONFIG_KEY_0", f"url.{source.as_uri()}.insteadOf")
86
+ monkeypatch.setenv("GIT_CONFIG_VALUE_0", url)
87
+
88
+ result = install_mod.install(url, plugins_dir=store / "installed", no_deps=True,
89
+ ref=commit if pinned else None, temporary_root=transactions)
90
+
91
+ assert result.name == "author.demo"
92
+ assert (result.path / "pyproject.toml").read_text(encoding="utf-8") == MANIFEST.decode()
93
+ assert (result.path / payload).read_bytes() == b"\x00\x01\xff"
94
+ if long_path:
95
+ assert len(str(result.path / payload)) > 260
96
+ record = json.loads((result.path / ".pymss-install.json").read_text(encoding="utf-8"))
97
+ assert record["resolved_commit"] == commit
98
+ assert not (result.path / ".git").exists()
99
+ assert list(transactions.iterdir()) == []
100
+
101
+
102
+ @pytest.mark.parametrize(("platform", "temporary", "expected"), [
103
+ ("win32", r"\\?\C:\plugin cache", r"C:\plugin cache"),
104
+ ("win32", r"\\?\UNC\server\plugin cache", r"\\server\plugin cache"),
105
+ ("win32", r"C:\plugin cache", r"C:\plugin cache"),
106
+ ("darwin", "/tmp/plugin cache", "/tmp/plugin cache"),
107
+ ("linux", "/tmp/plugin cache", "/tmp/plugin cache"),
108
+ ])
109
+ def test_git_directory_arguments_use_platform_paths(tmp_path, monkeypatch, platform, temporary, expected):
110
+ class StopGit(RuntimeError):
111
+ pass
112
+
113
+ def run(command, **options):
114
+ assert command[-1] == str(Path(expected) / "repo")
115
+ assert command[:-1] == (["git", "-c", "core.longpaths=true", "clone", "--depth", "1",
116
+ "ssh://example.invalid/plugins.git"] if platform == "win32" else
117
+ ["git", "clone", "--depth", "1", "ssh://example.invalid/plugins.git"])
118
+ raise StopGit
119
+
120
+ monkeypatch.setattr(install_mod, "sys", SimpleNamespace(platform=platform))
121
+ monkeypatch.setattr(install_mod, "_git_available", lambda: True)
122
+ monkeypatch.setattr(install_mod.tempfile, "TemporaryDirectory", lambda **options: nullcontext(temporary))
123
+ monkeypatch.setattr(install_mod.subprocess, "run", run)
124
+ with pytest.raises(StopGit):
125
+ install_mod._clone("ssh://example.invalid/plugins.git", tmp_path / "plugin")
126
+
127
+
50
128
  @pytest.fixture(autouse=True)
51
129
  def block_network(monkeypatch):
52
130
  monkeypatch.setattr(sources.urllib.request, "urlopen", Mock(side_effect=AssertionError("Unexpected network request")))
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