Skip to content

Commit a9cdf67

Browse files
authored
Merge pull request #334 from bioconda/cf-prio
Use conda-forge with a higher priority than bioconda.
2 parents 1b4ffd4 + 7c3d30c commit a9cdf67

File tree

9 files changed

+30
-28
lines changed

9 files changed

+30
-28
lines changed

.circleci/setup.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ if [[ ! -d $WORKSPACE/miniconda ]]; then
3030
# step 2: setup channels
3131

3232
conda config --system --add channels defaults
33-
conda config --system --add channels conda-forge
3433
conda config --system --add channels bioconda
34+
conda config --system --add channels conda-forge
3535

3636
# step 3: install bioconda-utils and test requirements
3737
conda install -y --file bioconda_utils/bioconda_utils-requirements.txt --file test-requirements.txt
@@ -40,7 +40,8 @@ if [[ ! -d $WORKSPACE/miniconda ]]; then
4040
conda clean -y --all
4141

4242
# Add local channel as highest priority
43-
conda index $WORKSPACE/miniconda/conda-bld/linux-64 $WORKSPACE/miniconda/conda-bld/osx-64 $WORKSPACE/miniconda/conda-bld/noarch
43+
mkdir -p $WORKSPACE/miniconda/conda-bld/{noarch,linux-64,osx-64}
44+
conda index $WORKSPACE/miniconda/conda-bld
4445
conda config --system --add channels file://$WORKSPACE/miniconda/conda-bld
4546
fi
4647

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ RUN mkdir -p /tmp/repo/bioconda_utils/
44
COPY ./bioconda_utils/bioconda_utils-requirements.txt /tmp/repo/bioconda_utils/
55
RUN export PATH="/opt/conda/bin:${PATH}" && \
66
conda config --add channels defaults && \
7-
conda config --add channels conda-forge && \
8-
conda config --add channels bioconda
7+
conda config --add channels bioconda && \
8+
conda config --add channels conda-forge
99
RUN export PATH="/opt/conda/bin:${PATH}" && \
1010
conda install --file /tmp/repo/bioconda_utils/bioconda_utils-requirements.txt && \
1111
conda clean -y --all

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ bioconda-utils, you can install requirements via conda into your root conda
1818
environment and then install the package:
1919

2020
```bash
21-
conda install --file bioconda_utils/bioconda_utils-requirements.txt -c bioconda -c conda-forge
21+
conda install --file bioconda_utils/bioconda_utils-requirements.txt -c conda-forge -c bioconda
2222
python setup.py install
2323
```
2424

