All checks were successful
Publish Python Package to Gitea / publish (push) Successful in 1m2s
16 lines
467 B
Python
16 lines
467 B
Python
"""源码仓库内运行 tools/screencast 时,确保 src 在 sys.path(pip 安装后无需)。"""
|
||
from __future__ import annotations
|
||
|
||
import sys
|
||
from pathlib import Path
|
||
|
||
|
||
def bootstrap_src() -> None:
|
||
try:
|
||
import screencast # noqa: F401
|
||
except ImportError:
|
||
src = Path(__file__).resolve().parent.parent.parent / "src"
|
||
src_str = str(src)
|
||
if src.is_dir() and src_str not in sys.path:
|
||
sys.path.insert(0, src_str)
|