Skip to content
Browse files

Adding python-config script to virtualenv bin dir

Should solve most of pypa/virtualenv#169
  • Loading branch information...
1 parent 2d06518 commit 67ce7a9418acd06a55ad76cbe4e220e4461a04b4 @madprog committed Dec 27, 2011
Showing with 32 additions and 0 deletions.
  1. +32 −0 virtualenv.py
View
32 virtualenv.py
@@ -1043,6 +1043,8 @@ def create_environment(home_dir, site_packages=False, clear=False,
install_activate(home_dir, bin_dir, prompt)
+ install_python_config(home_dir, bin_dir, prompt)
+
def path_locations(home_dir):
"""Return the path locations for the environment (where libraries are,
where scripts go, etc)"""
@@ -1438,6 +1440,10 @@ def install_activate(home_dir, bin_dir, prompt=None):
files['activate.csh'] = ACTIVATE_CSH
files['activate_this.py'] = ACTIVATE_THIS
+
+ install_files(home_dir, bin_dir, prompt, files)
+
+def install_files(home_dir, bin_dir, prompt, files):
if hasattr(home_dir, 'decode'):
home_dir = home_dir.decode(sys.getfilesystemencoding())
vname = os.path.basename(home_dir)
@@ -1449,6 +1455,16 @@ def install_activate(home_dir, bin_dir, prompt=None):
content = content.replace('__BIN_NAME__', os.path.basename(bin_dir))
writefile(os.path.join(bin_dir, name), content)
+def install_python_config(home_dir, bin_dir, prompt=None):
+ home_dir = os.path.abspath(home_dir)
+ if sys.platform == 'win32' or is_jython and os._name == 'nt':
+ files = {}
+ else:
+ files = {'python-config': PYTHON_CONFIG}
+ install_files(home_dir, bin_dir, prompt, files)
+ for name, content in files.items():
+ make_exe(os.path.join(bin_dir, name))
+
def install_distutils(home_dir):
distutils_path = change_prefix(distutils.__path__[0], home_dir)
mkdir(distutils_path)
@@ -2238,6 +2254,22 @@ def convert(s):
s3az+sj7eA0jfgPfeoN1
""")
+##file python-config
+PYTHON_CONFIG = convert("""
+eJyFVFFvmzAQfvev8FpVBrXQ9jVSKqUd3dBYWiVt1aqKLAom8cQA2U4WpP34nW0IkKUtLxyc77vv
+vrvz8RdKn8LZw+MkosH0idJzSq/DKZ1OfgbwUdVqVRYI8d9VKRSWtWzNcmctmSorhTJR/sYpl2qt
+eC5xF5GURcaXCG3inKcUjko8xq+kEizjW3KGCduyxOs+eZHk65RJbef8zbyTLI+XYCE8eEieNg5M
+ViyvyAKhlGWYbbmif7ha0bWMl8xJypSNL92RCa8ELxS+ugJqvlQpE+IMHz3qcyN8IvHriVwc4RPs
+aH8slpvXi8V+3o8f8pf4v0peOMTzyCkUjLNSYP3mBe5UcF2DqtNovoaki5ASteWpz5xhYKD1siL7
+9tVRuxwtoHQovweL2DZhVdsXH+orhUXclwWy8QwXpTK53j1T1RsmgMOul5oGtSbdxMIhT8FsHt5N
+iYvAA38+OIwQ5KKma3oMtGHkcbRl6nC1TJrQwtADEU1rm7829DBX0+YLYNzTey8EALVjPNa4zcyN
+dt21o9FRv58Ft+EzssnyQWx/aN8HCJ6DG3oQBajp+egPu+c1Y+52gDuhiBcSfLonq11PCiCOe2BG
+P4up8lhRWbGEZzwZP4g1cxc7lEG1DbHRIIf5B7OrWJE6tvEOubmNJt/mxPVllcNQN0PeaUNwsxwm
+2j2sSrv2YKX/SaKddiNMwii87qWDclvH/GU+9A0Q/LiqNG/i5VYRcmrmvDt1jOM0xWrFsG3zOYQ1
+F+Kz/3JuJYUbD66PtzWsUJHXWjQIEAxzCXvVg5KrWLBUZxaxqHWdPVD/sOht7UPVm41tq7yv4d6e
+XEcBnX+fzIKvfaUG9fJCMqGcCy1rRHo6gUj3Eek1ahey19oonP64vZu1eT7tsMZw0T8AKOXE
+""")
+
if __name__ == '__main__':
main()

3 comments on commit 67ce7a9

@amchoukir

Hello Paul,

I have encountered several issues due to the lack pf python-config in virtualenv. I wanted to know if you plan to commit this patch?

Cheers

@madprog
Owner

Hello Amine,

I have rebased this commit to df706ac so that I can make the pull request pypa/virtualenv#783.

Cheers

@amchoukir

Thanks Paul

Please sign in to comment.
Something went wrong with that request. Please try again.