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.
- {pymss-2.3.2 → pymss-2.3.3}/PKG-INFO +1 -1
- {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/install.py +15 -7
- {pymss-2.3.2 → pymss-2.3.3}/pymss.egg-info/PKG-INFO +1 -1
- {pymss-2.3.2 → pymss-2.3.3}/pyproject.toml +1 -1
- {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_sources.py +79 -1
- {pymss-2.3.2 → pymss-2.3.3}/LICENSE +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/README.md +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/__init__.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/__main__.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/_builtin_node_types.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/_identifiers.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/audio_io.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/audio_services.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/cli.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/config.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/ensemble.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/graph/__init__.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/graph/builtin_nodes.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/graph/comfy_loader.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/graph/core.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/graph/nodes.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/graph/runner.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/graph/yaml_compiler.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/logger.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/model_download.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/model_registry.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/__init__.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/_core_shims.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/vocal_remover/__init__.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/vocal_remover/common_separator.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/vocal_remover/uvr_lib_v5/__init__.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/vocal_remover/uvr_lib_v5/spec_utils.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/vocal_remover/vr_mlx.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/vocal_remover/vr_models.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/modules/vocal_remover/vr_separator.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/__init__.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/_command_bootstrap.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/_command_process.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/_profile_lock.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/_python_entry.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/_rpc_session.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/builtins.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/command.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/files.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/graph_bridge.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/host_services.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/kit_builtins.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/python_profiles.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/operations/rpc_process.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/__init__.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/builtins.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/codecs.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/graph_ops.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/kit.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/lifecycle.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/loader.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/manifest.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/marketplace.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/registry.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/service.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/plugins/sources.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/progress.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/model_catalog.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/1band_sr16000_hl512.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/1band_sr32000_hl512.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/1band_sr33075_hl384.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/1band_sr44100_hl1024.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/1band_sr44100_hl256.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/1band_sr44100_hl512.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/1band_sr44100_hl512_cut.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/1band_sr44100_hl512_nf1024.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/2band_32000.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/2band_44100_lofi.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/2band_48000.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/3band_44100.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/3band_44100_mid.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/3band_44100_msb2.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_44100.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_44100_mid.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_44100_msb.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_44100_msb2.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_44100_reverse.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_44100_sw.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_v2.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_v2_sn.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_v3.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_v3_sn.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/resources/vr_modelparams/4band_v4_ms_fullband.json +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/separator.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/__init__.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/app.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/audio.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/config.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/errors.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/models.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/state.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/index-C2f3RgYK.js +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/index-Dd_kG96D.css +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/noto-sans-cyrillic-ext-wght-normal-DSNfmdVt.woff2 +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/noto-sans-cyrillic-wght-normal-B2hlT84T.woff2 +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/noto-sans-devanagari-wght-normal-Cv-Vwajv.woff2 +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/noto-sans-greek-ext-wght-normal-12T8GTDR.woff2 +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/noto-sans-greek-wght-normal-Ymb6dZNd.woff2 +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/noto-sans-latin-ext-wght-normal-W1qJv59z.woff2 +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/noto-sans-latin-wght-normal-BYSzYMf3.woff2 +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/assets/noto-sans-vietnamese-wght-normal-DLTJy58D.woff2 +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/server/webui_static/index.html +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/user_models.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/utils.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss/workflow.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss.egg-info/SOURCES.txt +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss.egg-info/dependency_links.txt +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss.egg-info/entry_points.txt +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss.egg-info/requires.txt +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss.egg-info/top_level.txt +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/LICENSE +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/NOTICE +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/__init__.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/_engine.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/cli.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/context.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/environment.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/inventory.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/leases.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/locks.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/profiles.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/pymss_plugin_manager/service.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/setup.cfg +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_all.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_audio_downmix.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_audio_formats.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_audio_layout_metadata.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_audio_materialization.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_audio_resample.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_audio_services.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_builtin_capabilities.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_builtin_operations.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_codec_capabilities.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_command_bootstrap.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_command_operations.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_command_process.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_core_shims.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_graph.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_graph_audio_merge.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_graph_custom_models.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_graph_execution_events.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_graph_lifecycle.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_graph_resample_service.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_graph_runner_lifecycle.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_kit_builtins.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_legacy_loudnorm_node.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_mlx_warmup.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_model_catalog_overrides.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_model_detection.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_model_download_progress.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_npu_runtime.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_operation_graph_bridge.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_operation_invocation.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_operations.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_overlap_finalize.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_environment.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_kit.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_macos_attributes.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_management.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_marketplace.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_node_contract.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_protocol.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_plugin_protocol_posix.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_plugins.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_polarformer.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_progress.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_python_profiles.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_rpc_declarations.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_rpc_process.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_separator_channels.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_separator_device_defaults.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_use_amp.py +0 -0
- {pymss-2.3.2 → pymss-2.3.3}/test/test_workflow.py +0 -0
|
@@ -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
|
-
[
|
|
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",
|
|
153
|
-
git("-C",
|
|
154
|
-
git("-C",
|
|
155
|
-
git("-C",
|
|
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,
|
|
158
|
-
commit = git("-C",
|
|
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
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pymss"
|
|
7
|
-
version = "2.3.
|
|
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
|
|
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
|
|
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
|
|
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
|