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

Try Revert "Fix Repo missing url" #2730

Merged
merged 1 commit into from
Aug 3, 2023
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
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