Skip to content

Commit

Permalink
Added flag for conda clean
Browse files Browse the repository at this point in the history
  • Loading branch information
spietras committed Jan 11, 2021
1 parent f670332 commit a317ae3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions env.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def _conda_create_impl(rctx):
conda_label = Label("@{}//:{}/condabin/conda{}".format(rctx.attr.conda_repo, rctx.attr.conda_dir, CONDA_EXT_MAP[get_os(rctx)]))
executable = str(rctx.path(conda_label))
env_name = rctx.name
_clean(rctx, executable)
_create_environment(rctx, executable, env_name)
_clean(rctx, executable)
if rctx.attr.clean:
_clean(rctx, executable)
_create_env_build_file(rctx, env_name)


Expand All @@ -89,6 +89,10 @@ conda_create_rule = repository_rule(
"timeout": attr.int(
default = EXECUTE_TIMEOUT,
doc = "Timeout in seconds for each execute action"
),
"clean": attr.bool(
default = True,
doc = "False if conda cache should not be cleaned"
)
}
)

0 comments on commit a317ae3

Please sign in to comment.