From e5e8169efbd56cf325916e78960d2d716c4a23d8 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Wed, 27 Mar 2024 23:34:31 +0100 Subject: [PATCH] Use conda/conda-build not mamba/conda-mambabuild conda>=23.10 uses conda-libmamba-solver by default which means we don't need need the solver injection via boa/conda-mambabuild anymore since it is handled upstream. Signed-off-by: Marcel Bargull --- .github/workflows/GithubActionTests.yml | 6 +++--- bioconda_utils/bioconda_utils-requirements.txt | 2 -- bioconda_utils/build.py | 2 +- bioconda_utils/docker_utils.py | 4 ++-- bioconda_utils/involucro | 1 - bioconda_utils/pkg_test.py | 2 -- bioconda_utils/recipe.py | 3 --- bioconda_utils/utils.py | 3 --- test/test_pkg_test.py | 1 - 9 files changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/GithubActionTests.yml b/.github/workflows/GithubActionTests.yml index bb319d1a28..3968c79180 100644 --- a/.github/workflows/GithubActionTests.yml +++ b/.github/workflows/GithubActionTests.yml @@ -29,7 +29,7 @@ jobs: wget https://raw.githubusercontent.com/bioconda/bioconda-common/master/{common,install-and-set-up-conda,configure-conda}.sh bash install-and-set-up-conda.sh eval "$(conda shell.bash hook)" - mamba create -n bioconda -y --file test-requirements.txt --file bioconda_utils/bioconda_utils-requirements.txt + conda create -n bioconda -y --file test-requirements.txt --file bioconda_utils/bioconda_utils-requirements.txt conda activate bioconda python setup.py install @@ -66,7 +66,7 @@ jobs: wget https://raw.githubusercontent.com/bioconda/bioconda-common/master/{common,install-and-set-up-conda,configure-conda}.sh bash install-and-set-up-conda.sh eval "$(conda shell.bash hook)" - mamba create -n bioconda -y --file test-requirements.txt --file bioconda_utils/bioconda_utils-requirements.txt + conda create -n bioconda -y --file test-requirements.txt --file bioconda_utils/bioconda_utils-requirements.txt conda activate bioconda python setup.py install @@ -94,7 +94,7 @@ jobs: wget https://raw.githubusercontent.com/bioconda/bioconda-common/master/{common,install-and-set-up-conda,configure-conda}.sh bash install-and-set-up-conda.sh eval "$(conda shell.bash hook)" - mamba create -n bioconda -y --file test-requirements.txt --file bioconda_utils/bioconda_utils-requirements.txt + conda create -n bioconda -y --file test-requirements.txt --file bioconda_utils/bioconda_utils-requirements.txt conda activate bioconda python setup.py install diff --git a/bioconda_utils/bioconda_utils-requirements.txt b/bioconda_utils/bioconda_utils-requirements.txt index 4ef7fd0c37..81fa0cfc10 100644 --- a/bioconda_utils/bioconda_utils-requirements.txt +++ b/bioconda_utils/bioconda_utils-requirements.txt @@ -11,8 +11,6 @@ conda=24.3.* conda-libmamba-solver=24.1.* conda-build=24.3.* conda-index=0.4.* -mamba=1.5.* -boa=0.17.* argh=0.31.* # CLI colorlog=6.* # Logging diff --git a/bioconda_utils/build.py b/bioconda_utils/build.py index 37b50a0caa..197b045ec1 100644 --- a/bioconda_utils/build.py +++ b/bioconda_utils/build.py @@ -149,7 +149,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 diff --git a/bioconda_utils/docker_utils.py b/bioconda_utils/docker_utils.py index 52aae0879e..2a66f0ebdb 100644 --- a/bioconda_utils/docker_utils.py +++ b/bioconda_utils/docker_utils.py @@ -105,12 +105,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]} diff --git a/bioconda_utils/involucro b/bioconda_utils/involucro index 52284315cb..09504822d3 100755 --- a/bioconda_utils/involucro +++ b/bioconda_utils/involucro @@ -2,5 +2,4 @@ exec involucro \ -set POSTINSTALL='create-env --conda=: /usr/local' \ - -set PREINSTALL='conda() { mamba "${@}" ; }' \ "${@}" diff --git a/bioconda_utils/pkg_test.py b/bioconda_utils/pkg_test.py index 3520ebf8f1..c85628c26a 100644 --- a/bioconda_utils/pkg_test.py +++ b/bioconda_utils/pkg_test.py @@ -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') diff --git a/bioconda_utils/recipe.py b/bioconda_utils/recipe.py index fbfebdac0a..ef3dbddfed 100644 --- a/bioconda_utils/recipe.py +++ b/bioconda_utils/recipe.py @@ -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 @@ -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): diff --git a/bioconda_utils/utils.py b/bioconda_utils/utils.py index c591034d38..4a8bf67891 100644 --- a/bioconda_utils/utils.py +++ b/bioconda_utils/utils.py @@ -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 @@ -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 diff --git a/test/test_pkg_test.py b/test/test_pkg_test.py index 271c3e304f..459d1aba97 100644 --- a/test/test_pkg_test.py +++ b/test/test_pkg_test.py @@ -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