[Distutils] How can I get setuptools to include files beyond what find_packages() finds?

Stanley A. Klein sklein at cpcug.org
Tue Jul 31 23:16:08 CEST 2007


Robert Kern wrote:
Stanley A. Klein wrote:

>> I tried to do something to fix the numpy distutils bdist_rpm.py (by
>> trying to follow what was done in install.py) but it didn't work and I
>> got an error message I didn't understand.

>I'd like to help, but if you don't copy the exact error message here, I
can't.

OK, here is my revised numpy/distutils/commands/bdist_rpm.py (trying --
obviously not well -- to follow what was done in
numpy/distutils/commands/install.py:

import os
import sys

if 'setuptools' in sys.modules:
    import setuptools.command.bdist_rpm as old_bdist_rpm
    class bdist_rpm(old_bdist_rpm):
        pass

else:
    from distutils.command.bdist_rpm import bdist_rpm as old_bdist_rpm

    class bdist_rpm(old_bdist_rpm):

        def _make_spec_file(self):
            spec_file = old_bdist_rpm._make_spec_file(self)

            # Replace hardcoded setup.py script name
            # with the real setup script name.
            setup_py = os.path.basename(sys.argv[0])
            if setup_py == 'setup.py':
                return spec_file
            new_spec_file = []
            for line in spec_file:
                line = line.replace('setup.py',setup_py)
                new_spec_file.append(line)
            return new_spec_file

And here is the error message I got (using the kiva setup.py):

[stan at localhost enthought.kiva_2.0]$ python setup.py bdist_rpm
Traceback (most recent call last):
  File "setup.py", line 2, in ?
    from numpy.distutils.core import setup
  File "/usr/lib/python2.4/site-packages/numpy/distutils/core.py", line
32, in ?    from numpy.distutils.command import bdist_rpm
  File
"/usr/lib/python2.4/site-packages/numpy/distutils/command/bdist_rpm.py",
line 6, in ?
    class bdist_rpm(old_bdist_rpm):
TypeError: Error when calling the metaclass bases
    module.__init__() takes at most 2 arguments (3 given)

BTW, below is what the unpackaged files error looks like (with a traceback
generated by having the DISTUTILS_DEBUG environment variable set).  In a
much earlier thread I learned that this can usually be resolved by setting
[install] optimize=1 in setup.cfg.
---------------------------------------------------------------------------
    Installed (but unpackaged) file(s) found:
   /usr/lib/python2.4/site-packages/enthought/__init__.pyc
   /usr/lib/python2.4/site-packages/enthought/__init__.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/benchmark.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/benchmark.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/conv.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/conv.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/dash.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/dash.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/lion.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/lion.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/lion_data.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/lion_data.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/polygon_hit_test.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/polygon_hit_test.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/rect.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/rect.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/simple.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/simple.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/simple2.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/simple2.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/simple_clip.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/simple_clip.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/star.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/star.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/star1.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/star1.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/star2.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/star2.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/star_path.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/star_path.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/sub_path.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/sub_path.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/text_ex.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/text_ex.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/tk_ex.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/tk_ex.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/wx_brain.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/wx_brain.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/wx_demo.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/wx_demo.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/wx_image_copy.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/wx_image_copy.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/wx_lines.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/wx_lines.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/wx_lion.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/examples/wx_lion.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/affine_matrix_test_case.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/affine_matrix_test_case.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/clip_to_rect_test_case.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/clip_to_rect_test_case.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/compiled_path_test_case.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/compiled_path_test_case.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/gcmemtest.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/gcmemtest.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/graphics_context_test_case.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/graphics_context_test_case.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/image_test_case.pyc
 
/usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/image_test_case.pyo
 
/usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/join_stroke_path_test_case.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/join_stroke_path_test_case.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/points_in_polygon_test_case.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/points_in_polygon_test_case.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/rgba_test_case.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/rgba_test_case.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/stroke_path_test_case.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/stroke_path_test_case.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/test_arc.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/test_arc.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/test_draw_dash.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/test_draw_dash.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/test_ft.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/test_ft.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/test_graphics_context_system.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/test_graphics_context_system.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/test_image3.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/test_image3.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/test_save.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/test_save.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/test_utils.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/test_utils.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/unicode_font_test_case.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/agg/tests/unicode_font_test_case.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/tests/affine_test_case.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/tests/affine_test_case.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/tests/basecore2d_test_case.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/tests/basecore2d_test_case.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/tests/mac_simpletest.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/tests/mac_simpletest.pyo
   /usr/lib/python2.4/site-packages/enthought/kiva/tests/macport_test.pyc
   /usr/lib/python2.4/site-packages/enthought/kiva/tests/macport_test.pyo
Traceback (most recent call last):
  File "setup.py", line 108, in ?
    version = '2.0b1',
  File "/usr/lib/python2.4/site-packages/numpy/distutils/core.py", line
174, in setup
    return old_setup(**new_attr)
  File "/usr/lib/python2.4/distutils/core.py", line 149, in setup
    dist.run_commands()
  File "/usr/lib/python2.4/distutils/dist.py", line 946, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.4/distutils/command/bdist_rpm.py", line 365, in run
    self.spawn(rpm_cmd)
  File "/usr/lib/python2.4/distutils/cmd.py", line 398, in spawn
    spawn(cmd, search_path, dry_run= self.dry_run)
  File "/usr/lib/python2.4/distutils/spawn.py", line 37, in spawn
    _spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/usr/lib/python2.4/distutils/spawn.py", line 165, in _spawn_posix
    raise DistutilsExecError, \
distutils.errors.DistutilsExecError: command 'rpmbuild' failed with exit
status 1


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/distutils-sig/attachments/20070731/ce4bc621/attachment.htm 


More information about the Distutils-SIG mailing list