Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect env variables upon activation/deactivation #15

Open
pmav99 opened this issue Feb 5, 2024 · 1 comment
Open

Respect env variables upon activation/deactivation #15

pmav99 opened this issue Feb 5, 2024 · 1 comment

Comments

@pmav99
Copy link

pmav99 commented Feb 5, 2024

activate.sh should respect the existing values of PYTHONPATH and LD_LIBRARY_PATH

export PATH=$HOMETEL/scripts/python3:$PATH
export PYTHONPATH=$HOMETEL/scripts/python3
export PYTHONPATH=$HOMETEL/builds/$USETELCFG/wrap_api/lib:$PYTHONPATH
export LD_LIBRARY_PATH=$HOMETEL/builds/$USETELCFG/wrap_api/lib:$HOMETEL/builds/$USETELCFG/lib:$CONDA_PREFIX/lib

while deactivate.sh should restore the "old" values of PATH, PYTHONPATH and LD_LIBRARY_PATH and PYTHONUNBUFFERED
unset PYTHONUNBUFFERED
unset PYTHONPATH
unset LD_LIBRARY_PATH

This might be useful for implementing this: https://stackoverflow.com/a/47159781
Alternatively the "before-activation" values need to be stored in a different env variable and get restored upon deactivation.

@pmav99
Copy link
Author

pmav99 commented Feb 5, 2024

For the record, unless PYTHONUNBUFFERED is somehow required/expected by telemac, I would avoid setting it in the first place. Let the user choose to set it (e.g. via python -u or something). Silently changing default behaviors can be hard to debug.

tomsail added a commit to tomsail/telemac-mascaret-feedstock that referenced this issue Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant