Skip to content

Commit

Permalink
Try Revert "Fix Repo missing url" (#2730)
Browse files Browse the repository at this point in the history
Revert "Fix `Repo` missing url (#2723)"

This reverts commit c1eed66.
  • Loading branch information
AntoinePrv authored Aug 3, 2023
1 parent 0c51541 commit e35e32d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mamba/mamba/mamba_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
get_installed_jsonfile,
init_api_context,
load_channels,
load_conda_installed,
to_txn,
to_txn_precs,
)
Expand Down Expand Up @@ -79,9 +80,7 @@ def mamba_install(prefix, specs, args, env, dry_run=False, *_, **kwargs):
with tempfile.TemporaryDirectory() as td:
installed_json_f, installed_pkg_recs = get_installed_jsonfile(td)

prefix_data = api.PrefixData(context.target_prefix)
prefix_data.add_packages(api.get_virtual_packages())
repo = api.Repo(pool, prefix_data)
repo = load_conda_installed(pool, installed_json_f, installed_pkg_recs)
repos.append(repo)

solver = api.Solver(pool, solver_options)
Expand Down
17 changes: 17 additions & 0 deletions mamba/mamba/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@
import libmambapy as api


def load_conda_installed(pool, installed_json_f, installed_pkg_recs):
repo = api.Repo(pool, "installed", installed_json_f.name, "")
additional_infos = {}
for rec in installed_pkg_recs:
info = api.ExtraPkgInfo()
if rec.noarch:
info.noarch = rec.noarch.value
if rec.url:
info.repo_url = rec.url
additional_infos[rec.name] = info

repo.add_extra_pkg_info(additional_infos)
repo.set_installed()

return repo


def load_channel(subdir_data, result_container):
if not context.quiet:
print("Getting ", subdir_data.channel.name, subdir_data.channel.platform)
Expand Down

0 comments on commit e35e32d

Please sign in to comment.