Skip to content

0.0.5

Compare
Choose a tag to compare
@spietras spietras released this 11 Jan 21:11

Changes

  • Added flag for conda cache clean after an environment creation

WORKSPACE setup

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "rules_conda",
    sha256 = "8298379474beb05f815afc33a42eb1732f8ebdab3aa639569473eae75e6e072b",
    url = "https://github.com/spietras/rules_conda/releases/download/0.0.5/rules_conda-0.0.5.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
    quiet = False  # print output
)

# create environment with python2
conda_create(
    name = "py2_env",
    environment = "@//third_party/conda:py2_environment.yml",  # label pointing to environment.yml file
    quiet = False,
    clean = True,
    timeout = 600  # each execute action can take up to 600 seconds
)

# create environment with python3
conda_create(
    name = "py3_env",
    environment = "@//third_party/conda:py3_environment.yml",  # label pointing to environment.yml file
    quiet = False,
    clean = True,
    timeout = 600
)

# register pythons from environment as toolchain
register_toolchain(
    py2_env = "py2_env", # python2 is optional
    py3_env = "py3_env"
)