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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christian Seberino

    #1

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

    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
  • Lukasz Pankowski

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

    seberino@spawar .navy.mil (Christian Seberino) writes:
    [color=blue]
    > 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[/color]

    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 =*=

    Comment

    • David M. Cooke

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

      At some point, Lukasz Pankowski <lupan@zamek.gd a.pl> wrote:
      [color=blue]
      > seberino@spawar .navy.mil (Christian Seberino) writes:
      >[color=green]
      >> 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[/color]
      >
      > 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.[/color]

      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)phy sics(dot)mcmast er(dot)ca

      Comment

      Working...