phase5: mặc định RENDER_ENGINE=bridge, gỡ pedalboard khỏi requirements/source/LICENSE

- config.py: SF_RENDER_ENGINE default 'bridge' (pedalboard GPL-3.0 đã gỡ)
- requirements.txt: bỏ pedalboard==0.9.19
- vst_engine.py: bỏ HAS_PEDALBOARD/check_pedalboard_safe/load_vst/import pedalboard;
  midi_events_to_messages giữ làm utility thuần (không gate pedalboard)
- render_engine.py: bỏ nhánh elif vst and HAS_PEDALBOARD + import thừa
- plugins.py: preview/midi-render chỉ qua native_bridge; guard SF_RENDER_ENGINE=bridge
- runtime.py: _vst_render_available() check bridge exe (SF_BRIDGE_PATH/install/) thay find_spec('pedalboard')
- LICENSE.md/THIRD_PARTY_LICENSES.md: bỏ cảnh báo GPL-3.0 pedalboard, đánh số lại
- tests: bỏ test golden so pedalboard + test requires_pedalboard; 114 passed 0 skip
This commit is contained in:
2026-08-17 12:58:51 +07:00
parent e79dae5d5c
commit dc331f39d8
14 changed files with 55 additions and 215 deletions
-15
View File
@@ -5,7 +5,6 @@ from fastapi.testclient import TestClient
from unittest.mock import patch, MagicMock
from app.main import app
from app.core.vst_engine import HAS_PEDALBOARD, HAS_PYFLUIDSYNTH
client = TestClient(app)
@@ -176,20 +175,6 @@ class TestMidiRenderVSTi:
assert resp.status_code == 404
assert "VSTi" in resp.json()["detail"]
def test_midi_render_requires_pedalboard(self):
# Nếu pedalboard thiếu → 501 (không crash)
import app.api.v1.plugins as plugins_mod
token = get_admin_token()
if not token:
pytest.skip("Cannot get admin token")
if not plugins_mod.HAS_PEDALBOARD:
resp = client.post("/api/v1/plugins/midi-render", headers={"Authorization": f"Bearer {token}"},
json={"instrument_id": "x",
"notes": [{"pitch": 60, "start_beat": 0, "duration_beats": 1}]})
assert resp.status_code == 501
else:
pytest.skip("pedalboard present — render path covered by unknown-instrument test")
def test_carla_play_notes_requires_auth(self):
client.cookies.clear() # TestClient giữ cookie login từ test trước
resp = client.post("/api/v1/plugins/carla-play-notes",