Skip to content

Commit

Permalink
Use conda/conda-build not 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 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 Mar 27, 2024
1 parent 43d0b4c commit e5e8169
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/GithubActionTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions bioconda_utils/bioconda_utils-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bioconda_utils/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 @@ -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]}
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 e5e8169

Please sign in to comment.