From c225808395c2d3c284bcf8cad3d904709eabc1b5 Mon Sep 17 00:00:00 2001 From: Justin Quick Date: Sun, 2 Nov 2014 19:19:16 -0500 Subject: [PATCH 1/2] Added --always-copy to virtualenv call This make it so that the files in the vent are copied from the source machine when creating the jar files. If this is not present, recent versions of virtualenv will symlink and cause bad links in the jar files. Bad links mean that the files will not exist when the jar is actually run. This fix ensures that all required files in the venv are copied over so you do not actually have to have python installed on your pyleus cluster. This is the root cause of the `ImportError: No module named 'encodings'` problem in #50 --- pyleus/cli/virtualenv_proxy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyleus/cli/virtualenv_proxy.py b/pyleus/cli/virtualenv_proxy.py index 3b93c8f..afd50ff 100644 --- a/pyleus/cli/virtualenv_proxy.py +++ b/pyleus/cli/virtualenv_proxy.py @@ -53,7 +53,7 @@ def __init__(self, path, def _create_virtualenv(self): """Creates the actual virtualenv""" - cmd = ["virtualenv", self.path] + cmd = ["virtualenv", "--always-copy", self.path] if self._system_site_packages: cmd.append("--system-site-packages") From a459b64527da607eff5d76796830279e13cf6c37 Mon Sep 17 00:00:00 2001 From: Justin Quick Date: Sun, 2 Nov 2014 19:32:18 -0500 Subject: [PATCH 2/2] fixed tests to include copy flag doh --- tests/cli/virtualenv_proxy_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cli/virtualenv_proxy_test.py b/tests/cli/virtualenv_proxy_test.py index c8c421d..08a539e 100644 --- a/tests/cli/virtualenv_proxy_test.py +++ b/tests/cli/virtualenv_proxy_test.py @@ -58,7 +58,7 @@ def test__create_virtualenv_system_site_packages( system_site_packages=True, verbose=True) mock_cmd.assert_called_once_with( - ["virtualenv", VENV_PATH, "--system-site-packages"], + ["virtualenv", "--always-copy", VENV_PATH, "--system-site-packages"], stdout=venv._out_stream, stderr=venv._err_stream, err_msg=mock.ANY @@ -72,7 +72,7 @@ def test__create_virtualenv_no_system_site_packages( system_site_packages=False, verbose=True) mock_cmd.assert_called_once_with( - ["virtualenv", VENV_PATH], + ["virtualenv", "--always-copy", VENV_PATH], stdout=venv._out_stream, stderr=venv._err_stream, err_msg=mock.ANY