新增环境信息参数、info 访问层与仓库 URL 集中化 (Add --info flag, info access layer and centralized repository URLs) - #295
Open
dongly wants to merge 1 commit into
Open
新增环境信息参数、info 访问层与仓库 URL 集中化 (Add --info flag, info access layer and centralized repository URLs)#295dongly wants to merge 1 commit into
dongly wants to merge 1 commit into
Conversation
Member
|
可否给一个实际输出情况? |
Contributor
Author
|
已更新实际输出 |
dongly
force-pushed
the
show-version-squashed
branch
from
September 12, 2026 03:28
8f369ba to
15aecb7
Compare
Contributor
Author
|
已更新为最终实现:在原有 --info / 打包整合基础上合入 version.py→info.py 重命名、env.json 仓库 URL 集中化(repositories / submodule_mirrors / apis)与行尾 LF 策略,squash 重新提交,PR 描述同步更新。 |
dongly
force-pushed
the
show-version-squashed
branch
from
September 12, 2026 03:35
15aecb7 to
e7b09e5
Compare
Contributor
Author
|
补充修正:License 元数据更正为 |
…r and centralized repository URLs)
dongly
force-pushed
the
show-version-squashed
branch
from
September 12, 2026 09:56
e7b09e5 to
01305c8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
本 PR 拆分自 #271
本 PR 为 env 工具新增
--info参数显示环境信息横幅,激活脚本增加欢迎信息,并将打包元数据整合至
pyproject.toml(分发名rt-env),版本号与描述统一由env.json单源提供。同时将version.py更名为info.py并扩展为 env.json 的唯一访问层:仓库 URL、镜像与分支信息全部集中到 env.json,代码中的硬编码 URL
改由访问器读取。
变更明细
--info参数:输出环境信息横幅(ENV_ROOT / PKGS_ROOT / RTT_ROOT / BSP_ROOT / RT-Thread 版本);argparse 程序名固定为rt-env,usage 不再显示 venv 启动器全路径env.sh/env.ps1激活成功后显示欢迎信息(rt-env --info,命令存在才显示);env.sh使用 POSIX 兼容重定向version.py更名为info.py,扩展为 env.json 唯一访问层:get_name/get_version/get_description、get_source()返回原子对Source(url, branch)(选镜像整组切换,杜绝主源 URL 配镜像分支)、子模块镜像模板与服务端点访问器;DEFAULTS 兜底只保底主源,镜像仅来自 env.json,未配置时回退主源;未知仓库名/缺 url 响亮报错repositories(env/sdk/packages,各自 url+branch+可选 mirror{url, branch},镜像分支可与主源不同)、submodule_mirrors({name} 占位模板)、apis;删除无消费方的repository死键pyproject.toml:分发名rt-env、6 个控制台入口(含webui)、完整包映射(含env.plugins.*);author/license/urls 保留;requires-python >= 3.7(setuptools>=61 构建后端要求);setup.py精简为动态 version/description 提供者;依赖新增pyyaml*.bat/*.cmd/*.ps1保持 CRLF);.gitignore忽略本地 OMO 状态目录输出
Linux 实际输出:
访问层实际返回:
行为对比
rt-env -vrt-env --infopip installPython 下限pip install分发名envrt-env(import 包名env.*不变)兼容性
-v/--version输出与 master 逐字节一致;子命令集不变env.*不变,仅分发名变更验证
-v、--info、--info <子命令>短路、-h、无效子命令、无参数帮助bash -n与bash --posix -n语法检查通过info.py兜底矩阵:env.json 缺失 / 损坏 / 单字段缺失test_env_venvurlopen mock 漂移)importlib.metadata以rt-env解析 2.0.2、6 个控制台入口全部生成、包与数据文件完整
rt-env --info横幅实际生效)source ~/.env/env.sh横幅实际生效,见上方输出)