This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Add environment variable complementing command line option -no-user-cfg
Type: enhancement Stage: resolved
Components: Distutils Versions:
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: tarek Nosy List: AlexanderDreyer, Michael.Brickenstein, eric.araujo, tarek, ysj.ray
Priority: normal Keywords: patch

Created on 2010-07-19 21:14 by AlexanderDreyer, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit AlexanderDreyer, 2010-07-20 08:48 better patch for distutils/
Messages (11)
msg110811 - (view) Author: Alexander Dreyer (AlexanderDreyer) Date: 2010-07-19 21:14
At the Sage Days 24 coding sprint the issue came up, that the install programs of several python-based tools pick the prefix-setting from ~/.pydistutils.cfg.

In order to get this right, we suggest to introduce the environment variable DISTUTILS_NO_USER_CFG. It can be used like the --no-user-cfg commandline option supported by distutils.

Best regards
msg110877 - (view) Author: Alexander Dreyer (AlexanderDreyer) Date: 2010-07-20 08:49
Added better patch (checks environment first).
msg110878 - (view) Author: ysj.ray (ysj.ray) Date: 2010-07-20 08:58
I don't think this can go into python2.x. Besides, is it really worthy to add such a new environment variable?
msg110879 - (view) Author: Alexander Dreyer (AlexanderDreyer) Date: 2010-07-20 09:03
The patch is originating from Sage Days 24. Sage ( distributes a bunch of mathematical python-based software. The integration of the individual packages is done by individual people which might not use --no-user-cfg in their install scripts. So we needed a way to ensure this via the environment.

Best regards,
msg117678 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-09-30 00:12
If someone creates a .pydistutils.cfg file with a prefix option, it means to me that they want distutils to respect it.  Can you explain to me why it’s always wrong to follow this option for Sage?

Assuming you’ve convinced us prefix is bad, why can’t you require that the power users who do set this option use --no-user-cfg?

I’m not friendly toward adding an envvar, since we removed the one we were using (DISTUTILS_DEBUG) in distutils2, but I can be convinced.  Tarek will also have a major vote.  Challenge! :)
msg117704 - (view) Author: Alexander Dreyer (AlexanderDreyer) Date: 2010-09-30 07:53
The idea is, that an environment variable can be set globally by the master-build system or the packaging system. In contrary, the --no-user-cfg switch has to be added to the build description of each individial package. For strongly community-driven projects - like Sage - it is very likely, that this will be forgotten by some package maintainers. Since usually .pydistutils.cfg is not used in automated test environments this error will be detected, when a package is accepted.
msg117707 - (view) Author: Alexander Dreyer (AlexanderDreyer) Date: 2010-09-30 08:04
Of course, I mean: The error will *not* be detected...
msg117708 - (view) Author: Michael Brickenstein (Michael.Brickenstein) Date: 2010-09-30 08:28
Actually, Sage acts in a similar way like virtualenvs do.
In fact, config files are also a problem for virtualenv, see second red box here:

Virtualenv is currently incompatible with distutils.cfg and ~/.pydistutils.cfg. If you have either of these files, virtualenv will put easy_install into the bin directory specified in the config file, rather than into the virtualenv where it belongs.
msg131584 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-03-21 00:34
I’m not sure this is a distutils or virtualenv bug.  I will defer to Tarek’s decision.
msg131620 - (view) Author: Alexander Dreyer (AlexanderDreyer) Date: 2011-03-21 08:18
If a another solution via virtualenv could do it, I'd prefer that, too.
msg131648 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-03-21 13:27
This is discussed on

I noticed that the original Sage bug report requested that no-user-cfg be supported in the global distutils config file; this is more acceptable than adding an environment variable.  I’m not sure it would solve your problem though, which looks more educational than technical (i.e. people may forget to use an option on the command line or in the config file, so adding support for an option in the config file may not help).  Do you think it would be a useful feature anyway?

Anyway, don’t forget that distutils is closed to feature requests, and this would only land in distutils2 (included in Python 3.3 and released on PyPI for older versions), so I suspect a fix here would take years to be of benefit to your community.  I’m sorry about this situation, and I do hope a fix in virtualenv (which has a faster release cycle and don’t require you to change code in the distributed projects) will solve your problem in a near future.
Date User Action Args
2022-04-11 14:57:04adminsetgithub: 53555
2014-03-13 10:48:46eric.araujosetstatus: open -> closed
stage: resolved
resolution: rejected
components: + Distutils, - Distutils2
versions: - 3rd party
2011-03-21 13:27:45eric.araujosetnosy: tarek, eric.araujo, ysj.ray, AlexanderDreyer, Michael.Brickenstein
messages: + msg131648
2011-03-21 08:18:09AlexanderDreyersetnosy: tarek, eric.araujo, ysj.ray, AlexanderDreyer, Michael.Brickenstein
messages: + msg131620
2011-03-21 00:34:51eric.araujosetnosy: tarek, eric.araujo, ysj.ray, AlexanderDreyer, Michael.Brickenstein
messages: + msg131584
2010-09-30 08:28:33Michael.Brickensteinsetnosy: + Michael.Brickenstein
messages: + msg117708
2010-09-30 08:04:01AlexanderDreyersetmessages: + msg117707
2010-09-30 07:53:15AlexanderDreyersetmessages: + msg117704
2010-09-30 00:12:51eric.araujosetnosy: tarek, eric.araujo, ysj.ray, AlexanderDreyer
messages: + msg117678
components: - Distutils
versions: + 3rd party, - Python 3.2
2010-08-25 15:45:14eric.araujosetnosy: + eric.araujo
components: + Distutils2
2010-07-20 12:20:12BreamoreBoysetversions: + Python 3.2, - Python 2.5
2010-07-20 09:03:54AlexanderDreyersetmessages: + msg110879
2010-07-20 08:58:00ysj.raysetnosy: + ysj.ray
messages: + msg110878
2010-07-20 08:53:09AlexanderDreyersetfiles: -
2010-07-20 08:49:08AlexanderDreyersetmessages: + msg110877
2010-07-20 08:48:22AlexanderDreyersetfiles: +
2010-07-19 21:14:40AlexanderDreyercreate