Closed Almenon closed 3 years ago
I took a look in the code in #54 - did this fix the problem when you tested it? I think you would still have the same issue - the environment vars you pass in just has the PATH in darwin OS's but it should have the USERNAME
and other env vars too.
I'm guessing you need to pass in process.env
.
Hehe, I had to hotfix it afterwards: https://github.com/Duroktar/Wolf/commit/d2c59d9c6b9d47e4c348414b63bf2695a37e5075
And you were 100% right :D I really don't know how it got passed the unit tests to begin with (local pytest cache maybe?), merging in process.env
was the magic bit.
PS: Really good to hear from you again old friend :)
Good to see you again too :)
Python code:
Expected result: logs 'almenon' Actual result:
In AREPL I avoid this problem by using python-shell and passing the env vars in like so:
Constructor of arepl-backend:
In start() method in backend: https://github.com/Almenon/AREPL-backend/blob/209eb5b8ae8cda1677f925749a10cd263f6d9860/index.ts#L171
In arepl-vscode I borrowed some code from the python extension, adapted it a bit and hardcoded it into a folder called "env": https://github.com/Almenon/AREPL-vscode/tree/7ed81bd83b8b30b1d18366c7f1254b13b6dc6ba6/src/env
Then in https://github.com/Almenon/AREPL-vscode/blob/d8c9f32d573213163f27e903e31df197be1e8248/src%2FPreviewManager.ts#L5 I have:
The python extension code has the benefit of also reading from the workspace .env file. The downside is that it is very large and complex, probably overengineered IMO.