Tarzan
Tarzan

Reputation: 529

setuptools download cache path

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.

Upvotes: 6

Views: 1714

Answers (1)

otus
otus

Reputation: 5732

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.

Upvotes: 2

Related Questions