Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to conda-build 3. #293

Merged
merged 127 commits into from
Jul 19, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
a6e402a
Pin to conda-build 3.
johanneskoester Apr 23, 2018
12f128e
Depend on latest conda-forge-pinning package.
johanneskoester Apr 23, 2018
66c1a4c
Try downgrading to last minor release of conda.
johanneskoester Apr 23, 2018
9d6636c
Try using conda 4.3.
johanneskoester Apr 23, 2018
6ee9510
Try 4.5.0
johanneskoester Apr 23, 2018
63f809f
Handle UnableToParse
johanneskoester Apr 23, 2018
3664db1
Remove galaxy-lib version restriction.
johanneskoester Apr 24, 2018
20d58eb
adapt to conda 4.5
johanneskoester Apr 24, 2018
14aafd2
use get_output_file_paths instead of get_output_file_path
johanneskoester Apr 24, 2018
76035ea
Merge branch 'cb3-migration' of github.com:bioconda/bioconda-utils in…
johanneskoester Apr 24, 2018
c847294
Merge branch 'master' into cb3-migration
johanneskoester Apr 24, 2018
f6b5669
Add lint for deprecated numpy spec.
johanneskoester Apr 24, 2018
0d7d1cc
Document new lint.
johanneskoester Apr 24, 2018
55e1e14
register lint.
johanneskoester Apr 24, 2018
82abcf7
fix tests
johanneskoester Apr 24, 2018
3384875
fix lint
johanneskoester Apr 24, 2018
38aaf26
adapt test cases and remove obsolete ones.
johanneskoester Apr 24, 2018
07eb371
Remove env_matrix.
johanneskoester Apr 25, 2018
de2e4a2
fix typo
johanneskoester Apr 25, 2018
6014495
fixes and further cleanup
johanneskoester Apr 25, 2018
9a4a3d9
fixes
johanneskoester Apr 25, 2018
312f982
Fixes.
johanneskoester Apr 25, 2018
06fa571
fix typo
johanneskoester Apr 26, 2018
742e61d
fixes
johanneskoester Apr 26, 2018
2aaf71e
fixes
johanneskoester Apr 26, 2018
d888281
fixes.
johanneskoester Apr 26, 2018
7d97668
fix DAG
johanneskoester Apr 26, 2018
be141e0
Linting now uses fully rendered recipes, and checks all combinations …
johanneskoester Apr 26, 2018
660dc84
fix conda execution in docker
johanneskoester Apr 26, 2018
b3e2eda
fix argument
johanneskoester Apr 26, 2018
7934506
fixes.
johanneskoester Apr 26, 2018
a2aa8e1
Adapt numpy x.x lint to new multi-metadata strategy.
johanneskoester Apr 30, 2018
26132ed
properly render metadata when finding built package paths.
johanneskoester Apr 30, 2018
7aa4a7c
fixes.
johanneskoester Apr 30, 2018
69b0123
fixes
johanneskoester Apr 30, 2018
2102ad0
fix test for rendering sandboxing
daler May 1, 2018
ff204fe
disable skip-existing
daler May 1, 2018
3e1533a
Use same build args for the copying as for building.
johanneskoester May 2, 2018
3cd0ff6
add test for conda-forge pinning
daler May 4, 2018
c6ed119
add ability to have separate bioconda pins
daler May 5, 2018
31bd484
pep8
daler May 5, 2018
8139e77
add some more docs on testing
daler May 5, 2018
788f6d5
add bioconda conda_build_config.yaml
daler May 5, 2018
cfa4060
add first metadata fix
daler May 5, 2018
04543f3
update tests for load_first_metadata
daler May 5, 2018
526e48d
first pass of cb3 migration docs
daler May 5, 2018
ed371bd
port bioconductor_skeleton to use cb3 compilers; improve detection
daler May 5, 2018
9473f74
update bioconductor_skeleton test
daler May 5, 2018
02e89ae
more cb3 docs
daler May 5, 2018
3f57264
add anaconda to channels
daler May 5, 2018
4494c42
add anaconda channel to circleci setup
daler May 5, 2018
2b97c0b
short-circuit filtering if skipped
daler May 5, 2018
0969bce
fix text to only check names
daler May 5, 2018
a3441ea
add test for when CI=true
daler May 5, 2018
a704232
add extra checks that built pkgs exist
daler May 6, 2018
2da3a20
add test for cb3 outputs
daler May 6, 2018
08562bf
clean up cb3 output test; typos
daler May 6, 2018
9a3a9d8
utils.Progress: remove unnecessary sleep
mbargull May 6, 2018
6a86254
pkg_test: use --involucro-path to prevent download in galaxy-lib
mbargull May 6, 2018
71f52fa
remove anaconda channel
daler May 7, 2018
7999eec
simplify htslib in test
daler May 7, 2018
71b6b0c
add compiler test
daler May 7, 2018
ce67dff
fix htslib max pin
daler May 7, 2018
d6ea7a1
update docs to reflect run_exports
daler May 7, 2018
b2c82d9
Merge branch 'master' into cb3-migration
daler May 7, 2018
d374363
Update cb3.rst
kyleabeauchamp May 8, 2018
232e160
Merge pull request #297 from kyleabeauchamp/patch-1
daler May 9, 2018
ea608fb
Merge branch 'master' into cb3-migration
johanneskoester May 13, 2018
c9ec48b
update docs
daler May 13, 2018
fd7bfee
add lint functions for compilers and fn
daler May 13, 2018
3ec7681
add linting docs
daler May 13, 2018
80d25c7
bring back the noarch lint docs
daler May 13, 2018
7079bb3
render with finalize=False where possible
mbargull May 16, 2018
0ae67ab
rename load_conda_config to load_conda_build_config
mbargull May 16, 2018
884e757
use conda.exports (public API)
mbargull May 16, 2018
91639b8
pin conda-forge-pinning, update conda/conda-build pins
mbargull May 16, 2018
77b4f84
lint: handle if source is a list
mbargull May 16, 2018
7002683
adjust tests
mbargull May 16, 2018
a089bd0
show test durations
mbargull May 16, 2018
b6121dc
lint: use decorator instead explicit loops
mbargull May 16, 2018
8f026ad
lint: fix decorator, pass through __name__ for registry
mbargull May 16, 2018
933a954
lint: fix decorator, pass through __name__ for registry (2)
mbargull May 16, 2018
03960fe
run long-running tests separately
mbargull May 16, 2018
4686605
Merge branch 'master' into cb3-migration
johanneskoester May 22, 2018
b122120
docker_utils: use base image acc. to BIOCONDA_UTILS_TAG
mbargull May 25, 2018
b738ca5
Remove a priori filtering. Instead filter when each recipe is conside…
johanneskoester May 25, 2018
5ea1d5e
Naming.
johanneskoester May 25, 2018
325f0f2
Skip filter tests for now.
johanneskoester May 25, 2018
d3530ad
Disable DAG generation.
johanneskoester May 25, 2018
26ec23c
Activate DAG calculation again (we cannot avoid it because we need th…
johanneskoester May 25, 2018
668ec38
Fast loading of metadata for DAG.
johanneskoester May 25, 2018
a6dabe3
Only use host dependencies when building DAG.
johanneskoester May 26, 2018
2fb47ea
get_package_paths returns tuple
daler May 26, 2018
6072d39
utils.get_package_paths: only return paths
mbargull May 26, 2018
62f1d52
requirements: update conda, conda-build, conda-forge-pinning
mbargull May 26, 2018
9821159
use bypass_env_check=True when we use non-finalized renderings
mbargull May 26, 2018
62efbd5
requirements: use conda-build=3.10.3 for now
mbargull May 26, 2018
66497f2
test_utils: disable the remaining filter_recipes test
mbargull May 26, 2018
c074b13
Abort building if build strings in repo are divergent
mbargull May 29, 2018
4085e6a
fix previous commit: add Python's redundant colon
mbargull May 29, 2018
b002ec0
fix generate_docs.py
mbargull May 29, 2018
b4917aa
fix another typo
mbargull May 29, 2018
69a1f35
support linting just before building
daler Jun 2, 2018
ec47a17
sort recipes for linting
daler Jun 2, 2018
77d673b
better noarch detection
daler Jun 2, 2018
7a0c70b
Merge branch 'cb3-migration' of github.com:bioconda/bioconda-utils in…
daler Jun 2, 2018
0302291
default df
daler Jun 2, 2018
7d35d0b
be clear which recipe the problem is on
daler Jun 2, 2018
b2fb765
add back in debug info on linting
daler Jun 2, 2018
b6763c5
more generic check for compilers
daler Jun 2, 2018
41f39c0
add conda_build_config files consistently
mbargull Jun 3, 2018
e0603ec
fix previous commit
mbargull Jun 3, 2018
190ff4f
fix previous commit again
mbargull Jun 3, 2018
9fdbc8f
fix mulled upload: iterate over all generated images.
johanneskoester Jun 14, 2018
6c45c87
build: fix collecting mulled_images
mbargull Jun 19, 2018
3ab8023
requirements: require python >=3.6
mbargull Jun 21, 2018
d4701c6
build: skip builds early based on num of existing builds in channel
mbargull Jun 23, 2018
99782c2
build: topo-sort connected components before merging
mbargull Jun 24, 2018
e033e47
docs: handle extra.notes being a list
mbargull Jun 24, 2018
44565d0
build: handle UnsatisfiableError
mbargull Jun 24, 2018
86fc487
fix import
mbargull Jun 24, 2018
4f6b405
[WIP] update to conda-build 3.10.9 (#312)
mbargull Jun 26, 2018
4e35af8
Add paper to the homepage.
johanneskoester Jul 2, 2018
b0df159
Handle dependency cycles (#313)
mbargull Jul 4, 2018
5800ebe
requirements: update to conda-forge-pinning 2018.07.18
mbargull Jul 18, 2018
9349490
Merge pull request #315 from bioconda/cf-pinning-2018-07-18
bgruening Jul 18, 2018
9e40c85
Merge branch 'master' into cb3-migration
johanneskoester Jul 19, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .circleci/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ rm -r *

# build docs and copy over to tmpdir
cd ${DOCSOURCE}
make clean html SPHINXOPTS="-j2" 2>&1 | grep -v "WARNING: nonlocal image URL found:"
# TODO: reenable "-j2" when docs build fine
Copy link
Member

@mbargull mbargull Jul 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the build times, it doesn't make much sense to use multiple jobs here. It's less than a minute faster with -j2 but also "obfuscates" the progress/error output...

make clean html 2>&1 | grep -v "WARNING: nonlocal image URL found:"
# make clean html SPHINXOPTS="-j2" 2>&1 | grep -v "WARNING: nonlocal image URL found:"
cp -r ${DOCHTML}/* $STAGING

# commit and push
Expand Down
2 changes: 1 addition & 1 deletion bioconda_utils/bioconda_utils-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ anaconda-client=1.6.*
argh=0.26.*
beautifulsoup4=4.6.*
conda=4.5.4
conda-build=3.10.3
conda-build=3.10.9
galaxy-lib>=18.5.5
jinja2=2.10.*
jsonschema=2.6.*
Expand Down
57 changes: 34 additions & 23 deletions bioconda_utils/bioconductor_skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
import configparser
from textwrap import dedent
import tarfile
import pyaml
import hashlib
import os
import re
import bs4
from collections import OrderedDict
import logging

import bs4
import pyaml
import requests
from colorlog import ColoredFormatter

from . import utils
from . import cran_skeleton

Expand Down Expand Up @@ -200,7 +201,10 @@ def find_best_bioc_version(package, version):
for bioc_version in bioconductor_versions():
for kind, func in zip(
('package', 'data'),
(bioconductor_tarball_url, bioconductor_annotation_data_url, bioconductor_experiment_data_url)
(
bioconductor_tarball_url, bioconductor_annotation_data_url,
bioconductor_experiment_data_url,
),
):
url = func(package, version, bioc_version)
if requests.head(url).status_code == 200:
Expand Down Expand Up @@ -261,8 +265,8 @@ def __init__(self, package, bioc_version=None, pkg_version=None):

htmls = {
'regular_package': os.path.join(
base_url, self.bioc_version, 'bioc', 'html', package
+ '.html'),
base_url, self.bioc_version, 'bioc', 'html',
package + '.html'),
'annotation_package': os.path.join(
base_url, self.bioc_version, 'data', 'annotation', 'html',
package + '.html'),
Expand Down Expand Up @@ -310,7 +314,6 @@ def __init__(self, package, bioc_version=None, pkg_version=None):

self.depends_on_gcc = False


@property
def bioarchive_url(self):
"""
Expand All @@ -337,7 +340,8 @@ def cargoport_url(self):
elif response.status_code == 200:
return url
else:
raise PageNotFoundError("Unexpected error: {0.status_code} ({0.reason})".format(response))
raise PageNotFoundError(
"Unexpected error: {0.status_code} ({0.reason})".format(response))

@property
def bioconductor_tarball_url(self):
Expand Down Expand Up @@ -396,7 +400,8 @@ def tarball_url(self):
find_best_bioc_version(self.package, self.version)

if self._tarball_url is None:
raise ValueError("No working URLs found for this version in any bioconductor version")
raise ValueError(
"No working URLs found for this version in any bioconductor version")
return self._tarball_url

@property
Expand Down Expand Up @@ -428,7 +433,8 @@ def cached_tarball(self):
if response.status_code == 200:
fout.write(response.content)
else:
raise PageNotFoundError('Unexpected error {0.status_code} ({0.reason})'.format(response))
raise PageNotFoundError(
'Unexpected error {0.status_code} ({0.reason})'.format(response))
shutil.move(tmp, fn)
self._cached_tarball = fn
return fn
Expand Down Expand Up @@ -479,7 +485,6 @@ def depends(self):
except KeyError:
return []


@property
def linkingto(self):
"""
Expand All @@ -490,7 +495,6 @@ def linkingto(self):
except KeyError:
return []


def _parse_dependencies(self, items):
"""
The goal is to go from
Expand Down Expand Up @@ -595,15 +599,19 @@ def dependencies(self):
# Modified from conda_build.skeletons.cran
#
with tarfile.open(self.cached_tarball) as tf:
need_f = any([f.name.lower().endswith(('.f', '.f90', '.f77')) for f in tf])
need_c = True if need_f else \
any([f.name.lower().endswith('.c') for f in tf])
need_cxx = any([f.name.lower().endswith(('.cxx', '.cpp', '.cc', '.c++'))
for f in tf])
need_autotools = any([f.name.lower().endswith('/configure') for f in tf])
need_make = True if any((need_autotools, need_f, need_cxx, need_c)) else \
any([f.name.lower().endswith(('/makefile', '/makevars'))
for f in tf])
need_f = any(f.name.lower().endswith(('.f', '.f90', '.f77')) for f in tf)
if need_f:
need_c = True
else:
need_c = any(f.name.lower().endswith('.c') for f in tf)
need_cxx = any(
f.name.lower().endswith(('.cxx', '.cpp', '.cc', '.c++')) for f in tf)
need_autotools = any(f.name.lower().endswith('/configure') for f in tf)
if any((need_autotools, need_f, need_cxx, need_c)):
need_make = True
else:
need_make = any(
f.name.lower().endswith(('/makefile', '/makevars')) for f in tf)
else:
need_c = need_cxx = need_f = need_autotools = need_make = False

Expand Down Expand Up @@ -818,7 +826,9 @@ def write_recipe_recursive(proj, seen_dependencies, recipe_dir, config, force,
continue

if conda_name_without_version in seen_dependencies:
logger.debug("{} already created or in existing channels, skipping".format(conda_name_without_version))
logger.debug(
"{} already created or in existing channels, skipping"
.format(conda_name_without_version))
continue

seen_dependencies.update([conda_name_without_version])
Expand Down Expand Up @@ -1018,7 +1028,8 @@ def write_recipe(package, recipe_dir, config, force=False, bioc_version=None,
# Install and clean up
R CMD INSTALL --library=$PREFIX/lib/R/library $TARBALL
rm $TARBALL
rmdir $STAGING""")
rmdir $STAGING
""") # noqa: E501: line too long
with open(os.path.join(recipe_dir, 'post-link.sh'), 'w') as fout:
fout.write(dedent(post_link_template))
pre_unlink_template = "R CMD REMOVE --library=$PREFIX/lib/R/library/ {0}\n".format(package)
Expand Down
51 changes: 26 additions & 25 deletions bioconda_utils/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ def build(
channels=None,
docker_builder=None,
_raise_error=False,
prelint=False,
df=None,
lint_args=None,
):
"""
Build a single recipe for a single env
Expand Down Expand Up @@ -81,17 +80,13 @@ def build(
Instead of returning a failed build result, raise the error instead.
Used for testing.

prelint : bool
If True, then apply linting just before building. `df` should probably
be provided as well.

df : pandas.DataFrame
Dataframe of channel info, likely from linting.channel_dataframe()
lint_args : linting.LintArgs | None
If not None, then apply linting just before building.
"""

if prelint:
if lint_args is not None:
logger.info('Linting recipe')
report = linting.lint([recipe], df)
report = linting.lint([recipe], lint_args)
if report is not None:
summarized = pandas.DataFrame(
dict(failed_tests=report.groupby('recipe')['check'].agg('unique')))
Expand All @@ -111,10 +106,11 @@ def build(

logger.info("BUILD START %s", recipe)

# --no-build-id is needed for some very long package names that triggers the 89 character limits
# this option can be removed as soon as all packages are rebuild with the 255 character limit
# Moreover, --no-build-id will block us from using parallel builds in conda-build 2.x
# build_args = ["--no-build-id"]
# --no-build-id is needed for some very long package names that triggers
# the 89 character limits this option can be removed as soon as all
# packages are rebuild with the 255 character limit
# Moreover, --no-build-id will block us from using parallel builds in
# conda-build 2.x build_args = ["--no-build-id"]

# use global variant config file (contains pinnings)
build_args = ["--skip-existing"]
Expand Down Expand Up @@ -186,14 +182,13 @@ def build(

logger.info('TEST START via mulled-build %s', recipe)

use_base_image = meta.get_section('extra').get('container', {})\
.get('extended-base')
use_base_image = meta.get_value('extra/container', {}).get('extended-base', False)
base_image = 'bioconda/extended-base-image' if use_base_image else None

mulled_images = []
for pkg_path in pkg_paths:
try:
res = pkg_test.test_package(pkg_path, base_image=base_image)
pkg_test.test_package(pkg_path, base_image=base_image)
except sp.CalledProcessError as e:
logger.error('TEST FAILED: %s', recipe)
return BuildResult(False, None)
Expand All @@ -215,7 +210,7 @@ def build_recipes(
anaconda_upload=False,
mulled_upload_target=None,
check_channels=None,
prelint=False,
lint_args=None,
):
"""
Build one or many bioconda packages.
Expand Down Expand Up @@ -264,6 +259,8 @@ def build_recipes(
`config['channels'][0]`). If this list is empty, then do not check any
channels.

lint_args : linting.LintArgs | None
If not None, then apply linting just before building.
"""
orig_config = config
config = utils.load_config(config)
Expand Down Expand Up @@ -293,11 +290,16 @@ def build_recipes(

logger.debug('recipes: %s', recipes)

if prelint:
logger.info("Downloading channel information to use for linting")
df = linting.channel_dataframe(channels=['conda-forge', 'defaults'])
else:
df = None
if lint_args is not None:
df = lint_args.df
if df is None:
logger.info("Downloading channel information to use for linting")
df = linting.channel_dataframe(channels=['conda-forge', 'defaults'])
lint_exclude = (lint_args.exclude or ())
if 'already_in_bioconda' not in lint_exclude:
lint_exclude = tuple(lint_exclude) + ('already_in_bioconda',)
lint_args = linting.LintArgs(lint_args.df, lint_exclude, lint_args.registry)
lint_args = linting.LintArgs(df, lint_exclude, lint_args.registry)

dag, name2recipes = utils.get_dag(recipes, config=orig_config, blacklist=blacklist)
recipe2name = {}
Expand Down Expand Up @@ -425,8 +427,7 @@ def build_recipes(
force=force,
channels=config['channels'],
docker_builder=docker_builder,
df=df,
prelint=prelint,
lint_args=lint_args,
)

all_success &= res.success
Expand Down
Loading