[Python-Dev] distutils 'depends' management (original) (raw)

Éric Araujo merwok at netwok.org
Fri Feb 3 17:52:29 CET 2012


Hi Matteo,

Now setup.py will rebuild all every time, this is because the policy of newergroup in buildextension is to consider 'newer' any missing file. Here you certainly mean “older”.

[...] Can someone suggest me the reason of this choice distutils’ notion of dependencies directly comes from make. A missing (not existing) target is perfectly normal: it’s usually a generated file that make needs to create (i.e. compile from source files). In this world, you want to (re-)compile when the target is older than the sources, or when the target is missing.

So here your extension module is a target that needs to be created, and when distutils does not find a file with the name you give in depends, it just thinks it’s another thing that will be generated.

This model is inherently prone to typos; I’m not sure how we can improve it to let people catch possible typos.

Cheers



More information about the Python-Dev mailing list