Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: escape more invalid repo string characters #2801

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

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
2 changes: 1 addition & 1 deletion 2 python/private/pypi/whl_repo_name.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def whl_repo_name(filename, sha256):
else:
parsed = parse_whl_name(filename)
name = normalize_name(parsed.distribution)
version = parsed.version.replace(".", "_").replace("!", "_")
version = parsed.version.replace(".", "_").replace("!", "_").replace("+", "_").replace("%", "_")
python_tag, _, _ = parsed.python_tag.partition(".")
abi_tag, _, _ = parsed.abi_tag.partition(".")
platform_tag, _, _ = parsed.platform_tag.partition(".")
Expand Down
12 changes: 12 additions & 0 deletions 12 tests/pypi/whl_repo_name/whl_repo_name_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ def _test_platform_whl(env):

_tests.append(_test_platform_whl)

def _test_name_with_plus(env):
got = whl_repo_name("gptqmodel-2.0.0+cu126torch2.6-cp312-cp312-linux_x86_64.whl", "")
env.expect.that_str(got).equals("gptqmodel_2_0_0_cu126torch2_6_cp312_cp312_linux_x86_64")

_tests.append(_test_name_with_plus)

def _test_name_with_percent(env):
got = whl_repo_name("gptqmodel-2.0.0%2Bcu126torch2.6-cp312-cp312-linux_x86_64.whl", "")
env.expect.that_str(got).equals("gptqmodel_2_0_0_2Bcu126torch2_6_cp312_cp312_linux_x86_64")

_tests.append(_test_name_with_percent)

def whl_repo_name_test_suite(name):
"""Create the test suite.

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.