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.
Created on 2007年09月19日 19:58 by hoffman, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| python_distutils_1180.patch | slinkp, 2008年04月27日 17:54 | patch with monkeypatches in setup/teardown | ||
| python_distutils_1180_2.patch | slinkp, 2008年04月27日 17:55 | patch using dependency injection | ||
| python_distutils_1180_3.patch | slinkp, 2008年04月28日 14:33 | patch w/ monkeypatches in setup, simplified | ||
| 3.4-patch.txt | akuchling, 2013年11月10日 23:11 | review | ||
| Messages (29) | |||
|---|---|---|---|
| msg56044 - (view) | Author: Michael Hoffman (hoffman) | Date: 2007年09月19日 20:00 | |
It would be useful if setup.py instances had an option to ignore ~/.pydistutils.cfg or substitute it with another file. For example, this would be highly useful to people who maintain a system site-packages directory along with one in their own home directory. |
|||
| msg63685 - (view) | Author: Paul Winkler (slinkp) * | Date: 2008年03月17日 17:29 | |
I'm working on this (at the pycon sprint). |
|||
| msg64041 - (view) | Author: Paul Winkler (slinkp) * | Date: 2008年03月19日 05:16 | |
The attached patch implements a command-line option to disable loading of $HOME/.pydistutils.cfg. After talking to Martin Loewis, I decided not to implement the override part, because if it's a one-time thing you can just pass the settings on the command line; and if you have two configurations you want to use frequently, you can just use two user accounts. The hard part was writing tests, since the existing code was untested and is environment-sensitive. See the comments in the patch re. what I still don't like about it. I would like to have a less evil test setup and teardown, but I'm going on vacation tomorrow so I won't be able to look at this again until April. |
|||
| msg64047 - (view) | Author: Michael Hoffman (hoffman) | Date: 2008年03月19日 07:39 | |
That is up to you of course, and being able to ignore is better than nothing. But creating a new account is not really an option for everyone. On the system I would like to use this feature the most, I am not a system administrator, so I cannot create new user accounts. I maintain a directory for production use of people in my workgroup. I also maintain my own for testing and development. Thanks for your work on this patch. At least being able to use --no-user-cfg will be very helpful. |
|||
| msg64054 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2008年03月19日 13:12 | |
We thought that the added value for specifying another configuration file is relatively minor: if you have to set command line options anyway, just put anything you want to specify on the command line, rather than into the other configuration file. Out of curiosity: what kinds of settings do you put into the configuration file? |
|||
| msg64056 - (view) | Author: Michael Hoffman (hoffman) | Date: 2008年03月19日 14:06 | |
Here's an example of a configuration file I use: ==== [build_ext] include_dirs = /nfs/acari/mh5/include/python2.5:/nfs/acari/mh5/include [install] prefix = ~ exec_prefix = ~/arch/$ARCH install_platlib = $platbase/lib/python$py_version_short install_purelib = $base/lib/python$py_version_short install_scripts = $platbase/bin [easy_install] install_dir = $platbase/lib/python$py_version_short script_dir = $platbase/bin ==== I am installing software on a filesystem that is shared between different architectures (i386 and x86_64), so I must have separate directories for extensions on each platform. Because of this, using --home=~ doesn't cut it. I don't want to be a pain, if the --no-user-cfg can go in sooner, that would be very helpful. |
|||
| msg65783 - (view) | Author: Paul Winkler (slinkp) * | Date: 2008年04月25日 14:16 | |
Here's an alternate patch that uses a bit of dependency injection to avoid the need for monkeypatches in setup/teardown. This means some trivial changes to Distribution.__init__(). I slightly prefer this approach, but some might argue it's an example of "test logic in production". I also added a line about the new option in Doc/install/index.rst. Since I don't have checkin privileges, I will stop here. Can somebody upstream (Martin?) please take one of these patches and apply it? Or suggest further changes to either of these patches? Or ... ? Thanks. |
|||
| msg65854 - (view) | Author: PJ Eby (pje) * (Python committer) | Date: 2008年04月26日 21:09 | |
Both versions of the patch have a problem, in that the Distribution object is looking for an option directly in sys.argv. At the very least, this should be looking at the 'script_args' attribute of the Distribution instead (if not actually parsing the command line enough to find the option). |
|||
| msg65886 - (view) | Author: Paul Winkler (slinkp) * | Date: 2008年04月27日 17:53 | |
Phillip, thanks, I missed that script_args is always passed by core.setup(). I'm replacing the patches with two new versions that check self.script_args instead of sys.argv (and assumes false if for some reason script_args isn't passed). We can't check for it in Distribution.parse_command_line() because that doesn't get called until after loading the config files. |
|||
| msg65887 - (view) | Author: Paul Winkler (slinkp) * | Date: 2008年04月27日 17:55 | |
and here's the revised version of the dependency-injection approach. |
|||
| msg65891 - (view) | Author: PJ Eby (pje) * (Python committer) | Date: 2008年04月27日 18:25 | |
I much prefer the simpler of the two patches - better to monkeypatch in the tests than adding complications to the already over-complicated distutils.dist. I don't find monkeypatching in tests to be horrible at all, but if it really bothers you, just create a temporary directory for HOME to point to, and test a Distribution subclass with an overridden check_environ. By the way, the patch could be simpler if you just made the "if 'HOME' in os.environ" read "if not self.no_user_cfg and 'HOME' in os.environ", rather than reworking the entire code region. On the other hand, if you'd rather have ultra-clean unit tests, you could split the functionality of find_config_files() into two methods: one that creates the candidate list and the other that filters it by existence. Personally, my vote is to keep the monkeypatching in the tests and make the barest minimal changes to the Distribution class though. |
|||
| msg65920 - (view) | Author: Paul Winkler (slinkp) * | Date: 2008年04月28日 14:33 | |
Phillip, here's another revision of the monkeypatch-in-setUp() approach, simplified per your suggestions. |
|||
| msg65921 - (view) | Author: PJ Eby (pje) * (Python committer) | Date: 2008年04月28日 15:49 | |
It looks like you can drop the change to distutils.core, too, since it's just a change in the comment, and the changed comment is inaccurate, AFAICT. Apart from that, it looks good. |
|||
| msg65955 - (view) | Author: Paul Winkler (slinkp) * | Date: 2008年04月29日 04:06 | |
In what way is the comment in core.py inaccurate? I only added the phrase "and override config files", which is an important side effect of parse_command_line(). |
|||
| msg65967 - (view) | Author: PJ Eby (pje) * (Python committer) | Date: 2008年04月29日 13:58 | |
Oh, I thought you meant that it overrides *which* config files -- i.e., implied that it was handling --no-user-config. |
|||
| msg68739 - (view) | Author: Peter Fein (pfein) | Date: 2008年06月25日 17:47 | |
Is this going to make the 2.6 release? The lack of this option causes grief on MacPorts. Just wondering if there's anything I could do to move this along, as a cursory reading shows everyone to be happy... |
|||
| msg68755 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2008年06月25日 20:29 | |
Formally, the beta deadline has passed, so no new features can be admitted. If pje is now happy with the code as it stands (not clear from the last message), I can ask for permission to commit it, anyway. |
|||
| msg68761 - (view) | Author: PJ Eby (pje) * (Python committer) | Date: 2008年06月25日 21:56 | |
I'm good with it; the issue with the comment in core.py was my only remaining objection. |
|||
| msg77386 - (view) | Author: Paul Winkler (slinkp) * | Date: 2008年12月09日 02:12 | |
Whatever happened with this? I don't see it mentioned in the NEWS file for the 2.6 line. |
|||
| msg77466 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2008年12月09日 22:35 | |
Unfortunately, it missed the deadlines (i.e. nobody checked it in in time). I'll look into it. |
|||
| msg80655 - (view) | Author: Akira Kitada (akitada) * | Date: 2009年01月27日 16:31 | |
Any update? Is this patch going to be included in 2.6.x/3.0.x in near future? |
|||
| msg87645 - (view) | Author: Tarek Ziadé (tarek) * (Python committer) | Date: 2009年05月12日 17:22 | |
I am taking over this issue (I am figuring out you are OK with this Martin) and put it in my work pile so it goes in 2.7 |
|||
| msg94585 - (view) | Author: Tarek Ziadé (tarek) * (Python committer) | Date: 2009年10月27日 23:15 | |
I've simplified the tests so they just check that [.]pydistutils.cfg is taken or not taken, depending if the option is used. I've also made sure the option is just looked in the global options, because the patch was implying that a command local option with the same name could work. Done in r75893 and r75895. Thanks a lot Paul ! |
|||
| msg176439 - (view) | Author: Andrew McNabb (amcnabb) | Date: 2012年11月26日 19:05 | |
The --no-user-cfg option works for me in Python 2.7, but it does not seem to be in Python 3.2 or 3.3: error: option --no-user-cfg not recognized Am I doing something wrong, or was this feature only added to Python 2.7? |
|||
| msg178376 - (view) | Author: Ned Deily (ned.deily) * (Python committer) | Date: 2012年12月28日 09:29 | |
Andrew, comments to closed issues are usually ignored. I suggest you open a new issue about this. A quick glance suggests that the code for this feature is not in Python 3. It may be that it was lost when, during the 2.7 development cycle, it was decided to not allow new features to Distutils and a number of changes were reverted. There have been some other cases of Distutils changes that were lost in Python 3.2+ because of this. |
|||
| msg202577 - (view) | Author: Jason R. Coombs (jaraco) * (Python committer) | Date: 2013年11月10日 21:50 | |
Confirmed - and to be included in issue19544. |
|||
| msg202583 - (view) | Author: A.M. Kuchling (akuchling) * (Python committer) | Date: 2013年11月10日 23:11 | |
Here's a patch to restore the --no-user-cfg switch to 3.4. If someone will take a quick look at the patch for sanity, I can apply it. |
|||
| msg202947 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2013年11月15日 12:37 | |
Patch looks good to me. |
|||
| msg202980 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2013年11月15日 23:57 | |
New changeset c35311fcc967 by Andrew Kuchling in branch 'default': Issue #19544 and Issue #1180: Restore global option to ignore ~/.pydistutils.cfg in Distutils, accidentally removed in backout of distutils2 changes. http://hg.python.org/cpython/rev/c35311fcc967 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:27 | admin | set | github: 45521 |
| 2013年11月16日 00:00:20 | jaraco | set | status: open -> closed |
| 2013年11月15日 23:57:08 | python-dev | set | nosy:
+ python-dev messages: + msg202980 |
| 2013年11月15日 18:08:37 | jaraco | set | assignee: akuchling -> jaraco |
| 2013年11月15日 12:37:09 | ncoghlan | set | nosy:
+ ncoghlan messages: + msg202947 |
| 2013年11月10日 23:11:07 | akuchling | set | files:
+ 3.4-patch.txt versions: + Python 3.4, - Python 3.1, Python 2.7, Python 3.2 messages: + msg202583 keywords: + needs review resolution: fixed -> stage: patch review |
| 2013年11月10日 22:56:06 | jaraco | set | status: closed -> open |
| 2013年11月10日 22:55:39 | jaraco | set | assignee: tarek -> akuchling nosy: + akuchling |
| 2013年11月10日 21:50:54 | jaraco | set | nosy:
+ jaraco messages: + msg202577 |
| 2012年12月28日 09:29:02 | ned.deily | set | nosy:
+ ned.deily messages: + msg178376 |
| 2012年11月26日 19:05:09 | amcnabb | set | nosy:
+ amcnabb messages: + msg176439 |
| 2009年10月27日 23:15:33 | tarek | set | status: open -> closed resolution: accepted -> fixed messages: + msg94585 |
| 2009年09月17日 11:09:57 | tarek | set | priority: critical -> normal |
| 2009年09月17日 11:09:30 | tarek | set | resolution: accepted versions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6 |
| 2009年05月12日 17:22:26 | tarek | set | assignee: loewis -> tarek messages: + msg87645 |
| 2009年01月27日 16:31:34 | akitada | set | nosy:
+ tarek messages: + msg80655 |
| 2009年01月04日 20:24:09 | akitada | set | nosy: + akitada |
| 2008年12月09日 22:35:50 | loewis | set | priority: normal -> critical assignee: loewis messages: + msg77466 |
| 2008年12月09日 02:12:18 | slinkp | set | messages: + msg77386 |
| 2008年06月25日 21:56:42 | pje | set | messages: + msg68761 |
| 2008年06月25日 20:29:31 | loewis | set | messages: + msg68755 |
| 2008年06月25日 17:47:41 | pfein | set | nosy:
+ pfein messages: + msg68739 |
| 2008年04月29日 13:58:13 | pje | set | messages: + msg65967 |
| 2008年04月29日 04:06:12 | slinkp | set | messages: + msg65955 |
| 2008年04月28日 15:49:50 | pje | set | messages: + msg65921 |
| 2008年04月28日 14:33:32 | slinkp | set | files:
+ python_distutils_1180_3.patch messages: + msg65920 |
| 2008年04月27日 18:25:43 | pje | set | messages: + msg65891 |
| 2008年04月27日 17:55:35 | slinkp | set | files:
+ python_distutils_1180_2.patch messages: + msg65887 |
| 2008年04月27日 17:54:42 | slinkp | set | files: - python_distutils_1180.patch |
| 2008年04月27日 17:54:25 | slinkp | set | files:
+ python_distutils_1180.patch messages: + msg65886 |
| 2008年04月27日 17:15:34 | slinkp | set | files: - python_distutils_1180_2.patch |
| 2008年04月26日 21:09:38 | pje | set | nosy:
+ pje messages: + msg65854 |
| 2008年04月25日 14:16:56 | slinkp | set | files:
+ python_distutils_1180_2.patch messages: + msg65783 |
| 2008年03月19日 14:06:55 | hoffman | set | messages: + msg64056 |
| 2008年03月19日 13:12:28 | loewis | set | messages: + msg64054 |
| 2008年03月19日 07:39:32 | hoffman | set | messages: + msg64047 |
| 2008年03月19日 05:20:09 | slinkp | set | files: + python_distutils_1180.patch |
| 2008年03月19日 05:19:28 | slinkp | set | files: - python_distutils_1180.patch |
| 2008年03月19日 05:16:36 | slinkp | set | files:
+ python_distutils_1180.patch keywords: + patch messages: + msg64041 |
| 2008年03月18日 16:45:48 | slinkp | set | nosy: + loewis |
| 2008年03月17日 17:29:14 | slinkp | set | nosy:
+ slinkp messages: + msg63685 |
| 2008年01月12日 01:58:10 | christian.heimes | set | keywords: + easy |
| 2007年09月19日 20:14:03 | jafo | set | priority: normal |
| 2007年09月19日 20:00:26 | hoffman | set | title: Option to ignore ~/.pydistutils.cfg -> Option to ignore or substitute ~/.pydistutils.cfg |
| 2007年09月19日 20:00:08 | hoffman | set | nosy:
+ hoffman messages: + msg56044 |
| 2007年09月19日 19:58:22 | hoffman | create | |