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

Discussion in 'Python' started by Christian Seberino, Oct 9, 2003.

  1. 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
    Christian Seberino, Oct 9, 2003
    #1
    1. Advertising

  2. Re: distutils question->when do install, says header (.h) file isan unknown file type!?!?!

    (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 =*=
    Lukasz Pankowski, Oct 10, 2003
    #2
    1. Advertising

  3. Re: distutils question->when do install, says header (.h) file isan unknown file type!?!?!

    At some point, Lukasz Pankowski <> wrote:

    > (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
    David M. Cooke, Oct 10, 2003
    #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:
    1
    Views:
    505
    Luca Fini
    Oct 22, 2003
  2. timw.google
    Replies:
    1
    Views:
    511
    Serge Orlov
    May 11, 2006
  3. mlt
    Replies:
    2
    Views:
    810
    Jean-Marc Bourguet
    Jan 31, 2009
  4. Luis Alberto Zarrabeitia Gomez

    distutils, No module named numpy.distutils.fcompiler.conv_template

    Luis Alberto Zarrabeitia Gomez, Mar 30, 2009, in forum: Python
    Replies:
    0
    Views:
    1,284
    Luis Alberto Zarrabeitia Gomez
    Mar 30, 2009
  5. Vincent Arnoux
    Replies:
    1
    Views:
    231
    Arnaud Bergeron
    Aug 11, 2006
Loading...

Share This Page