anaconda / anaconda-project

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

'default' is an alias for the actual default command #264

Closed AlbertDeFusco closed 4 years ago

AlbertDeFusco commented 4 years ago

@bkreider

This allows us to run a default command (name unkonwn at runtime) and pass arguments

anaconda-project run default --anaconda-project-port 8086

The anaconda-project.yml file might look like

commands:
  dashboard:
    unix: panel serve main.py
    supports_http_options: true
  api:
    unix: tranquilizer api.py
    supports_http_options: true
anaconda-project run default # runs panel
anaconda-project run         # runs panel

Even though there is not a command called "default" using the command name default will run the first command, dashboard.

If instead a command is called "default" that will always be as the default whether the name is included or not (this is the original behavior and is unchanged)

commands:
  dashboard:
    unix: panel serve main.py
    supports_http_options: true
  default:
    unix: tranquilizer api.py
    supports_http_options: true
anaconda-project run default # runs tranquilizer
anaconda-project run         # runs tranquilizer
bkreider commented 4 years ago

Awesome. That's exactly the behavior I expected! Looks good to me.