Yelp / venv-update

Synchronize your virtualenv quickly and exactly.
http://venv-update.rtfd.org
MIT License
176 stars 34 forks source link

incompatibility with virtualenv 20 #231

Closed bukzor closed 3 years ago

bukzor commented 4 years ago

virtualenv version 20 waas released three days ago. Since then, using venv-update unmodified results in this error:

OSError: [Errno 39] Directory not empty: 
   '$HOME/.cache/venv-update/3.1.1/src.tmp' -> 
   '$HOME/.cache/venv-update/3.1.1/src'

This is due to a check for existance of virtualenv.py always failing, which is in turn due to virtualenv project refactoring from a module to a package with virtualenv/main.py. I tried to simply patch venv-update to handle the new structure, but the changes are too extensive.

As a short-term fix, this works for me (tm):

--- sbin/venv-update.orig       2020-02-13 11:25:28.210285813 -0800
+++ sbin/venv-update    2020-02-13 11:33:31.696390868 -0800
@@ -200,7 +200,7 @@
         scratch_python = venv_python(scratch.venv)
         # TODO: do we allow user-defined override of which version of virtualenv to install?
         tmp = scratch.src + '.tmp'
-        run((scratch_python, '-m', 'pip.__main__', 'install', 'virtualenv', '--target', tmp))
+        run((scratch_python, '-m', 'pip.__main__', 'install', 'virtualenv<20', '--target', tmp))

         from os import rename
         rename(tmp, scratch.src)
theodore86 commented 4 years ago

Hi,

Yes indeed,

An quick workaround: run((scratch_python, '-m', 'pip.__main__', 'install', 'virtualenv==16.7.9', '--target', tmp))

chriskuehl commented 4 years ago

Released v3.2.3 which uses virtualenv<20 to work around this.