Skip to content

Commit 6240d31

Browse files
jpfeufferdalerjohanneskoesterbgruening
authored
fix: success check does not consider pkg_dir #836 (#838)
completely untested but it is an obvious bug. If you want to change the package dirs earlier in the code somewhere, please suggest changes --------- Co-authored-by: Ryan Dale <ryan.dale@nih.gov> Co-authored-by: Johannes Köster <johannes.koester@uni-due.de> Co-authored-by: Johannes Köster <johannes.koester@tu-dortmund.de> Co-authored-by: Björn Grüning <bjoern@gruenings.eu>
1 parent ce37553 commit 6240d31

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

bioconda_utils/build.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
import subprocess as sp
66
from collections import defaultdict, namedtuple
7-
import os
8-
import logging
97
import itertools
8+
import logging
9+
import os
10+
import sys
11+
import time
1012

1113
from typing import List, Optional
1214
from bioconda_utils.skiplist import Skiplist
@@ -140,6 +142,12 @@ def build(recipe: str, pkg_paths: List[str] = None,
140142
noarch=is_noarch,
141143
live_logs=live_logs)
142144
# Use presence of expected packages to check for success
145+
if docker_builder.pkg_dir is not None:
146+
platform = utils.RepoData.native_platform()
147+
subfolder = utils.RepoData.platform2subdir(platform)
148+
conda_build_config = utils.load_conda_build_config(platform=subfolder)
149+
pkg_paths = [p.replace(conda_build_config.output_folder, docker_builder.pkg_dir) for p in pkg_paths]
150+
143151
for pkg_path in pkg_paths:
144152
if not os.path.exists(pkg_path):
145153
logger.error(

test/test_utils.py

+24
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,30 @@ def test_single_build_only(single_build):
252252
ensure_missing(pkg)
253253

254254

255+
@pytest.mark.skipif(SKIP_DOCKER_TESTS, reason='skipping on osx')
256+
@pytest.mark.long_running_2
257+
def test_single_build_pkg_dir(recipes_fixture):
258+
"""
259+
Builds the "one" recipe with pkg_dir.
260+
"""
261+
logger.error("Making recipe builder")
262+
docker_builder = docker_utils.RecipeBuilder(
263+
use_host_conda_bld=True,
264+
pkg_dir=os.getcwd() + "/output",
265+
docker_base_image=DOCKER_BASE_IMAGE)
266+
mulled_test = False
267+
logger.error("DONE")
268+
logger.error("Fixture: Building 'one' within docker with pkg_dir")
269+
res = build.build(
270+
recipe=recipes_fixture.recipe_dirs['one'],
271+
pkg_paths=recipes_fixture.pkgs['one'],
272+
docker_builder=docker_builder,
273+
mulled_test=mulled_test,
274+
)
275+
logger.error("Fixture: Building 'one' within docker and pkg_dir -- DONE")
276+
assert res.success
277+
278+
255279
@pytest.mark.skipif(SKIP_DOCKER_TESTS, reason='skipping on osx')
256280
def test_single_build_with_post_test(single_build):
257281
for pkg in single_build:

0 commit comments

Comments
 (0)