Skip to content

Commit

Permalink
Investigate local:: specs issues (#401)
Browse files Browse the repository at this point in the history
Co-authored-by: Isuru Fernando <[email protected]>
Co-authored-by: Jannis Leidel <[email protected]>
  • Loading branch information
3 people authored Jan 10, 2024
1 parent 974ffe1 commit c69f7e6
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 4 deletions.
2 changes: 2 additions & 0 deletions conda_libmamba_solver/mamba_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ def init_api_context() -> api.Context:
_get_base_url(x.url(with_credentials=True)) for x in context.default_channels
]

api_ctx.conda_build_local_paths = list(context.conda_build_local_paths)

if context.channel_priority is ChannelPriority.STRICT:
api_ctx.channel_priority = api.ChannelPriority.kStrict
elif context.channel_priority is ChannelPriority.FLEXIBLE:
Expand Down
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
libmamba>=1.5.6
libmambapy>=1.5.6
# be explicit about sqlite because sometimes it's removed from the env :shrug:
sqlite
19 changes: 19 additions & 0 deletions news/401-custom-local
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* Properly propagate customized local channels (conda-build workspaces). Requires `libmamba 1.5.6` or above. (#398 via #401)

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classifiers = [
requires-python = ">=3.8"
dependencies = [
"conda >=23.7.3",
"libmambapy >=1.5.3",
"libmambapy >=1.5.6",
"boltons >=23.0.0",
]
dynamic = [
Expand Down
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 >=1.5.6
- boltons >=23.0.0

test:
Expand Down
28 changes: 28 additions & 0 deletions tests/test_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,34 @@ def test_http_server_auth_token_in_defaults(http_server_auth_token):
condarc.unlink()


def test_local_spec():
"https://github.com/conda/conda-libmamba-solver/issues/398"
env = os.environ.copy()
env["CONDA_BLD_PATH"] = str(DATA / "mamba_repo")
process = conda_subprocess(
"create",
"-p",
_get_temp_prefix(use_restricted_unicode=on_win),
"--dry-run",
"--solver=libmamba",
"--channel=local",
"test-package",
env=env,
)
assert process.returncode == 0

process = conda_subprocess(
"create",
"-p",
_get_temp_prefix(use_restricted_unicode=on_win),
"--dry-run",
"--solver=libmamba",
"local::test-package",
env=env,
)
assert process.returncode == 0


def test_unknown_channels_do_not_crash(tmp_path):
"https://github.com/conda/conda-libmamba-solver/issues/418"
DATA = Path(__file__).parent / "data"
Expand Down

0 comments on commit c69f7e6

Please sign in to comment.