Skip to content

Commit

Permalink
feat: Use conda/conda-build instead of mamba/conda-mambabuild
Browse files Browse the repository at this point in the history
conda>=23.10 uses conda-libmamba-solver by default which means we don't
need the solver injection via boa/conda-mambabuild anymore since it is
handled upstream.

Signed-off-by: Marcel Bargull <[email protected]>
  • Loading branch information
mbargull committed Apr 15, 2024
1 parent dc6ca07 commit efa588a
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bioconda_utils/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def build(recipe: str, pkg_paths: List[str] = None,
"cannot be found", pkg_path)
return BuildResult(False, None)
else:
conda_build_cmd = [utils.bin_for('conda'), 'mambabuild']
conda_build_cmd = [utils.bin_for('conda-build')]
# - Temporarily reset os.environ to avoid leaking env vars
# - Also pass filtered env to run()
# - Point conda-build to meta.yaml, to avoid building subdirs
Expand Down
4 changes: 2 additions & 2 deletions bioconda_utils/docker_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@
# The actual building...
# we explicitly point to the meta.yaml, in order to keep
# conda-build from building all subdirectories
conda mambabuild -c file://{self.container_staging} {self.conda_build_args} {self.container_recipe}/meta.yaml 2>&1
conda-build -c file://{self.container_staging} {self.conda_build_args} {self.container_recipe}/meta.yaml 2>&1
# copy all built packages to the staging area
cp /opt/conda/conda-bld/*/*.tar.bz2 {self.container_staging}/{arch}
#While technically better, this is slower and more prone to breaking
#cp `conda mambabuild {self.conda_build_args} {self.container_recipe}/meta.yaml --output | grep tar.bz2` {self.container_staging}/{arch}
#cp `conda-build {self.conda_build_args} {self.container_recipe}/meta.yaml --output | grep tar.bz2` {self.container_staging}/{arch}
conda index {self.container_staging}
# Ensure permissions are correct on the host.
HOST_USER={self.user_info[uid]}
Expand Down
1 change: 0 additions & 1 deletion bioconda_utils/involucro
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

exec involucro \
-set POSTINSTALL='create-env --conda=: /usr/local' \
-set PREINSTALL='conda() { mamba "${@}" ; }' \
"${@}"
2 changes: 0 additions & 2 deletions bioconda_utils/pkg_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ def test_package(
# galaxy-lib always downloads involucro, unless it's in cwd or its path is explicitly given.
# We inject a POSTINSTALL to the involucro command with a small wrapper to
# create activation / entrypoint scripts for the container.
# We also inject a PREINSTALL to alias conda to mamba so `mamba install` is
# used instead of `conda install` in the container builds.
involucro_path = os.path.join(os.path.dirname(__file__), 'involucro')
if not os.path.exists(involucro_path):
raise RuntimeError('internal involucro wrapper missing')
Expand Down
3 changes: 0 additions & 3 deletions bioconda_utils/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import conda_build.api
from conda_build.metadata import MetaData
from boa.cli.mambabuild import prepare as insert_mambabuild

import jinja2

Expand Down Expand Up @@ -770,8 +769,6 @@ def new_exit(args=None):
raise SystemExit(args)
sys.exit = new_exit

insert_mambabuild()

try:
with open("/dev/null", "w") as devnull:
with redirect_stdout(devnull), redirect_stderr(devnull):
Expand Down
3 changes: 0 additions & 3 deletions bioconda_utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
from conda_build import api
from conda.exports import VersionOrder
from conda.exports import subdir as conda_subdir
from boa.cli.mambabuild import prepare as insert_mambabuild

from jsonschema import validate
from colorlog import ColoredFormatter
Expand Down Expand Up @@ -436,8 +435,6 @@ def load_all_meta(recipe, config=None, finalize=True):
via conda and also download of those packages (to inspect possible
run_exports). For fast-running tasks like linting, set to False.
"""
insert_mambabuild()

if config is None:
config = load_conda_build_config()
# `bypass_env_check=True` prevents evaluating (=environment solving) the
Expand Down
1 change: 0 additions & 1 deletion test/test_pkg_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from bioconda_utils import build

from conda import __version__ as conda_version
from mamba import __version__ as mamba_version

# TODO:
# need tests for channel order and extra channels (see
Expand Down

0 comments on commit efa588a

Please sign in to comment.