I finally got the kiva rpm to build using bdist_rpm
I finally got the kiva rpm to build. I also got the docs and examples into the proper doc directory. Here is what it took: First, run "python setup.py bdist_rpm", which will fail with a list of installed but unpackaged files. Somehow the full set of installed files isn't being recorded, probably because of some problem among numpy distutils, python distutils, setuptools, and Fedora rpm brp-python-bytecompile that isn't solved by the [install] optimize=1 option in setup.cfg (that works in most cases). Then create a file (I called it problem_files) with a list of the installed but unpackaged files. Also, create a new install script to be put into the rpm spec file that appends the problem file list to INSTALLED_FILES (where the installed files are recorded in the default spec file). Then run the setup with options that use the new install script. The rpm packaging of the docs files is just another option to the setup run. Below are the relevant scripts and files. I think I may still have a problem with the enthought namespace __init__.py and the nspkg.pth file that will presumably be fixed in an upcoming version of setuptools. BTW, I don't know what effect this has, but there are also __init__.pyc and __init__.pyo files packaged into the rpm with the namespace file. IIRC it may not be supposed to be there, but it got in somehow, probably because of the same problem that caused the installed files to be incorrectly recorded. Stan Klein ------------------------------------------------------------------------------------- The setup command line: python setup.py bdist_rpm --doc-files=" examples/ docs/ " --install=install_script2 install_script2 is: python setup.py install --single-version-externally-managed --root= $RPM_BUILD_ROOT --record=INSTALLED_FILES cat /home/stan/new-enthought-svn/enthought.branches/enthought.kiva_2.0/problem_files
INSTALLED_FILES
problem_files is: /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
At 12:30 PM 8/20/2007 -0400, Stanley A. Klein wrote:
problem_files is:
/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
Is kiva.agg.tests a package? If so, is it listed in setup()? If not, are the individual modules listed as modules to be installed? If these are just .py files, that would explain why they're not listed in INSTALLED_FILES.
The overall kiva package is built by a combination of numpy distutils and setuptools. There are multiple setup.py files involved because of the needs of numpy distutils for compiling the extensions. Somehow the setup() of the main setup.py is used by both numpy distutils and setuptools. The relevant import statements are import setuptools from numpy.distutils.core import setup The tests directory under kiva is referenced in the setup.py configuration() there as config.add_data_dir('tests'). There is a similar statement in the setup.py file under kiva/agg. I tried to move the "tests" directories under both kiva and kiva/agg to the top-level examples directory without doing an svn check-in. That didn't seem to work, I suppose because of setuptools svn awareness. I tried numerous other fixes, some that I came up with on my own and others suggested by Dave Peterson and this is the only one that ran to completion. However, I don't remember everything I tried. One thing I did try was an in-place build (using kivabuild.py that mainly uses numpy distutils) to get the extensions built and a relatively vanilla setup.py file with setuptools to do the install and packaging steps. That approach left the .so files missing from the package. If there is a cleaner way to do the rpm package for kiva, I would prefer to use it, but I haven't found one yet. I got the idea for this workaround approach from a posting somewhere by someone who had a similar problem with rpm packaging. Stan Klein On Mon, August 20, 2007 1:38 pm, Phillip J. Eby wrote:
At 12:30 PM 8/20/2007 -0400, Stanley A. Klein wrote:
problem_files is:
/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
Is kiva.agg.tests a package? If so, is it listed in setup()? If not, are the individual modules listed as modules to be installed?
If these are just .py files, that would explain why they're not listed in INSTALLED_FILES.
At 05:15 PM 8/20/2007 -0400, Stanley A. Klein wrote:
The overall kiva package is built by a combination of numpy distutils and setuptools. There are multiple setup.py files involved because of the needs of numpy distutils for compiling the extensions. Somehow the setup() of the main setup.py is used by both numpy distutils and setuptools. The relevant import statements are
import setuptools from numpy.distutils.core import setup
The tests directory under kiva is referenced in the setup.py configuration() there as config.add_data_dir('tests'). There is a similar statement in the setup.py file under kiva/agg.
Okay, that's why they're not working -- and it doesn't matter whether it's plain distutils, numpy distutils, or setuptools; their compiled forms won't be included in the installation manifest if you list them as data files, because none of those packages will *compile* the .py files -- only the Fedora bytecode compile thing will. The only workarounds I see are to: 1. Install them as legitimate modules, not data files, (in which case distutils/setuptools will compile them and list them in the manifest), OR: 2. Don't give them .py extensions -- they'll get listed, but not compiled by anything. These seem to be the only choices to work around the hostile bytecode compiler script in Fedora.
At 05:15 PM 8/20/2007 -0400, Stanley A. Klein wrote:
The overall kiva package is built by a combination of numpy distutils and setuptools. There are multiple setup.py files involved because of the needs of numpy distutils for compiling the extensions. Somehow the setup() of the main setup.py is used by both numpy distutils and setuptools. The relevant import statements are
import setuptools from numpy.distutils.core import setup
The tests directory under kiva is referenced in the setup.py configuration() there as config.add_data_dir('tests'). There is a similar statement in the setup.py file under kiva/agg.
Okay, that's why they're not working -- and it doesn't matter whether it's plain distutils, numpy distutils, or setuptools; their compiled
On Mon, 2007-08-20 at 18:47 -0400, Phillip J. Eby wrote: forms won't be included in the installation manifest if you list them as data files, because none of those packages will *compile* the .py files -- only the Fedora bytecode compile thing will.
The only workarounds I see are to:
1. Install them as legitimate modules, not data files, (in which case
distutils/setuptools will compile them and list them in the manifest),
OR:
2. Don't give them .py extensions -- they'll get listed, but not
compiled by anything.
These seem to be the only choices to work around the hostile bytecode
compiler script in Fedora. I tried your first "workaround" and it worked. :-) Dave Peterson had suggested commenting out config.add_data_dir('tests') in the two setup.py files or replacing it with config.add_subpackage('tests'). I thought I had tried both. Obviously, I had tried the first but not the second. :-( Thanks. Stan Klein
participants (2)
-
Phillip J. Eby
-
Stanley A. Klein