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

Bundle conda-libmamba-solver #27

Merged
merged 25 commits into from
Aug 9, 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
19 changes: 19 additions & 0 deletions news/27-add-conda-libmamba-solver
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* Add `conda-libmamba-solver` to the list of bundled packages. (#27)

### Bug fixes

* <news item>

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>
4 changes: 4 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% set conda_version = "23.7.2" %}
{% set conda_libmamba_solver_version = "23.7.0" %}
{% set libmambapy_version = "1.4.1" %}
{% set constructor_version = "3.4.5" %}
{% set python_version = "3.9.15" %}

Expand Down Expand Up @@ -32,6 +34,8 @@ requirements:
- conda ={{ conda_version }}
- conda-package-handling >=1.6
- menuinst >=1.4.18,<2.0a0 # [win]
- conda-libmamba-solver ={{ conda_libmamba_solver_version }}
- libmambapy ={{ libmambapy_version }}
run_constrained:
- constructor >={{ constructor_version }}

Expand Down
27 changes: 24 additions & 3 deletions src/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@
import os
import site

packages = ['conda', 'conda_package_handling', 'menuinst', 'conda_env']
site_packages = os.getenv('SP_DIR', site.getsitepackages()[0])
packages = [
"conda",
"conda_package_handling",
"menuinst",
"conda_env",
"conda_libmamba_solver",
"libmambapy",
]
site_packages = os.getenv("SP_DIR", site.getsitepackages()[0])
files = [
f
for package in packages
Expand All @@ -20,7 +27,9 @@
continue
spec = importlib.util.spec_from_file_location(f, f)
modules[f] = importlib.util.module_from_spec(spec)
print(os.path.relpath(f, site_packages).removesuffix('.py').replace(os.path.sep, '.'))
print(
os.path.relpath(f, site_packages).removesuffix(".py").replace(os.path.sep, ".")
)

import conda.__init__
import conda.__version__
Expand Down Expand Up @@ -232,6 +241,15 @@
import conda_env.specs.binstar
import conda_env.specs.requirements
import conda_env.specs.yaml_file
import conda_libmamba_solver.__init__
import conda_libmamba_solver.exceptions
import conda_libmamba_solver.index
import conda_libmamba_solver.mamba_utils
import conda_libmamba_solver.models
import conda_libmamba_solver.plugin
import conda_libmamba_solver.solver
import conda_libmamba_solver.state
import conda_libmamba_solver.utils
import conda_package_handling.__init__
import conda_package_handling.api
import conda_package_handling.cli
Expand All @@ -242,6 +260,9 @@
import conda_package_handling.tarball
import conda_package_handling.utils
import conda_package_handling.validate
import libmambapy.__init__
import libmambapy._version
import libmambapy.bindings

try:
import conda_env.__main__
Expand Down
7 changes: 5 additions & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import subprocess
import sys

import pytest

CONDA_EXE = os.environ.get(
"CONDA_STANDALONE",
os.path.join(sys.prefix, "standalone_conda", "conda.exe")
Expand All @@ -12,9 +14,10 @@ def run_conda(*args, **kwargs):
return subprocess.run([CONDA_EXE, *args], **kwargs)


def test_new_environment(tmp_path):
@pytest.mark.parametrize("solver", ["classic", "libmamba"])
def test_new_environment(tmp_path, solver):
env = os.environ.copy()
env["CONDA_SOLVER"] = "classic"
env["CONDA_SOLVER"] = solver
run_conda(
"create",
"-p",
Expand Down
Loading