-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Feature: Add ability to use a separate python environment in local executor #2615
Feature: Add ability to use a separate python environment in local executor #2615
Conversation
@microsoft-github-policy-service agree |
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.
Shall we update the execution_policies
argument so it can supply the executable binary for Python?
Right now an execution policy is defined as a |
…ture/virtualenv-in-local-executor
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2615 +/- ##
===========================================
- Coverage 33.11% 15.75% -17.37%
===========================================
Files 86 86
Lines 9108 9128 +20
Branches 1938 2093 +155
===========================================
- Hits 3016 1438 -1578
- Misses 5837 7642 +1805
+ Partials 255 48 -207
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Needed to add a special case for Windows because of how |
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.
Thanks for the PR! A few questions:
- Does this only work with Python virtual environment not Anaconda?
- Can you add a code block example in the doc string for how to use the
virtual_env_context
argument? - Can you update the documentation in
website/docs/topics/code-execution/cli-code-executor.ipynb
for an example on how to use this?
I don't think these changes will work with Anaconda since it doesn't use |
Thanks @Gr3atWh173 can you add your discord handle so we can connect with you on AutoGen's discord server: #2310 |
…ecutor (microsoft#2615) * Add ability to use virtual environments in local executor * Copy environment variables from parent environment * Fix mypy errors and formatting * Account for venv on Windows * Use a virtual environment context object instead of path * Add utility method to create a virtual environment * Remove assertion using `_venv_path` * Add tests for `create_virtual_env` * Modify test code and add output assertion * Modify test code and assertion * Execute activation script before actual command on windows * Add docs for using a virtual env
Why are these changes needed?
To execute code inside a python virtual environment so that the base environment isn't polluted by unwanted dependencies.
Related issue number
Solves #2613
Checks