check_build_help

Build tool usage

These checks catch errors relating to the use of - {{compiler('xx')}} and setuptools.

Classes

compilers_must_be_in_build(_linter)

The recipe requests a compiler in a section other than build

cython_must_be_in_host(_linter)

Cython should be in the host section

cython_needs_compiler(_linter)

Cython generates C code, which will need to be compiled

setup_py_install_args(_linter)

The recipe uses setuptools without required arguments

should_use_compilers(_linter)

The recipe requires a compiler directly

uses_setuptools(_linter)

The recipe uses setuptools in run depends

Documentation

class bioconda_utils.lint.check_build_help.should_use_compilers(_linter)[source]

The recipe requires a compiler directly

Since version 3, conda-build uses a special syntax to require compilers for a given language matching the architecture for which a package is being build. Please use:

requirements:
   build:
     - {{ compiler('language') }}

Where language is one of c, cxx, fortran, go or cgo. You can specify multiple compilers if needed.

There is no need to add libgfortran, libgcc, or toolchain to the dependencies as this will be handled by conda-build itself.

check_deps(deps)[source]

Execute check on recipe dependencies

Example format for deps:

{
  'setuptools': ['requirements/run',
                 'outputs/0/requirements/run/1'],
  'compiler_cxx': ['requirements/build/0']
}

You can use the values in the list directly as section parameter to self.message().

Parameters:

deps – Dictionary mapping requirements occurring in the recipe to their locations within the recipe.

messages: List[LintMessage]

Messages collected running tests

recipe: _recipe.Recipe

Recipe currently being checked

try_fix: bool

Whether we are supposed to fix

class bioconda_utils.lint.check_build_help.compilers_must_be_in_build(_linter)[source]

The recipe requests a compiler in a section other than build

Please move the {{ compiler('language') }} line into the requirements: build: section.

check_deps(deps)[source]

Execute check on recipe dependencies

Example format for deps:

{
  'setuptools': ['requirements/run',
                 'outputs/0/requirements/run/1'],
  'compiler_cxx': ['requirements/build/0']
}

You can use the values in the list directly as section parameter to self.message().

Parameters:

deps – Dictionary mapping requirements occurring in the recipe to their locations within the recipe.

messages: List[LintMessage]

Messages collected running tests

recipe: _recipe.Recipe

Recipe currently being checked

try_fix: bool

Whether we are supposed to fix

class bioconda_utils.lint.check_build_help.uses_setuptools(_linter)[source]

The recipe uses setuptools in run depends

Most Python packages only need setuptools during installation. Check if the package really needs setuptools (e.g. because it uses pkg_resources or setuptools console scripts).

severity: Severity = 10

Severity of this check. Only ERROR causes a lint failure.

check_recipe(recipe)[source]

Execute check on recipe

Override this method in subclasses, using self.message() to issue LintMessage as failures are encountered.

Parameters:

recipe – The recipe under test.

messages: List[LintMessage]

Messages collected running tests

recipe: _recipe.Recipe

Recipe currently being checked

try_fix: bool

Whether we are supposed to fix

class bioconda_utils.lint.check_build_help.setup_py_install_args(_linter)[source]

The recipe uses setuptools without required arguments

Please use:

$PYTHON setup.py install --single-version-externally-managed --record=record.txt

The parameters are required to avoid setuptools trying (and failing) to install certifi when a package this recipe requires defines entrypoints in its setup.py.

check_deps(deps)[source]

Execute check on recipe dependencies

Example format for deps:

{
  'setuptools': ['requirements/run',
                 'outputs/0/requirements/run/1'],
  'compiler_cxx': ['requirements/build/0']
}

You can use the values in the list directly as section parameter to self.message().

Parameters:

deps – Dictionary mapping requirements occurring in the recipe to their locations within the recipe.

messages: List[LintMessage]

Messages collected running tests

recipe: _recipe.Recipe

Recipe currently being checked

try_fix: bool

Whether we are supposed to fix

class bioconda_utils.lint.check_build_help.cython_must_be_in_host(_linter)[source]

Cython should be in the host section

Move cython to host:

requirements:
  host:
    - cython
check_deps(deps)[source]

Execute check on recipe dependencies

Example format for deps:

{
  'setuptools': ['requirements/run',
                 'outputs/0/requirements/run/1'],
  'compiler_cxx': ['requirements/build/0']
}

You can use the values in the list directly as section parameter to self.message().

Parameters:

deps – Dictionary mapping requirements occurring in the recipe to their locations within the recipe.

messages: List[LintMessage]

Messages collected running tests

recipe: _recipe.Recipe

Recipe currently being checked

try_fix: bool

Whether we are supposed to fix

class bioconda_utils.lint.check_build_help.cython_needs_compiler(_linter)[source]

Cython generates C code, which will need to be compiled

Add the compiler to the recipe:

requirements:
  build:
    - {{ compiler('c') }}
severity: Severity = 20

Severity of this check. Only ERROR causes a lint failure.

check_deps(deps)[source]

Execute check on recipe dependencies

Example format for deps:

{
  'setuptools': ['requirements/run',
                 'outputs/0/requirements/run/1'],
  'compiler_cxx': ['requirements/build/0']
}

You can use the values in the list directly as section parameter to self.message().

Parameters:

deps – Dictionary mapping requirements occurring in the recipe to their locations within the recipe.

messages: List[LintMessage]

Messages collected running tests

recipe: _recipe.Recipe

Recipe currently being checked

try_fix: bool

Whether we are supposed to fix