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

[Core] Fix bug to support S3 pre-signed url for .whl file #48560

Merged
merged 7 commits into from
Dec 16, 2024
Merged
Changes from 1 commit
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
Next Next commit
Support S3 pre-signed url for .whl file
Signed-off-by: Jeffrey(Xilang) Yan <[email protected]>
yantzu committed Nov 5, 2024
commit 0751236e5709dabc84b78cdc009391e6fbc64270
4 changes: 2 additions & 2 deletions python/ray/_private/runtime_env/packaging.py
Original file line number Diff line number Diff line change
@@ -233,11 +233,11 @@ def parse_uri(pkg_uri: str) -> Tuple[Protocol, str]:
)

if protocol in Protocol.remote_protocols():
if pkg_uri.endswith(".whl"):
if uri.path.endswith(".whl"):
# Don't modify the .whl filename. See
# https://peps.python.org/pep-0427/#file-name-convention
# for more information.
package_name = pkg_uri.split("/")[-1]
package_name = uri.path.split("/")[-1]
else:
package_name = f"{protocol.value}_{uri.netloc}{uri.path}"

5 changes: 5 additions & 0 deletions python/ray/tests/test_runtime_env_packaging.py
Original file line number Diff line number Diff line change
@@ -492,6 +492,11 @@ class TestParseUri:
("s3://bucket/file.zip", Protocol.S3, "s3_bucket_file.zip"),
("https://test.com/file.zip", Protocol.HTTPS, "https_test_com_file.zip"),
("gs://bucket/file.zip", Protocol.GS, "gs_bucket_file.zip"),
(
"https://test.com/package-0.0.1-py2.py3-none-any.whl?param=value",
Protocol.HTTPS,
"package-0.0.1-py2.py3-none-any.whl",
),
],
)
def test_parsing_remote_basic(self, parsing_tuple):