Skip to content

Commit b9287c9

Browse files
authored
bugfix: fix regex in update wheel index script (#2009)
<!-- .github/pull_request_template.md --> ## 📌 Description The regex cannot recognize release candidates (`v0.5.0rc1`) or post releases (`v1.2.3.post1`): https://github.com/flashinfer-ai/flashinfer/actions/runs/18929490991/job/54049304551 This PR fixes the issue. ## 🔍 Related Issues https://github.com/flashinfer-ai/flashinfer/actions/runs/18929490991/job/54049304551 ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete. ### ✅ Pre-commit Checks - [x] I have installed `pre-commit` by running `pip install pre-commit` (or used your preferred method). - [x] I have installed the hooks with `pre-commit install`. - [x] I have run the hooks manually with `pre-commit run --all-files` and fixed any reported issues. > If you are unsure about how to set up `pre-commit`, see [the pre-commit documentation](https://pre-commit.com/). ## 🧪 Tests - [x] Tests have been added or updated as needed. - [ ] All tests are passing (`unittest`, etc.). ## Reviewer Notes <!-- Optional: anything you'd like reviewers to focus on, concerns, etc. --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Enhanced version string parsing in the wheel package indexing process to support more complex version formats, including pre-release, post-release, and development versions, ensuring compatibility with PEP 440 versioning standards. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 3c07921 commit b9287c9

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

scripts/update_whl_index.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ def get_package_info(wheel_path: pathlib.Path) -> Optional[dict]:
3131
wheel_name = wheel_path.name
3232

3333
# Try flashinfer-python pattern
34-
match = re.match(r"flashinfer_python-([0-9.]+(?:\.dev\d+)?)-", wheel_name)
34+
# Supports PEP 440: base_version[{a|b|rc}N][.postN][.devN]
35+
match = re.match(
36+
r"flashinfer_python-([0-9.]+(?:(?:a|b|rc)\d+)?(?:\.post\d+)?(?:\.dev\d+)?)-",
37+
wheel_name,
38+
)
3539
if match:
3640
version = match.group(1)
3741
return {
@@ -41,7 +45,11 @@ def get_package_info(wheel_path: pathlib.Path) -> Optional[dict]:
4145
}
4246

4347
# Try flashinfer-cubin pattern
44-
match = re.match(r"flashinfer_cubin-([0-9.]+(?:\.dev\d+)?)-", wheel_name)
48+
# Supports PEP 440: base_version[{a|b|rc}N][.postN][.devN]
49+
match = re.match(
50+
r"flashinfer_cubin-([0-9.]+(?:(?:a|b|rc)\d+)?(?:\.post\d+)?(?:\.dev\d+)?)-",
51+
wheel_name,
52+
)
4553
if match:
4654
version = match.group(1)
4755
return {
@@ -51,7 +59,11 @@ def get_package_info(wheel_path: pathlib.Path) -> Optional[dict]:
5159
}
5260

5361
# Try flashinfer-jit-cache pattern (has CUDA suffix in version)
54-
match = re.match(r"flashinfer_jit_cache-([0-9.]+(?:\.dev\d+)?\+cu\d+)-", wheel_name)
62+
# Supports PEP 440: base_version[{a|b|rc}N][.postN][.devN]+cuXXX
63+
match = re.match(
64+
r"flashinfer_jit_cache-([0-9.]+(?:(?:a|b|rc)\d+)?(?:\.post\d+)?(?:\.dev\d+)?\+cu\d+)-",
65+
wheel_name,
66+
)
5567
if match:
5668
version = match.group(1)
5769
cuda_ver = get_cuda_version(wheel_name)

0 commit comments

Comments
 (0)