distutils question->when do install, says header (.h) file is an unknown file type!?!?!

  • Thread starter Christian Seberino
  • Start date
C

Christian Seberino

I have a program that has Python and C code.

I added Extension stuff to setup.py and all .c and .h
files get into tarball fine.

(I have something like Extension("foo", glob.glob("bar/*.[ch]") )

When I try to INSTALL the package it says header (.h)
file is an unknown type. How fix this???

Chris
 
L

Lukasz Pankowski

I have a program that has Python and C code.

I added Extension stuff to setup.py and all .c and .h
files get into tarball fine.

(I have something like Extension("foo", glob.glob("bar/*.[ch]") )

When I try to INSTALL the package it says header (.h)
file is an unknown type. How fix this???

Chris

Do not include your header files in Extension (their not supported
there), if you want to distribute them with your extension, add them
to setup call, as in

setup(..., headers=['bcsim/bcsim.h'])

if you only need them to build your extension (for source
distributions and rpms) include them in MANIFEST.in instead.
 
D

David M. Cooke

At some point said:
I have a program that has Python and C code.

I added Extension stuff to setup.py and all .c and .h
files get into tarball fine.

(I have something like Extension("foo", glob.glob("bar/*.[ch]") )

When I try to INSTALL the package it says header (.h)
file is an unknown type. How fix this???

Chris

Do not include your header files in Extension (their not supported
there), if you want to distribute them with your extension, add them
to setup call, as in

setup(..., headers=['bcsim/bcsim.h'])

if you only need them to build your extension (for source
distributions and rpms) include them in MANIFEST.in instead.

distutils now supports (as of 2.3) the depends= keyword in Extension,
which adds more make-like functionality: Extension("foo",
['bar/bar.c'], depends=['bar/bar.h']) will cause the foo module to be
rebuilt if bar/bar.h changes.

I think what the OP wants is for his .h files to be included in the
source distribution. setup(..., headers=[...]) won't do that; you'll
still have to add them to the MANIFEST.in.

When in doubt whether it will be packaged, add it to MANIFEST.in.
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top