6

Can I set download cache path for setuptools? I can do that with pip by setting environment variable PIP_DOWNLOAD_CACHE (How to cache downloaded PIP packages), but I don't know, what to do with setuptools.

I want everytime, when I run:

python setup.py develop

the setuptools caches the downloaded files, so I don't have to download it again.

Community
  • 1
  • 1
Tarzan
  • 509
  • 3
  • 14
  • Isn't this similar with what you want? http://stackoverflow.com/a/11092043/471481 I might be wrong or misread your question – Andrei Sfat May 27 '14 at 19:38
  • Thanks for reply. I mean 'cache' for pip, not require_packages. About my question, I think that there's not a solution for it. – Tarzan May 28 '14 at 02:49

1 Answers1

2

You can use the options -a, -d and -f to create and use a cache directory. This is what the help text for them says:

--always-copy (-a)             Copy all needed packages to install dir
--install-dir (-d)             install package to DIR
--find-links (-f)              additional URL(s) to search for packages

You first use python setup.py develop -a -d CACHEDIR to cache the needed packages in the directory of your choice, then use that directory as a source in the future with python setup.py develop -f CACHEDIR.

You may need to add any flags you normally use to one, the other, or both invocations, depending on the flag in question.

otus
  • 4,957
  • 29
  • 46