refactor: skill_pack技能库目录改运行目录(cwd/skills_library),不进site-packages
This commit is contained in:
parent
aed3f9bfdf
commit
2a88fd2375
@ -18,13 +18,15 @@ import shutil
|
|||||||
|
|
||||||
|
|
||||||
def get_library_dir():
|
def get_library_dir():
|
||||||
"""技能库根目录。优先环境变量 PIPELINE_SKILLS_LIBRARY,否则默认 pipeline-core 仓库内 skills_library/。"""
|
"""技能库根目录(数据目录,与技能根目录 skills/ 并列放在运行目录下)。
|
||||||
|
|
||||||
|
优先级:环境变量 PIPELINE_SKILLS_LIBRARY > 运行目录(cwd)下的 skills_library/。
|
||||||
|
与 skill_loader 的 base_dir="skills"(相对 cwd)保持一致,都不进 site-packages。
|
||||||
|
"""
|
||||||
env = os.environ.get("PIPELINE_SKILLS_LIBRARY", "")
|
env = os.environ.get("PIPELINE_SKILLS_LIBRARY", "")
|
||||||
if env:
|
if env:
|
||||||
return os.path.normpath(env)
|
return os.path.normpath(env)
|
||||||
return os.path.normpath(
|
return os.path.normpath(os.path.join(os.getcwd(), "skills_library"))
|
||||||
os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "skills_library")
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
LIBRARY_DIR = get_library_dir()
|
LIBRARY_DIR = get_library_dir()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user