How do I use easy_install and buildout when pypi is down?

后端 未结 7 1481
死守一世寂寞
死守一世寂寞 2021-02-01 23:26

I am using buildout to automatically download and setup the many dependencies of my Plone installation. buildout more or less uses easy_install to download and install a bunch o

相关标签:
7条回答
  • 2021-02-02 00:21

    In case of zc.buildout: use its local download caching features. There are mostly three things to cache:

    • external extends, i.e. http://dist.plone.org/release/4.1.2/versions.cfg
    • eggs from some distserver, i.e. pypi
    • downloads from zc.recipe.cmmi or similar recipes using the download infrastructure provided by zc.buildout

    For all three we need to tweak the global configuration and set a cache folder for the extends and one for eggs and other downloads.

    In your home folder create a .buildout folder.

    In this folder create the folders extends-cache and downloads

    In .buildout create a file default.cfg with:

    [buildout]  
    extends-cache = /home/USERNAME/.buildout/extends-cache 
    download-cache = /home/USERNAME/.buildout/downloads
    

    so you have:

    .buildout/
    ├── default.cfg
    ├── downloads
    └── extends-cache
    

    Thats it. Make sure to not override these two variables from default.cfg in your specific buildout. After first successful run of buildout subsequent runs are running in offline mode ./bin/buildout -o.

    As a side effect buildout is much faster if used in offline mode, i.e. when no new downloads are expected but some configuration changed

    Beside this it makes sense to run your own pypi-mirror. As another source of information you might be interested in the article I wrote some time ago about this topic: http://bluedynamics.com/articles/jens/setup-z3c.pypimirror

    0 讨论(0)
提交回复
热议问题