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: Document that distutils doesn't support out-of-source builds
Type: enhancement Stage: resolved
Components: Distutils, Documentation Versions: Python 3.4, Python 3.5, Python 2.7
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: Arfrever, albamagallanes, anacrolix, eric.araujo, rpetrov, sdirector, steve.dower, tarek
Priority: normal Keywords: easy, patch

Created on 2008-01-22 00:31 by sdirector, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
distutils.patch sdirector, 2008-01-22 00:31 Patch implementing --src-dir
bug1887.path albamagallanes, 2014-03-18 22:26 patch for bug1887 review
bug1887_2.patch albamagallanes, 2014-04-08 02:31 patch for bug1887 version 2 review
Messages (13)
msg61471 - (view) Author: Monty Taylor (sdirector) Date: 2008-01-22 00:31
I've been using distutils as part of a larger automake-managed project.
One of the functions that automake provides is "make distcheck" which it
has been especially hard to get distutils to play along with. 

So I added a src-dir option to allow for passing src dir to the build.
msg82268 - (view) Author: Roumen Petrov (rpetrov) * Date: 2009-02-16 20:26
Some other issues supersede this one ... and commits from Neil
Schemenauer resolve this issue may be only for me :).
Please see as example issue4151 .
msg109822 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-07-10 06:23
Roumen's comments suggest that this should be closed.
Monty, do you disagree?
msg116935 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-09-20 13:45
There's been no reply to msg109822, so should this be closed with the Superseder field updated or what?
msg116961 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-09-20 18:49
I suspect so, but I leave it to Eric to decide.
msg116999 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-09-20 23:03
#4151 and friends were about building Python, this is about building Python projects with distutils.  As a feature request, I’m reassigning to distutils2.

Monty: Would you like to update your patch?  distutils is frozen except for bug fixes, we work on the next gen in parallel.  See for developer resources and link to our repository.
msg117001 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-09-20 23:11
Let me add that distutils very much wants you to run the setup script from its parent directory, contrary to autotools which can run from another directory, so it could be that other parts than build* commands are affected.

That said, specifying the target build dir is supported; in other words, don’t run “../ build --src-dir=..” but try “./ build --build-dir some/where”.

I still have to do a bit of research about make distclean.  Some options like build_ext.inplace are not affected by build-dir, so distclean is not as easy as “rm -rf $build_dir”.
msg213457 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2014-03-13 20:23
distutils2 is no more.

Paths handling in distutils is fragile, so I’m changing this to a doc issue: we should make it clear that only “cd path/to/project; python command” is expected to work.
msg214031 - (view) Author: Alba Magallanes (albamagallanes) Date: 2014-03-18 22:26
I'm updating a patch for this bug, Could you please review it?
I think it was appropriate to clarify the use of the script at the Introduction to Distutils documentation ( in the simple example explanation part, which explains that can be run multiple times, etc.
msg214058 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2014-03-19 06:33
Thanks for the patch.  I did a review, you should have got an email; if not, follow the “review” link on the right of your patch in the list of files near the top of this page.
msg214105 - (view) Author: Alba Magallanes (albamagallanes) Date: 2014-03-19 15:43
Eric Thanks for the review :) I'll follow your advice
Thanks !

On Wed, Mar 19, 2014 at 12:33 AM, Éric Araujo <>wrote:

> Éric Araujo added the comment:
> Thanks for the patch.  I did a review, you should have got an email; if
> not, follow the "review" link on the right of your patch in the list of
> files near the top of this page.
> ----------
> components: +Documentation
> versions: +Python 3.5 -Python 3.3
> _______________________________________
> Python tracker <>
> <>
> _______________________________________
msg215723 - (view) Author: Alba Magallanes (albamagallanes) Date: 2014-04-08 02:31
hi, here is a second version of the patch. Please review it.
msg386405 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:29
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at
Date User Action Args
2022-04-11 14:56:30adminsetgithub: 46195
2021-02-03 18:29:03steve.dowersetstatus: open -> closed

nosy: + steve.dower
messages: + msg386405

resolution: out of date
stage: needs patch -> resolved
2014-04-08 02:31:55albamagallanessetfiles: + bug1887_2.patch
keywords: + patch
messages: + msg215723
2014-03-19 15:43:48albamagallanessetmessages: + msg214105
2014-03-19 06:33:18eric.araujosetmessages: + msg214058
components: + Documentation
versions: + Python 3.5, - Python 3.3
2014-03-18 22:26:25albamagallanessetfiles: + bug1887.path
nosy: + albamagallanes
messages: + msg214031

2014-03-13 20:23:28eric.araujosetkeywords: + easy, - patch
2014-03-13 20:23:00eric.araujosetversions: + Python 2.7, Python 3.3, Python 3.4, - 3rd party
title: distutils doesn't support out-of-source builds -> Document that distutils doesn't support out-of-source builds
messages: + msg213457

assignee: tarek -> eric.araujo
components: + Distutils, - Distutils2
stage: needs patch
2014-02-03 15:49:49BreamoreBoysetnosy: - BreamoreBoy
2013-10-25 22:36:48Arfreversetnosy: + Arfrever
2011-10-04 03:01:44anacrolixsetnosy: + anacrolix
2010-09-29 23:46:21eric.araujosetversions: + 3rd party, - Python 2.6, Python 2.5, Python 3.1, Python 2.7, Python 3.2
2010-09-20 23:11:34eric.araujosetmessages: + msg117001
2010-09-20 23:03:30eric.araujosetnosy: sdirector, tarek, eric.araujo, rpetrov, BreamoreBoy
messages: + msg116999
components: + Distutils2, - Build, Distutils
versions: + Python 2.6, Python 2.5, Python 3.1, Python 2.7
2010-09-20 18:49:50terry.reedysetnosy: - terry.reedy
2010-09-20 18:49:35terry.reedysetmessages: + msg116961
2010-09-20 13:45:16BreamoreBoysetnosy: + BreamoreBoy, eric.araujo
messages: + msg116935
2010-07-10 06:23:41terry.reedysetnosy: + terry.reedy

messages: + msg109822
versions: + Python 3.2, - Python 2.6
2009-02-16 20:26:20rpetrovsetnosy: + rpetrov
messages: + msg82268
2009-02-16 16:30:45akitadasetnosy: + tarek
components: + Build
assignee: tarek
2008-01-22 00:57:14christian.heimessetpriority: normal
keywords: + patch
type: enhancement
versions: + Python 2.6, - Python 2.5
2008-01-22 00:31:57sdirectorcreate