Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_distutils fails on 2.6.5rc1: "No module named setuptools_build_ext" #52349

Closed
ned-deily opened this issue Mar 9, 2010 · 9 comments
Closed
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@ned-deily
Copy link
Member

BPO 8102
Nosy @loewis, @warsaw, @ronaldoussoren, @tarekziade, @ned-deily

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/tarekziade'
closed_at = <Date 2010-03-13.03:12:10.893>
created_at = <Date 2010-03-09.20:26:32.608>
labels = ['library']
title = 'test_distutils fails on 2.6.5rc1: "No module named setuptools_build_ext"'
updated_at = <Date 2010-03-13.21:02:00.459>
user = 'https://github.com/ned-deily'

bugs.python.org fields:

activity = <Date 2010-03-13.21:02:00.459>
actor = 'tarek'
assignee = 'tarek'
closed = True
closed_date = <Date 2010-03-13.03:12:10.893>
closer = 'ned.deily'
components = ['Distutils']
creation = <Date 2010-03-09.20:26:32.608>
creator = 'ned.deily'
dependencies = []
files = []
hgrepos = []
issue_num = 8102
keywords = []
message_count = 9.0
messages = ['100743', '100744', '100746', '100754', '100972', '100986', '101016', '101017', '101023']
nosy_count = 5.0
nosy_names = ['loewis', 'barry', 'ronaldoussoren', 'tarek', 'ned.deily']
pr_nums = []
priority = 'high'
resolution = None
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue8102'
versions = ['Python 2.6']

@ned-deily
Copy link
Member Author

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

@ned-deily ned-deily added the stdlib Python modules in the Lib dir label Mar 9, 2010
@ned-deily
Copy link
Member Author

(I should add that this appears to be simply a missing test file. There is no indication that distutils itself has a problem.)

@tarekziade
Copy link
Mannequin

tarekziade mannequin commented Mar 9, 2010

This file was added in r75256. Are you sure you miss that test file ?

@ned-deily
Copy link
Member Author

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

@tarekziade
Copy link
Mannequin

tarekziade mannequin commented Mar 12, 2010

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

@tarekziade tarekziade mannequin removed the release-blocker label Mar 12, 2010
@ned-deily
Copy link
Member Author

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 bpo-8107, 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
[...]

@tarekziade
Copy link
Mannequin

tarekziade mannequin commented Mar 13, 2010

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 ?

@loewis
Copy link
Mannequin

loewis mannequin commented Mar 13, 2010

Tarek, in general, if you want a new file in Lib included, create a bug report and assign it to me.

@tarekziade
Copy link
Mannequin

tarekziade mannequin commented Mar 13, 2010

Ok I see. Good to know thx

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

2 participants