fix: detect desktop runtime without frozen python#5859
fix: detect desktop runtime without frozen python#5859zouyonghe merged 2 commits intoAstrBotDevs:masterfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines AstrBot's desktop backend runtime detection to ensure that plugin installations and root path resolutions behave correctly, even when Python is not frozen. By simplifying the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Hey - 我已经审查了你的更改,一切看起来都很棒!
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈来改进后续的代码审查。
Original comment in English
Hey - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Code Review
This pull request correctly adjusts the desktop runtime detection to be independent of whether the Python interpreter is frozen. This is achieved by making is_packaged_desktop_runtime rely solely on the ASTRBOT_DESKTOP_CLIENT environment variable. The change is well-supported by comprehensive regression tests for runtime detection, PipInstaller behavior, and root path resolution. The inclusion of design and implementation plan documents is also a good practice. I have one minor suggestion regarding a leftover instruction in one of the documentation files.
| @@ -0,0 +1,149 @@ | |||
| # Linux Desktop Plugin Install Implementation Plan | |||
|
|
|||
| > **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. | |||
Summary
ASTRBOT_DESKTOP_CLIENT=1as the desktop backend runtime signal even when Python is not frozendata/site-packagesand keep desktop root resolution aligned with the launcher contractASTRBOT_ROOToverride, andPipInstallertarget-site-packages behaviorTest Plan
.venv/bin/python -m pytest tests/test_runtime_env.py tests/test_pip_installer.py tests/test_dashboard.py -q.venv/bin/ruff check astrbot/core/utils/runtime_env.py tests/test_runtime_env.py tests/test_pip_installer.pySummary by Sourcery
将
ASTRBOT_DESKTOP_CLIENT环境变量视为桌面后端运行时的规范信号,并围绕桌面插件安装和根路径解析添加回归覆盖和文档说明。Bug 修复:
ASTRBOT_DESKTOP_CLIENT=1来检测打包后的桌面运行时,使桌面行为不再依赖 Python 是否被冻结(frozen)。文档:
测试:
ASTRBOT_ROOT两种情况下的 AstrBot 根路径解析测试,以及PipInstaller行为测试,以确保桌面安装目标为data/site-packages目录。Original summary in English
Summary by Sourcery
Treat the ASTRBOT_DESKTOP_CLIENT environment variable as the canonical signal for desktop backend runtime and add regression coverage and documentation around desktop plugin installs and root resolution.
Bug Fixes:
Documentation:
Tests: