-
Notifications
You must be signed in to change notification settings - Fork 159
Fixes env vars in languages other than Python #108
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
base: main
Are you sure you want to change the base?
Fixes env vars in languages other than Python #108
Conversation
@mishushakov can you add tests for this case? it would be good to catch if setting env var breaks |
yes, these will be in a separate PR as otherwise we would be unable to merge this (the CI is using deployed template version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are not setting global env vars for the default context. Can you try to create the context in lifespan
in server instead of the startup script, so we can make in all cleaner?
Can you clean up 0001_envs.py
from template? it shouldn't be used anymore
Let's wait for #116 here |
…n-running-r-code-e2b-1977
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add tests to this PR? 🙏🏻
I need to rewrite the tests. I don't know what went south last time, but they don't look correct to me. |
I don't think this is correct, try this:A from e2b_code_interpreter import Sandbox
sbx = Sandbox(envs={"TEST": "ABC"})
execution = sbx.run_code(
"""
import os
os.getenv("TEST")
"""
)
print(execution.results[0]) |
Changelog:
Example:
Before:
After: