Don't modify reserved environment variables when (de)/activating#15342
Don't modify reserved environment variables when (de)/activating#15342jezdez merged 10 commits intoconda:mainfrom
Conversation
CodSpeed Performance ReportMerging #15342 will not alter performanceComparing Summary
Footnotes
|
|
pre-commit.ci autofix |
ryanskeith
left a comment
There was a problem hiding this comment.
This looks good to me.
|
pre-commit.ci autofix |
ryanskeith
left a comment
There was a problem hiding this comment.
Looks good as far as formatting. I think the warning clause needs to be out of the loop though before this is committed.
f4f34cb to
d2a96b1
Compare
jezdez
left a comment
There was a problem hiding this comment.
@soapy1 I took the liberty to push a change that I think improves this PR for vars that are unset with conda env config vars unset .. (yep, that's a real command!). If you're okay with my changes, I'd be happy to approve it, but we can work on it more if you'd like.
|
pre-commit.ci autofix |
|
One more change to add here. When I was testing this out and flipping beteween environments with valid and invalid configured env vars, it was confusing to know which environment the warning is coming from. Adding the prefix name to the warning to clarify this. |
pushed this change. Now when a user activates/deactivates an environment with reserved environment variables configured, they get a warning like: |
For example, users should not be able to change their PATH environment variable thru their environment config. This change will ignore these reserved variables and print a warning to the user.
for more information, see https://pre-commit.ci
Co-authored-by: Jannis Leidel <[email protected]>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
4ed9851 to
93ea5af
Compare
@jezdez I'm good with these changes. Do you want to give it a once thru before merging? |
Description
Pt. 1 to address #15292
Users should not be able to change their
PATHenvironment variable through their environment config.This change will ignore these reserved variables (currently just
PATH). And, will print a warning to the user if a reserved environment variable is detected.For example, to test this out:
Checklist - did you ...
newsdirectory (using the template) for the next release's release notes?