-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Fix #2845 - LocalCommandLineCodeExecutor is not working with virtual environments #2847
Conversation
@microsoft-github-policy-service agree |
executor = LocalCommandLineCodeExecutor(work_dir=relative_folder_path, virtual_env_context=env_builder_context) | ||
code_blocks = [ | ||
# https://stackoverflow.com/questions/1871549/how-to-determine-if-python-is-running-inside-a-virtualenv | ||
CodeBlock(code="import sys; print(sys.prefix != sys.base_prefix)", language="python"), |
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.
In addition also make sure the environment used is the same as expected?
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.
@ekzhu, Could you please elaborate?
Modifications that I made should work for all supported environments. Could you please review recent modifications and see if this comment is still valid?
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
10404695 | Triggered | Generic High Entropy Secret | bdda3e6 | test/oai/test_utils.py | View secret |
10493810 | Triggered | Generic Password | bdda3e6 | notebook/agentchat_pgvector_RetrieveChat.ipynb | View secret |
10493810 | Triggered | Generic Password | bdda3e6 | notebook/agentchat_pgvector_RetrieveChat.ipynb | View secret |
11616921 | Triggered | Generic High Entropy Secret | 5a51d20 | notebook/agentchat_agentops.ipynb | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Sorry, by mistake closed |
@sonichi, Hi, I just updated my branch with current main. now, GitGuardian showing secret found error in some other notebook which I haven't touched. Could you help me resolve this? And please trigger the workflow so that I can verify the fix that I made. |
I am planning to reopen this as a new PR since I am seeing gitguardian issues from main branch displayed here. Hope it gets resolved. |
Why are these changes needed?
If the virtual env path is relative, local code executer fails to execute any code blocks
Related issue number
"Closes #2845"
Checks