By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,296 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,296 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
se******@spawar.navy.mil (Christian Seberino) writes:
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.

--

=*= Lukasz Pankowski =*=
Jul 18 '05 #2

P: n/a
At some point, Lukasz Pankowski <lu***@zamek.gda.pl> wrote:
se******@spawar.navy.mil (Christian Seberino) writes:
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.

--
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.