-
Notifications
You must be signed in to change notification settings - Fork 74
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
WIP: Add back some auto-configuration so we can use from edx-platform. #51
Conversation
I don't like that there are three places that say "bin/python". Some of this could go away if we drop the CODEJAIL_TEST_VENV environment variable. It isn't documented in the readme, and I managed the same effect by activating the edx-platform venv before running the codejail tests. |
I'm not done with this, but it'd be good to get some eyeballs on it early :) |
venv = sibling_sandbox_venv() | ||
if not venv: | ||
raise Exception("Couldn't find sandbox virtualenv") | ||
configure("python", os.path.join(venv, "bin/python"), user="sandbox", lang=languages.python2) |
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.
I don't think this is the right place to add this logic. edx-platform should be deciding where it wants its sandboxes created, not codejail.
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.
At the most, codejail should provide an option to autocreate a sibling env, but the importing code should have to opt in to it, perhaps by an environment variable, or some other setting.
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.
I would love for you to help figure out how to do that. Keep in mind that the tests need pass, both with and with sandboxes in the environment. We have Django middleware that configures codejail, but that middleware isn't run during the safe_exec tests, since they are not in a Django app.
@@ -101,16 +95,26 @@ def not_safe_exec( | |||
globals_dict.update(json_safe(g_dict)) | |||
|
|||
|
|||
if ALWAYS_BE_UNSAFE: # pragma: no cover | |||
# Make safe_exec actually call not_safe_exec, but log that we're doing so. | |||
def configure_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.
Thanks! Let me know when this is ready for a for-real review.
* Python 2.x is called "python" again * Provide "configure_python" so that edx-platform can get convenient configuration.
@jcdyer ready for real review. |
Closing for lack of action. Feel free to reopen if needed. |
No description provided.