classification
Title: CPython setup.py problems
Type: behavior Stage: patch review
Components: Build Versions: Python 3.3, Python 3.4, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, eric.araujo, jkloth, ronaldoussoren
Priority: normal Keywords:

Created on 2013-06-18 13:13 by ronaldoussoren, last changed 2014-05-04 18:35 by eric.araujo.

Files
File name Uploaded Description Edit
setup-update.txt ronaldoussoren, 2013-06-18 13:13 review
setup-update-v2.txt ronaldoussoren, 2013-06-18 14:49 review
Messages (5)
msg191406 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2013-06-18 13:13
While working on a fix for #18211 I noticed two problems with the setup.py that's used to build the stdlib extensions.

1) setup.py uses sysconfig instead of distutils.sysconfig. The sematics of the two modules a slighty different.

2) The block of code starting with the this text is not necessary because distutils.sysconfig (which is used by the build_ext command) already does the right thing for environment variables:


        # When you run "make CC=altcc" or something similar, you really want
        # those environment variables passed into the setup.py phase.  Here's
        # a small set of useful ones.
msg191414 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2013-06-18 14:49
So much for obviously correct changes...

1) fix typo in import statement (from sysconfig import import ...)

2) setup.py uses sysconfig.get_path and that's not present in distutils.sysconfig.

(Sigh..., why are there two modules with almost but not entirely equal functionality and APIs?)
msg191427 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2013-06-18 19:29
distutils.sysconfig module is theoretically deprecated in favor of sysconfig module. It is better to fix sysconfig module than to switch back to distutils.sysconfig module.
msg191445 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2013-06-19 05:51
I don't agree. Distutils still uses distutils.sysconfig for configuration information and setup.py wants to adjust that configuration, it should therefore use distutils.sysconfig instead of the global one. 

That said, it would be better to change distutils to use sysconfig instead of its local configuration information (distutils.sysconfig, distutils.command.install.INSTALL_SCHEMES, ...).  That has never been because distutils is frozen due to backward compatibility concerns, but it might be better to actually change distutils for 3.4 when there will be other changes to deal with the new packaging PEPs as well).

However: switching distutils to use the toplevel sysconfig will change functionality, as I wrote in my initial message you can use environment variables to override variables for distutils.sysconfig, but that doesn't work for the global sysconfig because the values in _sysconfigdata are expanded at build time.
msg217883 - (view) Author: √Čric Araujo (eric.araujo) * (Python committer) Date: 2014-05-04 18:35
Note that the distutils feature freeze has been lifted, so in 3.5 sysconfig could be reused by distutils.sysconfig, but the existing functionality (different API + ability to override with env vars) must be preserved.
History
Date User Action Args
2014-05-04 18:35:56eric.araujosetnosy: + eric.araujo
messages: + msg217883
2014-05-04 18:08:47eric.araujounlinkissue18211 dependencies
2013-06-19 05:51:07ronaldoussorensetmessages: + msg191445
2013-06-18 19:29:53Arfreversetnosy: + Arfrever
messages: + msg191427
2013-06-18 14:49:10ronaldoussorensetfiles: + setup-update-v2.txt

messages: + msg191414
2013-06-18 14:07:26jklothsetnosy: + jkloth
2013-06-18 13:13:54ronaldoussorenlinkissue18211 dependencies
2013-06-18 13:13:06ronaldoussorencreate