Changes
- Added invoking
conda clean
before and after creating a new environment to fix version conflicts and decrease used space size
- Changed failure output formatting
WORKSPACE setup
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_conda",
sha256 = "17cd7377a8af8e726e188f99c4a0c2fa9e8e29eabe50b0d447a3533a56ca3a6f",
url = "https://github.com/spietras/rules_conda/releases/download/0.0.3/rules_conda-0.0.3.zip"
)
load("@rules_conda//:defs.bzl", "load_conda", "conda_create", "register_toolchain")
# download and install conda
load_conda(
version="4.8.4" # optional, defaults to 4.8.4
)
# create environment with python2
conda_create(
name = "py2_env",
environment = "@//third_party/conda:py2_environment.yml" # label pointing to environment.yml file
)
# create environment with python3
conda_create(
name = "py3_env",
environment = "@//third_party/conda:py3_environment.yml" # label pointing to environment.yml file
)
# register pythons from environment as toolchain
register_toolchain(
py2_env = "py2_env", # python2 is optional
py3_env = "py3_env"
)