anaconda / anaconda-project

Tool for encapsulating, running, and reproducing data science projects
https://anaconda-project.readthedocs.io/en/latest/
Other
216 stars 88 forks source link

[ENH] Escaping to shell for commands inside `anaconda-project.yml` #366

Open mattkram opened 2 years ago

mattkram commented 2 years ago

Background

anaconda-project can potentially serve as a replacement for simple Makefiles. However, make allows for arbitrary shell commands to be embedded within Makefile, which is often used for extracting information such as git tag and branch information.

Example

image := some-image-name
git_hash ?= $(shell git log -1 --pretty=format:%h)

.PHONY: build
build:
    docker build -f Dockerfile  -t $(image):$(git_hash)

Suggestion

Develop some mechanism to embed similar shell commands within anaconda-project.yml, similar to the following:

commands:
  build:
    unix: docker build -f Dockerfile -t $(image):$(shell git log -1 --pretty=format:%h

Potentially, instead of directly embedding within the commands section , this functionality could be moved into the variables section as a new variable type.