Skip to content

Commit

Permalink
fix authenticated downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Jan 15, 2024
1 parent 8982dc4 commit a180a3b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions conda_libmamba_solver/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,12 +891,16 @@ def _package_record_from_json_payload(
return PackageRecord(**json.loads(json_payload))

kwargs = json.loads(json_payload)
try:
channel_info = index.get_info(channel)
except KeyError:
channel_info = None
if channel_info and channel_info.full_url != channel_info.noauth_url:
kwargs["url"] = kwargs["url"].replace(channel_info.noauth_url, channel_info.full_url)
if for_conda_build:
# conda-build expects multichannel instances in the Dist->PackageRecord mapping
# see https://github.com/conda/conda-libmamba-solver/issues/363
try:
channel_info = index.get_info(channel)
except KeyError:
if channel_info is None:
# this channel was never used to build the index, which
# means we obtained an already installed PackageRecord
# whose metadata contains a channel that doesn't exist
Expand Down

0 comments on commit a180a3b

Please sign in to comment.