virtualenv icon indicating copy to clipboard operation
virtualenv copied to clipboard

RFE: --always-copy

Open nvMcJohn opened this issue 14 years ago • 7 comments

Given that the footprint of the copy would be relatively small, would it be possible to add an option to always copy (as on windows) rather than symlinking?

The main benefit of copying is the ability to then check the virtual environment into source control.

Thanks!

nvMcJohn avatar Oct 19 '12 22:10 nvMcJohn

that's also discussed in #92

schmir avatar Oct 19 '12 22:10 schmir

I don't have a huge issue with this - do you want to try put a patch together.

pnasrat avatar Oct 23 '12 12:10 pnasrat

Sure, I'll take a stab at it.

nvMcJohn avatar Jan 10 '13 23:01 nvMcJohn

I've made a simple patch that works for me (at least using a shared windows folder on a linux machine, which didn't work before) - https://gist.github.com/m0she/4990128 - just add --always-copy to your command-line to use.

I haven't tested it thoroughly nor is it completely abiding to the project coding conventions and github is stuck on cloning the repo - so I'm not sending a pull request (perhaps tomorrow)

m0she avatar Feb 19 '13 21:02 m0she

+1 for this! Thanks!

pferreir avatar Mar 07 '13 10:03 pferreir

$ virtualenv --version 1.10.1 $ virtualenv --always-copy test New python executable in test/bin/python Traceback (most recent call last): File "/usr/local/bin/virtualenv", line 8, in load_entry_point('virtualenv==1.10.1', 'console_scripts', 'virtualenv')() File "/Library/Python/2.7/site-packages/virtualenv-1.10.1-py2.7.egg/virtualenv.py", line 821, in main symlink=options.symlink) File "/Library/Python/2.7/site-packages/virtualenv-1.10.1-py2.7.egg/virtualenv.py", line 956, in create_environment site_packages=site_packages, clear=clear, symlink=symlink)) File "/Library/Python/2.7/site-packages/virtualenv-1.10.1-py2.7.egg/virtualenv.py", line 1377, in install_python shutil.copyfile(py_executable_base, full_pth) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 81, in copyfile with open(src, 'rb') as fsrc: IOError: [Errno 2] No such file or directory: 'python'

jpascal avatar Sep 17 '13 08:09 jpascal

this was added in #409 (the bug for it not working though is #495)

qwcode avatar Dec 05 '13 05:12 qwcode