Skip to content

0.0.4

Compare
Choose a tag to compare
@spietras spietras released this 27 Nov 22:15

Changes

  • Added adjustable timeout option to load_conda and conda_create
  • Increased default timeout from 1800 seconds to 3600 seconds

WORKSPACE setup

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

http_archive(
    name = "rules_conda",
    sha256 = "6c05d098ea82c172cd83d99c5fc892a488ffbf5f64ab3b2a32ab642c2a264e31",
    url = "https://github.com/spietras/rules_conda/releases/download/0.0.4/rules_conda-0.0.4.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,
    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,
    timeout = 600
)

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