bioconda_utils/pkg_test.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def get_image_name(path):
8383
def test_package(
8484
path,
8585
name_override=None,
86-
channels=["conda-forge", "defaults"],
86+
channels=("conda-forge", "local", "bioconda", "defaults"),
8787
mulled_args="",
8888
base_image=None,
8989
conda_image=MULLED_CONDA_IMAGE,
@@ -99,9 +99,9 @@ def test_package(
9999
name_override : str
100100
Passed as the --name-override argument to mulled-build
101101
102-
channels : None | str | list
103-
The local channel of the provided package will be added automatically;
104-
`channels` are channels to use in addition to the local channel.
102+
channels : list
103+
List of Conda channels to use. Must include an entry "local" for the
104+
local build channel.
105105
106106
mulled_args : str
107107
Mechanism for passing arguments to the mulled-build command. They will
@@ -127,13 +127,17 @@ def test_package(
127127

128128
spec = get_image_name(path)
129129

130-
extra_channels = ['file://{0}'.format(conda_bld_dir)]
131-
if channels is None:
132-
channels = []
133-
if isinstance(channels, str):
134-
channels = [channels]
135-
extra_channels.extend(channels)
136-
channel_args = ['--extra-channels', ','.join(extra_channels)]
130+
if "local" not in channels:
131+
raise ValueError('"local" must be in channel list')
132+
133+
channel, *extra_channels = [
134+
'file://{0}'.format(conda_bld_dir) if channel == 'local' else 'channel'
135+
for channel in channels
136+
]
137+
# '--channel' currently defaults to 'bioconda' in mulled-build and is
138+
# prepended to all remaining channels. To prevent this, i.e., to give
139+
# 'conda-forge' a higher priority, we use '--channel' explicitly here.
140+
channel_args = ['--channel', channel, '--extra-channels', ','.join(extra_channels)]
137141

138142
tests = get_tests(path)
139143
logger.debug('Tests to run: %s', tests)

docs/source/cb3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ After:
156156

157157
.. warning::
158158

159-
These compilers are only available in the ``anaconda`` channel. Until now
159+
These compilers are only available in the ``defaults`` channel. Until now
160160
we have not had this channel as a dependency, so be sure to add the channel
161161
when setting up bioconda (see :ref:`set-up-channels`).
162162

docs/source/faqs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ the `broken` label, i.e.,
108108

109109
.. code-block:: bash
110110
111-
conda install -c bioconda -c conda-forge -c defaults -c bioconda/label/broken my-package=<broken-version>
111+
conda install -c conda-forge -c bioconda -c defaults -c bioconda/label/broken my-package=<broken-version>
112112
113113
114114
.. _circlecimacos:

docs/source/guidelines.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ bioconda recipe checklist
1313
- Adequate tests included (:ref:`details <tests>`)
1414
- Files created by the recipe follow the FSH (:ref:`details <fsh-section>`)
1515
- License allows redistribution and license is indicated in ``meta.yaml``
16-
- Package does not already exist in the `defaults`, `r`, or `conda-forge`
16+
- Package does not already exist in the `defaults` or `conda-forge`
1717
channels with some exceptions (:ref:`details <channel-exceptions>`)
1818
- Package is appropriate for bioconda (:ref:`details <appropriate-for-bioconda>`)
1919
- If the recipe installs custom wrapper scripts, usage notes should be added to
@@ -112,7 +112,7 @@ consider opening a pull request with `conda-forge
112112
<https://conda-forge.github.io/#add_recipe>`_ which hosts general packages.
113113

114114
The exception to this is with R packages. We are still coordinating with
115-
anaconda and conda-forge about the best place to keep general R packages. In
115+
Anaconda and conda-forge about the best place to keep general R packages. In
116116
the meantime, R packages that are not specific to bioinformatics and that
117117
aren't already in the `conda-forge` channel can be added to bioconda.
118118

docs/source/index.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,18 @@ package. The Python 3 version is recommended.
8080

8181
After installing conda you will need to add the bioconda channel as well as the
8282
other channels bioconda depends on. **It is important to add them in this
83-
order** so that the priority is set correctly (that is, bioconda is highest
83+
order** so that the priority is set correctly (that is, conda-forge is highest
8484
priority).
8585

8686
The `conda-forge` channel contains many general-purpose packages not already
87-
found in the `defaults` channel. The `r` channel is only included due to
88-
backward compatibility. It is not mandatory, but without the `r` channel
89-
packages compiled against R 3.3.1 might not work.
87+
found in the `defaults` channel.
9088

9189

9290
::
9391

9492
conda config --add channels defaults
95-
conda config --add channels conda-forge
9693
conda config --add channels bioconda
97-
94+
conda config --add channels conda-forge
9895

9996
3. Install packages
10097
-------------------

test/test_bioconductor_skeleton.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
config = {
9-
'channels': ['bioconda', 'conda-forge', 'defaults']
9+
'channels': ['conda-forge', 'bioconda', 'defaults']
1010
}
1111

1212

@@ -58,7 +58,7 @@ def test_bioc_write_recipe_no_skipping(tmpdir):
5858

5959
def test_meta_contents(tmpdir):
6060
config = {
61-
'channels': ['bioconda', 'conda-forge', 'defaults']
61+
'channels': ['conda-forge', 'bioconda', 'defaults']
6262
}
6363
bioconductor_skeleton.write_recipe(
6464
'edgeR', recipe_dir=str(tmpdir), config=config, recursive=False)

0 commit comments

Comments
 (0)