File caching for subsequent rebuilds with distutils

I am creating a set of Python extensions with distutils. Extensions depend on external libraries (not related to Python) that are usually created from source code using the Makefile. These external libraries are unlikely to change frequently.

To ease the pain for users, my setup.py scripts extract libraries from the Internet using urllib.urlretrieve (), parse Make files to compile a list of the corresponding source files, and build them using config.add_library (). It works great, and all is well.

My question is: what is the best / recommended way to cache downloaded source files so that distutils do not load them again and again during recovery? Is it possible to store them, for example, in the build / src.macosx-10.6-x86_64-2.7 or build / temp.macosx-10.6-x86_64-2.7 folders created by distutils? If so, how is one distutils request for the name of these folders?

Thanks in advance!

+3
source share
1 answer

It should be possible to use these folders, here, how to get these names from distutils . However, these folders are rather unstable. I would suggest having an empty directory in the source distribution to receive these downloads with a README file explaining its role as a build cache.

+1
source

Source: https://habr.com/ru/post/1781851/


All Articles