Spaces:
Paused
Paused
fix: Windows 支持 — 跳过虚拟显示器,xvfbwrapper 改为 Linux-only 依赖
Browse filesWindows 没有 fcntl 模块,xvfbwrapper 不支持。
display.py 改为只在 Linux 且无 DISPLAY 环境变量时才启动 Xvfb。
pyproject.toml 中 xvfbwrapper 加 sys_platform == 'linux' 条件。
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Files changed (2)
8 unmodified lines91011121314158 unmodified lines"requests>=2.28.0","rich>=14.3.4","uvicorn[standard]>=0.44.0","xvfbwrapper>=0.2.9",][project.scripts]8 unmodified lines91011121314158 unmodified lines"requests>=2.28.0","rich>=14.3.4","uvicorn[standard]>=0.44.0","xvfbwrapper>=0.2.9; sys_platform == 'linux'",][project.scripts]
12345678910111213141516"""自动设置虚拟显示器(无头服务器)— 在 import 时执行"""import loggingimport oslogger = logging.getLogger(__name__)if not os.environ.get("DISPLAY"):try:from xvfbwrapper import Xvfb_vdisplay = Xvfb(width=1280, height=800)_vdisplay.start()except ImportError:os.system("Xvfb :99 -screen 0 1280x800x24 &")os.environ["DISPLAY"] = ":99"123456789101112131415161718192021"""自动设置虚拟显示器(无头服务器)— 在 import 时执行,Windows/macOS 跳过"""import loggingimport osimport syslogger = logging.getLogger(__name__)# Windows 和 macOS 不需要虚拟显示器(有真实显示器或 Playwright 自带 headless)if sys.platform == "linux" and not os.environ.get("DISPLAY"):try:from xvfbwrapper import Xvfb_vdisplay = Xvfb(width=1280, height=800)_vdisplay.start()except (ImportError, OSError):try:os.system("Xvfb :99 -screen 0 1280x800x24 &")os.environ["DISPLAY"] = ":99"except Exception:pass
pyproject.toml+1-1
src/autoteam/display.py+10-5