Skip to content

Commit

Permalink
first prototype; working 'conda create -dnx numpy'
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Dec 20, 2023
1 parent b236d9d commit dd1f2da
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
8 changes: 7 additions & 1 deletion conda_libmamba_solver/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ def __init__(
self._repodata_fn = repodata_fn

self._repos = []
self._pool = api.Pool()
self._channel_context = api.ChannelContext(
params=api.specs.ChannelResolveParams(platforms=set(self._subdirs)),
has_zst=[],
)
for channel in self._channels:
self._channel_context.make_channel(channel.base_url)
self._pool = api.Pool(self._channel_context)

installed_repo = self._load_installed(installed_records)
self._repos.append(installed_repo)
Expand Down
8 changes: 4 additions & 4 deletions conda_libmamba_solver/mamba_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def set_channel_priorities(index: Dict[str, "_ChannelRepoInfo"], has_priority: b
def init_api_context() -> api.Context:
# This function has to be called BEFORE 1st initialization of the context
api.Context.use_default_signal_handler(False)
api_ctx = api.Context()
api_ctx = api.Context.instance()

# Output params
api_ctx.output_params.json = context.json
Expand Down Expand Up @@ -146,10 +146,10 @@ def init_api_context() -> api.Context:
]

if context.channel_priority is ChannelPriority.STRICT:
api_ctx.channel_priority = api.ChannelPriority.kStrict
api_ctx.channel_priority = api.ChannelPriority.Strict
elif context.channel_priority is ChannelPriority.FLEXIBLE:
api_ctx.channel_priority = api.ChannelPriority.kFlexible
api_ctx.channel_priority = api.ChannelPriority.Flexible
elif context.channel_priority is ChannelPriority.DISABLED:
api_ctx.channel_priority = api.ChannelPriority.kDisabled
api_ctx.channel_priority = api.ChannelPriority.Disabled

return api_ctx
4 changes: 2 additions & 2 deletions dev/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pip
# run-time
boltons>=23.0.0
conda>=23.7.3
libmamba>=1.5.3
libmambapy>=1.5.3
conda-forge/label/mamba_dev::libmamba>=2.0.0a0
conda-forge/label/mamba_dev::libmambapy>=2.0.0a0
# be explicit about sqlite because sometimes it's removed from the env :shrug:
sqlite
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ requirements:
run:
- python >=3.8
- conda >=23.7.3
- libmambapy >=1.5.3
- libmambapy >=2.0
- boltons >=23.0.0

test:
Expand Down

0 comments on commit dd1f2da

Please sign in to comment.