Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Environment variables in hooks not used correctly? #64

@danbradham

Description

@danbradham

Discussed in #60

Originally posted by fabiangeisler August 18, 2022
Not sure if I hit a bug or if this is intended behaviour.
Consider the following setup:

  • Module A has a pre_activate.py hook that sets env variable "FOO" (in python with os.environ)
  • Module B has an environment in his module.yml defined that uses "FOO"
    like:
    environment: 
      BAR: '${FOO}/somewhere'
  • Module A is loaded before Module B in a test environment C

I would expect that "BAR" in Module B resolves fine with the variable from Module A, but it does not. Is this intended or not?

Side note:
That it is not correctly displayed in the tk-cpenv GUI is ok for me as long as the final resolved environment is working fine.

The behaviour that I am after is, setting an environment variable dynamically based on some conditions. Is there another/better way to achieve this in cpenv?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions