Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 使用当前环境的 Python 版本进行测试 #213

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/

- 修复指定 key 时无法正确读取配置的问题
- 插件测试时设置为 10 分钟超时
- 使用当前环境的 Python 版本进行测试

## [3.2.4] - 2024-02-04

Expand Down
7 changes: 6 additions & 1 deletion src/utils/plugin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,18 @@ def get_env(self) -> dict[str, str]:
env.pop("VIRTUAL_ENV", None)
# 启用 LOGURU 的颜色输出
env["LOGURU_COLORIZE"] = "true"
# Poetry 配置
# https://python-poetry.org/docs/configuration/#virtualenvsin-project
env["POETRY_VIRTUALENVS_IN_PROJECT"] = "true"
# https://python-poetry.org/docs/configuration/#virtualenvsprefer-active-python-experimental
env["POETRY_VIRTUALENVS_PREFER_ACTIVE_PYTHON"] = "true"
return env

async def create_poetry_project(self) -> None:
if not self.path.exists():
self.path.mkdir()
proc = await create_subprocess_shell(
f"""poetry init -n && sed -i "s/\\^/~/g" pyproject.toml && poetry config virtualenvs.in-project true --local && poetry env info --ansi && poetry add {self.project_link}""",
f"""poetry init -n && sed -i "s/\\^/~/g" pyproject.toml && poetry env info --ansi && poetry add {self.project_link}""",
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=self.path,
Expand Down
Loading