Issue 9309: Add environment variable complementing command line option -no-user-cfg (original) (raw)

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

Files
File name Uploaded Description Edit
dist.py.patch AlexanderDreyer,2010-07-20 08:48 better patch for distutils/dist.py
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 setup.py install programs of several python-based tools pick the prefix-setting from ~/.pydistutils.cfg. http://trac.sagemath.org/sage_trac/ticket/9536 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 (http://www.sagemath.org) 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, Alexander
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: http://wiki.pylonshq.com/display/pylonscookbook/Using+a+Virtualenv+Sandbox cite: --- 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 https://github.com/pypa/virtualenv/issues/88 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.
History
Date User Action Args
2022-04-11 14:57:04 admin set github: 53555
2014-03-13 10:48:46 eric.araujo set status: open -> closedstage: resolvedresolution: rejectedcomponents: + Distutils, - Distutils2versions: - 3rd party
2011-03-21 13:27:45 eric.araujo set nosy:tarek, eric.araujo, ysj.ray, AlexanderDreyer, Michael.Brickensteinmessages: +
2011-03-21 08🔞09 AlexanderDreyer set nosy:tarek, eric.araujo, ysj.ray, AlexanderDreyer, Michael.Brickensteinmessages: +
2011-03-21 00:34:51 eric.araujo set nosy:tarek, eric.araujo, ysj.ray, AlexanderDreyer, Michael.Brickensteinmessages: +
2010-09-30 08:28:33 Michael.Brickenstein set nosy: + Michael.Brickensteinmessages: +
2010-09-30 08:04:01 AlexanderDreyer set messages: +
2010-09-30 07:53:15 AlexanderDreyer set messages: +
2010-09-30 00:12:51 eric.araujo set nosy:tarek, eric.araujo, ysj.ray, AlexanderDreyermessages: + components: - Distutilsversions: + 3rd party, - Python 3.2
2010-08-25 15:45:14 eric.araujo set nosy: + eric.araujocomponents: + Distutils2
2010-07-20 12:20:12 BreamoreBoy set versions: + Python 3.2, - Python 2.5
2010-07-20 09:03:54 AlexanderDreyer set messages: +
2010-07-20 08:58:00 ysj.ray set nosy: + ysj.raymessages: +
2010-07-20 08:53:09 AlexanderDreyer set files: - dist.py.patch
2010-07-20 08:49:08 AlexanderDreyer set messages: +
2010-07-20 08:48:22 AlexanderDreyer set files: + dist.py.patch
2010-07-19 21:14:40 AlexanderDreyer create