@rules_conda//conda:extensions.bzl
Module extensions for loading Conda environments.
Module Extensions
condaCreate Conda environments
Tag Classes
environmentCreate a Conda environment
| Attribute | Type | Description |
|---|---|---|
*name | name | The name of the repository to create. |
*lockfile | label | The lockfile containing the environment. |
execute_link_scripts | boolean | Execute link scripts when installing the environment. Only applies to the host platform. Default: False |
platform | string | The platform to create an environment for. Defaults to the host platform. Default: "" |
environment | string | The environment to create. Defaults to Default: "" |
deduplicate_downloads | boolean | Allow this environment to participate in package download deduplication. For very large environments or an excessive number of environments, this option can increase the initialization time of this module extension. Default: True |
@rules_conda//conda/cc:import.bzl
Rules
import_libraryImports a library from an environment, as if by cc_import
| Attribute | Type | Description |
|---|---|---|
*name | name | A unique name for this target. |
*environment | label | |
deps | list of labels | The list of other libraries that the target depends on. Default: [] |
packages | list of strings | Packages containing libraries and headers to import Default: [] |
alwayslink | boolean | If true, link in all object files specified by the static library, even if no symbols are referenced. Default: False |
includes | list of strings | List of include dirs to be added to the compile line, relative to the conda environment include directory root. Default: [] |
interface_library | string | Default: "" |
pic_static_library | string | Default: "" |
shared_library | string | Default: "" |
static_library | string | Default: "" |
@rules_conda//conda/environment:defs.bzl
Functions & Macros
lock_environmentsLock Conda environments.
Creates two targets:
bazel run [name].updateto update the lockfilebazel test [name].testto ensure the lockfile is up-to-date
Parameters
name | The name of this rule Default: None |
environments | A list of environment files, in YAML format Default: [] |
lockfile | The lockfile to create Default: "conda.lock" |
cuda_version | The CUDA version to use to solve Default: None |
macos_version | The macOS version to use to solve Default: None |
glibc_version | The glibc version to use to solve Default: None |
visibility | passed to both .update and .test Default: ["//visibility:private"] |
tags | passed to both .update and .test Default: [] |
kwargs | additional arguments passed to .test |
Rules
environment_globGlobs files from an environment
| Attribute | Type | Description |
|---|---|---|
*name | name | A unique name for this target. |
*environment | label | |
allow_empty | boolean | If true, allows globs to not match anything. Default: False |
data | list of strings | A list of globs to files within the environment to put in the runfiles. For example, Default: [] |
exclude | list of strings | A list of globs to files within the environment to exclude from the files and runfiles. Default: [] |
include_package_dependencies | boolean | If true, includes dependencies of Default: True |
packages | list of strings | A list of packages globs are allowed to match. If empty, matches all packages. Default: [] |
srcs | list of strings | A list of globs to files within the environment to put in the files. For example, Default: [] |
run_binaryCreates a binary target from an executable in an environment
| Attribute | Type | Description |
|---|---|---|
*name | name | A unique name for this target. |
*environment | label | |
path | string | Explicit relative path of the binary within the environment. Set either this or Default: "" |
executable | string | Executable filename (no directories). Used together with Default: "" |
search_paths | list of strings | Directories to search for Default: [] |
@rules_conda//conda/environment:providers.bzl
Functions & Macros
dependent_packagesGet the dependent packages of a package
Parameters
*environment_info | (EnvironmentInfo) The environment to use |
*package | (string) The name of a package |
get_files_provided_byGet all files provided by a package.
Parameters
*environment_info | (EnvironmentInfo) The environment to use |
*package_name | (string or List[string]) The name of the package or packages |
include_dependencies | (bool) Whether or not to include files from dependencies as well Default: True |
file_relative_pathGet the relative path of a file to the environment
Parameters
*environment_info | (EnvironmentInfo) The environment to use |
*file | (File) The file |
what_providesFind the package that provided a file
Parameters
*environment_info | (EnvironmentInfo) The environment to use |
*path | (string) The file path |
Providers
EnvironmentInfoInformation about a Conda environment
Fields
metadata | (Dict[string, Dict]) Conda metadata for each package |
files | (DirectoryInfo) The files contained in this environment |
@rules_conda//conda/python:toolchain.bzl
Functions & Macros
conda_python_toolchainParameters
*name | |
*environment |