[Checkins] SVN: zc.buildout/branches/env-cache/src/zc/buildout/easy_install.py Return copies of cached envs for better isolation.

Ross Patterson me at rpatterson.net
Sat Jan 21 08:54:50 UTC 2012


Log message for revision 124115:
  Return copies of cached envs for better isolation.
  
  Copying an instantiated environment doesn't rescan the filesystem for
  dists and allows for the consumer of the env to modify it without
  affecting subseqent uses of the cache.
  
  The env cache still causes test failures.  In
  zc/buildout/debugging.txt, for example, it can't find a part recipe
  because the develop egg path isn't being added to sys.path while it
  does get added if the cache isn't used.

Changed:
  U   zc.buildout/branches/env-cache/src/zc/buildout/easy_install.py

-=-
Modified: zc.buildout/branches/env-cache/src/zc/buildout/easy_install.py
===================================================================
--- zc.buildout/branches/env-cache/src/zc/buildout/easy_install.py	2012-01-21 08:54:36 UTC (rev 124114)
+++ zc.buildout/branches/env-cache/src/zc/buildout/easy_install.py	2012-01-21 08:54:49 UTC (rev 124115)
@@ -240,9 +240,12 @@
     if env is None:
         _envs[key] = env = pkg_resources.Environment(
             search_path=path, python=python)
-    return env
 
+    env_copy = pkg_resources.Environment(search_path=[], python=python)
+    env_copy += env
+    return env_copy
 
+
 def clear_index_cache():
     _indexes.clear()
     _envs.clear()



More information about the checkins mailing list