Skip to content

Commit 67ce7a9

Browse files
committed
Adding python-config script to virtualenv bin dir
Should solve most of pypa#169
1 parent 2d06518 commit 67ce7a9

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

virtualenv.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,8 @@ def create_environment(home_dir, site_packages=False, clear=False,
10431043

10441044
install_activate(home_dir, bin_dir, prompt)
10451045

1046+
install_python_config(home_dir, bin_dir, prompt)
1047+
10461048
def path_locations(home_dir):
10471049
"""Return the path locations for the environment (where libraries are,
10481050
where scripts go, etc)"""
@@ -1438,6 +1440,10 @@ def install_activate(home_dir, bin_dir, prompt=None):
14381440
files['activate.csh'] = ACTIVATE_CSH
14391441

14401442
files['activate_this.py'] = ACTIVATE_THIS
1443+
1444+
install_files(home_dir, bin_dir, prompt, files)
1445+
1446+
def install_files(home_dir, bin_dir, prompt, files):
14411447
if hasattr(home_dir, 'decode'):
14421448
home_dir = home_dir.decode(sys.getfilesystemencoding())
14431449
vname = os.path.basename(home_dir)
@@ -1449,6 +1455,16 @@ def install_activate(home_dir, bin_dir, prompt=None):
14491455
content = content.replace('__BIN_NAME__', os.path.basename(bin_dir))
14501456
writefile(os.path.join(bin_dir, name), content)
14511457

1458+
def install_python_config(home_dir, bin_dir, prompt=None):
1459+
home_dir = os.path.abspath(home_dir)
1460+
if sys.platform == 'win32' or is_jython and os._name == 'nt':
1461+
files = {}
1462+
else:
1463+
files = {'python-config': PYTHON_CONFIG}
1464+
install_files(home_dir, bin_dir, prompt, files)
1465+
for name, content in files.items():
1466+
make_exe(os.path.join(bin_dir, name))
1467+
14521468
def install_distutils(home_dir):
14531469
distutils_path = change_prefix(distutils.__path__[0], home_dir)
14541470
mkdir(distutils_path)
@@ -2238,6 +2254,22 @@ def convert(s):
22382254
s3az+sj7eA0jfgPfeoN1
22392255
""")
22402256

2257+
##file python-config
2258+
PYTHON_CONFIG = convert("""
2259+
eJyFVFFvmzAQfvev8FpVBrXQ9jVSKqUd3dBYWiVt1aqKLAom8cQA2U4WpP34nW0IkKUtLxyc77vv
2260+
vrvz8RdKn8LZw+MkosH0idJzSq/DKZ1OfgbwUdVqVRYI8d9VKRSWtWzNcmctmSorhTJR/sYpl2qt
2261+
eC5xF5GURcaXCG3inKcUjko8xq+kEizjW3KGCduyxOs+eZHk65RJbef8zbyTLI+XYCE8eEieNg5M
2262+
ViyvyAKhlGWYbbmif7ha0bWMl8xJypSNL92RCa8ELxS+ugJqvlQpE+IMHz3qcyN8IvHriVwc4RPs
2263+
aH8slpvXi8V+3o8f8pf4v0peOMTzyCkUjLNSYP3mBe5UcF2DqtNovoaki5ASteWpz5xhYKD1siL7
2264+
9tVRuxwtoHQovweL2DZhVdsXH+orhUXclwWy8QwXpTK53j1T1RsmgMOul5oGtSbdxMIhT8FsHt5N
2265+
iYvAA38+OIwQ5KKma3oMtGHkcbRl6nC1TJrQwtADEU1rm7829DBX0+YLYNzTey8EALVjPNa4zcyN
2266+
dt21o9FRv58Ft+EzssnyQWx/aN8HCJ6DG3oQBajp+egPu+c1Y+52gDuhiBcSfLonq11PCiCOe2BG
2267+
P4up8lhRWbGEZzwZP4g1cxc7lEG1DbHRIIf5B7OrWJE6tvEOubmNJt/mxPVllcNQN0PeaUNwsxwm
2268+
2j2sSrv2YKX/SaKddiNMwii87qWDclvH/GU+9A0Q/LiqNG/i5VYRcmrmvDt1jOM0xWrFsG3zOYQ1
2269+
F+Kz/3JuJYUbD66PtzWsUJHXWjQIEAxzCXvVg5KrWLBUZxaxqHWdPVD/sOht7UPVm41tq7yv4d6e
2270+
XEcBnX+fzIKvfaUG9fJCMqGcCy1rRHo6gUj3Eek1ahey19oonP64vZu1eT7tsMZw0T8AKOXE
2271+
""")
2272+
22412273
if __name__ == '__main__':
22422274
main()
22432275

0 commit comments

Comments
 (0)