Skip to content

Commit

Permalink
Add conda support to activation script
Browse files Browse the repository at this point in the history
  • Loading branch information
cmrqs committed Dec 3, 2024
1 parent 13fdda2 commit be6c5b2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/ert/config/queue_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@

def activate_script() -> str:
venv = os.environ.get("VIRTUAL_ENV")
if not venv:
return ""
return f"source {venv}/bin/activate"
if venv:
return f"source {venv}/bin/activate"
conda_env = os.environ.get("CONDA_ENV")
if conda_env:
return f'eval "$(conda shell.bash hook)" && conda activate {conda_env}'
return ""


@pydantic.dataclasses.dataclass(config={"extra": "forbid", "validate_assignment": True})
Expand Down

0 comments on commit be6c5b2

Please sign in to comment.