Created
February 24, 2015 17:18
-
-
Save mmulich/dde3a0b8b603391915f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """\ | |
| Symbolically links a virtualenv's site-packages to | |
| the globaly Python's user site-packages directory. | |
| This should be run with the global Python. | |
| """ | |
| import os | |
| import site | |
| import argparse | |
| def main(argv=None): | |
| """Main process""" | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument('location', help="location of the virtualenv") | |
| args = parser.parse_args(argv) | |
| location = os.path.abspath(args.location) | |
| # FIXME hard coded version. | |
| location = os.path.join(location, 'lib/python2.7/site-packages') | |
| site_packages = site.getusersitepackages() | |
| os.unlink(site_packages) | |
| os.symlink(location, site_packages) | |
| return 0 | |
| if __name__ == '__main__': | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment