Skip to content

Commit 4b93661

Browse files
committed
allow file:// urls in experimental_index_url
1 parent 87906f0 commit 4b93661

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

python/private/pypi/simpleapi_download.bzl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ def _read_simpleapi(ctx, url, attr, cache, get_auth = None, **download_kwargs):
195195
attr.envsubst,
196196
ctx.getenv if hasattr(ctx, "getenv") else ctx.os.environ.get,
197197
))
198+
print("-----")
199+
print(url)
200+
print(real_url)
201+
print("-----")
198202

199203
cache_key = real_url
200204
if cache_key in cache:
@@ -235,7 +239,7 @@ def _read_simpleapi(ctx, url, attr, cache, get_auth = None, **download_kwargs):
235239
return _read_index_result(ctx, download, output, real_url, cache, cache_key)
236240

237241
def strip_empty_path_segments(url):
238-
"""Removes empty path segments from a URL. Does nothing for urls with no scheme.
242+
"""Removes empty path segments from a URL. Does nothing for urls with no scheme and file:// urls.
239243
240244
Public only for testing.
241245
@@ -246,6 +250,8 @@ def strip_empty_path_segments(url):
246250
The url with empty path segments removed and any trailing slash preserved.
247251
If the url had no scheme it is returned unchanged.
248252
"""
253+
if url.startswith("file://"):
254+
return url
249255
scheme, _, rest = url.partition("://")
250256
if rest == "":
251257
return url

0 commit comments

Comments
 (0)