"""Verify the artifact actually deployed, including fresh-process imports.""" import json import os from pathlib import Path import subprocess import sys import zipfile from config import ROOT def test_archive_contains_all_upstream_sources_and_imports(tmp_path): archive=tmp_path/'release.zip' subprocess.run([sys.executable,str(ROOT/'scripts/package.py'),str(archive)],check=True,capture_output=True,text=True) with zipfile.ZipFile(archive) as z: names=set(z.namelist()) for item in json.loads((ROOT/'vendor-manifest.json').read_text())['files']: assert 'zonos3-mini-space/'+item['path'] in names z.extractall(tmp_path/'extract') extracted=tmp_path/'extract/zonos3-mini-space' env={**os.environ,'ZONOS_UI_ONLY':'1','PYTHONPATH':str(extracted),'GRADIO_ANALYTICS_ENABLED':'False'} process=subprocess.run([sys.executable,'-c', 'import engine, app; from zonos3.models.mect_speaker import MECTFbankSpeakerEmbedding; assert engine.ENGINE is None'], cwd=extracted,env=env,capture_output=True,text=True,timeout=60) assert process.returncode==0,process.stderr