From d5d49c700ce3bc291ad9a7b498c95ec437673cc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Reni=C3=A9?= Date: Tue, 23 Sep 2014 17:30:40 +0200 Subject: [PATCH 1/4] Support virtualenvs created with --python=/usr/bin/pythonX.Y --- virtualenv_tools.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/virtualenv_tools.py b/virtualenv_tools.py index f5671c1..da10407 100644 --- a/virtualenv_tools.py +++ b/virtualenv_tools.py @@ -26,6 +26,7 @@ ] _pybin_match = re.compile(r'^python\d+\.\d+$') _activation_path_re = re.compile(r'^(?:set -gx |setenv |)VIRTUAL_ENV[ =]"(.*?)"\s*$') +_shebang_bin_re = re.compile(r'.*/bin/python(\d+(\.\d+)?)?$') def update_activation_script(script_filename, new_path): @@ -65,11 +66,13 @@ def update_script(script_filename, new_path): if not args: return - if not args[0].endswith('/bin/python') or \ + if not _shebang_bin_re.match(args[0]) or \ '/usr/bin/env python' in args[0]: return - new_bin = os.path.join(new_path, 'bin', 'python') + python = args[0].split('/')[-1] + + new_bin = os.path.join(new_path, 'bin', python) if new_bin == args[0]: return From beee2cb8b511c0893f70c59c6f3b4e4464e31aaf Mon Sep 17 00:00:00 2001 From: Paul Krohn Date: Mon, 22 Feb 2016 12:49:13 -0800 Subject: [PATCH 2/4] match python2.7 in addition to python27 --- virtualenv_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtualenv_tools.py b/virtualenv_tools.py index da10407..ca235e7 100644 --- a/virtualenv_tools.py +++ b/virtualenv_tools.py @@ -26,7 +26,7 @@ ] _pybin_match = re.compile(r'^python\d+\.\d+$') _activation_path_re = re.compile(r'^(?:set -gx |setenv |)VIRTUAL_ENV[ =]"(.*?)"\s*$') -_shebang_bin_re = re.compile(r'.*/bin/python(\d+(\.\d+)?)?$') +_shebang_bin_re = re.compile(r'.*/bin/python(\d+(\.?\d+)?)?$') def update_activation_script(script_filename, new_path): From f0122d02dae34e7cbd75bcf444b3fb7e0d2dac8e Mon Sep 17 00:00:00 2001 From: Paul Krohn Date: Mon, 22 Feb 2016 12:49:45 -0800 Subject: [PATCH 3/4] ignore build artifacts --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b07b17e..7b8c236 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ *.egg-info .DS_Store dist +build From c86900ae56ba0d149862906f335ce7ee0f78e129 Mon Sep 17 00:00:00 2001 From: Paul Krohn Date: Mon, 22 Feb 2016 12:50:37 -0800 Subject: [PATCH 4/4] version bump --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e5d57ec..0191b10 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ name='virtualenv-tools', author='Fireteam Ltd.', author_email='support@fireteam.net', - version='1.0', + version='1.0.1', url='http://github.com/fireteam/virtualenv-tools', py_modules=['virtualenv_tools'], description='A set of tools for virtualenv',