Distutil question

Discussion in 'Python' started by Steve Menard, Jun 10, 2004.

  1. Steve Menard

    Steve Menard Guest

    I built a extension module that I'd like to distribute via distutil. It
    consists of a bunch of cpp and hpp files.

    my setup.py files looks like this :

    from distutils.core import setup, Extension
    import os, os.path

    cpp = []
    hpp = []
    for i in os.listdir("src/native"):
    if i[-4:] == '.cpp' :
    cpp.append( "src/native/"+i)
    elif i[-4:] == '.hpp' :
    hpp.append( "src/native/"+i)

    e = Extension("_jpype", cpp,
    include_dirs=[os.getenv("JAVA_HOME")+"/include",
    os.getenv("JAVA_HOME")+"/include/win32"] )

    setup(
    name="JPype",
    version="0.2.1p1",
    description="Python-Java bridge",
    author="Steve Menard",
    author_email="",
    url="http://jpype.sourceforge.net/",
    packages=["jpype"],
    package_dir={"jpype": "src/python/jpype"},
    ext_modules=[e]
    )

    now, if I add the hpp list to the extension sources, I get an error that
    it does not know what to do with the hpp files.

    How do I go about distributing those files so that a source dsitribution
    will compile properly? should I rename them to .h files instead?

    Thanks for your help,

    Steve
    Steve Menard, Jun 10, 2004
    #1
    1. Advertising

  2. Steve Menard

    Chris Green Guest

    Steve Menard <> writes:

    > How do I go about distributing those files so that a source
    > dsitribution will compile properly? should I rename them to .h files
    > instead?


    The way I always fix this type of thing is to create a MANIFEST.in
    and add

    recursive-include src *.hpp to it.
    --
    Chris Green <>
    Laugh and the world laughs with you, snore and you sleep alone.
    Chris Green, Jun 10, 2004
    #2
    1. Advertising

  3. Steve Menard

    Steve Menard Guest

    Chris Green wrote:
    > Steve Menard <> writes:
    >
    >
    >>How do I go about distributing those files so that a source
    >>dsitribution will compile properly? should I rename them to .h files
    >>instead?

    >
    >
    > The way I always fix this type of thing is to create a MANIFEST.in
    > and add
    >
    > recursive-include src *.hpp to it.


    Thanks man! that did it!

    Steve
    Steve Menard, Jun 10, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christian Seberino
    Replies:
    0
    Views:
    283
    Christian Seberino
    Oct 21, 2003
  2. Christian Seberino
    Replies:
    0
    Views:
    459
    Christian Seberino
    Oct 21, 2003
  3. Derek Croxton

    Distutil install problem

    Derek Croxton, Feb 21, 2004, in forum: Python
    Replies:
    0
    Views:
    351
    Derek Croxton
    Feb 21, 2004
  4. Holger Joukl
    Replies:
    0
    Views:
    297
    Holger Joukl
    Feb 23, 2004
  5. Jesper Olsen

    distutil and debugging

    Jesper Olsen, Jul 3, 2004, in forum: Python
    Replies:
    4
    Views:
    1,103
    Jesper Olsen
    Jul 4, 2004
Loading...

Share This Page