Distutil question

S

Steve Menard

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="(e-mail address removed)",
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
 
C

Chris Green

Steve Menard said:
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.
 
S

Steve Menard

Chris said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top