Skip to content

Commit

Permalink
fix: 修复项目名不用 - 分割时无法提取到版本的问题 (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 authored Feb 4, 2024
1 parent 78ab0f5 commit 70fa5a0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/

## [Unreleased]

### Fixed

- 修复项目名不用 - 分割时无法提取到版本的问题

## [3.2.3] - 2024-02-01

### Fixed
Expand Down
2 changes: 2 additions & 0 deletions src/utils/store_test/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def extract_version(path: Path, project_link: str) -> str | None:
return match.group(1).strip()

# 匹配版本解析失败的情况
# 目前有很多插件都把信息填错了,没有使用 - 而是使用了 _
project_link = project_link.replace("_", "-")
match = re.search(
rf"depends on {project_link} \(\^(\S+)\), version solving failed\.", output
)
Expand Down
4 changes: 4 additions & 0 deletions tests/utils/store_test/test_extract_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ def test_extract_version_failed(tmp_path: Path):

assert version == "0.2.1"

version = extract_version(tmp_path, "nonebot_plugin_mockingbird")

assert version == "0.2.1"

version = extract_version(tmp_path, "nonebot2")

assert version is None

0 comments on commit 70fa5a0

Please sign in to comment.