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.

classification
Title: test_distutils fails on 2.6.5rc1: "No module named setuptools_build_ext"
Type: Stage:
Components: Distutils Versions: Python 2.6
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: tarek Nosy List: barry, loewis, ned.deily, ronaldoussoren, tarek
Priority: high Keywords:

Created on 2010-03-09 20:26 by ned.deily, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (9)
msg100743 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-03-09 20:26
Current 2.6.5rc1+ building on OS X:

======================================================================
ERROR: test_setuptools_compat (distutils.tests.test_build_ext.BuildExtTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/tests/test_build_ext.py", line 350, in test_setuptools_compat
    from setuptools_build_ext import build_ext as setuptools_build_ext
ImportError: No module named setuptools_build_ext

----------------------------------------------------------------------
msg100744 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-03-09 20:28
(I should add that this appears to be simply a missing test file.  There is no indication that distutils itself has a problem.)
msg100746 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2010-03-09 20:36
This file was added in r75256. Are you sure you miss that test file ?
msg100754 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-03-09 20:52
The file is the source tree but it doesn't seem to get installed in the framework which is where the tests are being run from:

/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/tests$ ls -l setuptools*
-rw-rw-r--  1 root  admin  1592 Mar  9 11:27 setuptools_extension.py
-rw-rw-r--  1 root  admin  2385 Mar  9 11:39 setuptools_extension.pyc
-rw-rw-r--  1 root  admin  2385 Mar  9 11:39 setuptools_extension.pyo
msg100972 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2010-03-12 21:23
Ok so, this file is lost during the installation process only for the Mac OS X install it seems. I need to dig into the Mac OS X build process.

If I "./configure && make && make install" with the 2.6.5rc+ tarball, 
the files are properly copied.

Btw, how do you run the tests exactly Ned ?

$ python2.6 test/regrtest.py -v test_distutils
msg100986 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-03-13 03:12
You are correct: setuptools_build_ext.py should have been there.  It turns out the file was missing in my installer builds due to a combination of issues summarized below.  The bottom line is that this is not a problem for 2.6.5 and my apologies for causing extra work for you, Tarek.  On the plus side, there was some good in all this by causing me to find a couple of serious flaws in my testing process and in the current hg support.

The rest of the story: to manage patches, I use hg on top of svn mirrors of the various source trees.  hg supports use of a top-level .hgignore file to specify files to ignore for revision control.  There is an .hgignore file checked into the svn trees but it turns out to have at least one subtly incorrect entry in it which causes hg to ignore all files with "build" anywhere in their names.  As a result, "setuptools_build_ext.py" has not been carried along into builds in my build process and I haven't noticed it up to now.
   -> After further investigation, I will open a new issue for the faulty .hgignore files.
   -> I'll add some auditing checks to my build process to make sure files aren't being unexpectedly ignored.

For future reference, testing the tests requires an OS X framework build.  The tests themselves are installed into the lib directory of the framework:
{...}Library/Frameworks/Python.framework/Versions/m.n/lib/pythonm.n/distutils/tests/

If you do not want to disturb an existing framework installation (in /Library/Frameworks/Python.frameworks), you can try something like this:

# using the Python-2.6.5rc2 tarball
$ ./configure --enable-framework=/tmp/x/Library/Frameworks && make && make install
#   ... ignore frameworkinstallapps permission errors 
$ cd /tmp/x/Library/Frameworks/Python.framework/Versions/2.6
$ bin/python2.6 -m test.regrtest -v test_distutils
test_distutils
test_build_ext: Cannot find source code (test must run in python build dir)
test_get_exe_bytes (distutils.tests.test_bdist_wininst.BuildWinInstTestCase) ... ok
test_dont_write_bytecode (distutils.tests.test_build_py.BuildPyTestCase) ... ok
[...]

Due to the problem documented in Issue8107, the rest of the test is skipped.  (In the original report, the OS X installer builds use separate source and build directories and the build directory is usually still around when the tests are run, so the xxconfig.c *was* found and the test suite was attempted resulting in the reported error - another process issue for me.)  If I copy in the two updated files (test_build_ext.py and xxmodule.c) from r78877, test_build_ext now completes as expected:

$ bin/python2.6 -m test.regrtest -v test_distutils
test_get_exe_bytes (distutils.tests.test_bdist_wininst.BuildWinInstTestCase) ... ok
test_build_ext (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_build_ext_inplace (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_build_ext_path_cross_platform (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_build_ext_path_with_os_sep (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_check_extensions_list (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_compiler_option (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_ext_fullpath (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_finalize_options (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_get_outputs (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_get_source_files (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_setuptools_compat (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_solaris_enable_shared (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_dont_write_bytecode (distutils.tests.test_build_py.BuildPyTestCase) ... ok
[...]
msg101016 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2010-03-13 18:53
ok thanks for the tests Neal.

Martin, do I have to do soemthing in msi.py to see this file included ? (I am looking at msi.py right now and it looks like it has the proper glob, but I want to be 100% sure)

Ronald, what about the Mac OS scripts ?
msg101017 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-03-13 19:36
Tarek, in general, if you want a new file in Lib included, create a bug report and assign it to me.
msg101023 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2010-03-13 21:02
Ok I see. Good to know thx
History
Date User Action Args
2022-04-11 14:56:58adminsetgithub: 52349
2010-03-13 21:02:00tareksetmessages: + msg101023
2010-03-13 19:36:17loewissetmessages: + msg101017
2010-03-13 18:53:11tareksetnosy: + loewis
messages: + msg101016
2010-03-13 03:12:10ned.deilysetstatus: open -> closed

messages: + msg100986
2010-03-12 21:23:41tareksetpriority: release blocker -> high
nosy: + ronaldoussoren
messages: + msg100972

2010-03-12 19:40:17barrysetpriority: high -> release blocker
2010-03-09 20:52:11ned.deilysetmessages: + msg100754
2010-03-09 20:36:46tareksetpriority: high

messages: + msg100746
2010-03-09 20:28:03ned.deilysetmessages: + msg100744
2010-03-09 20:26:32ned.deilycreate