chrisjsewell / activate_aiida

a package to activate an aiida environment, from a yaml config file
MIT License
0 stars 2 forks source link

specify user email & name on the fly #6

Open ltalirz opened 3 years ago

ltalirz commented 3 years ago

we have a use case on renkulab, where we would like to specify the user email and name on the fly (pulling it from environment variables). Since the aiida_config.yaml is committed to the (template) repository, we cannot easily get user-specific information directly into the file.

I see at least three possible ways of supporting this:

  1. add command line options (perhaps not ideal; we don't want to add command line options for everything)
  2. process environment variables inside aiida_config.yaml, i.e. one could set email: "$AIIDA_USER_EMAIL" (perhaps also not ideal since we're mixing yaml with env vars)
  3. take user, firstname and lastname from specific environment variables, if they are not specified in the aiida_config.yaml (e.g. AIIDA_USER_EMAIL, AIIDA_USER_FIRST_NAME, AIIDA_USER_LAST_NAME, AIIDA_USER_INSTITUTION)

To me the last option sounds most promising @chrisjsewell what would you prefer?

chrisjsewell commented 3 years ago

could just do it like molecule?

email: ${AIIDA_USER_EMAIL:-default@example.com}

but happy for you to submit any as a PR