Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18293 > unrolled thread

Creating a binary only python distribution of a C extension module and including some additional python and c files in it

Started byakhilesh singhania <akhi3030@gmail.com>
First post2012-01-01 12:42 +0000
Last post2012-01-01 12:42 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Creating a binary only python distribution of a C extension module and including some additional python and c files in it akhilesh singhania <akhi3030@gmail.com> - 2012-01-01 12:42 +0000

#18293 — Creating a binary only python distribution of a C extension module and including some additional python and c files in it

Fromakhilesh singhania <akhi3030@gmail.com>
Date2012-01-01 12:42 +0000
SubjectCreating a binary only python distribution of a C extension module and including some additional python and c files in it
Message-ID<mailman.4290.1325421766.27778.python-list@python.org>
Hi,

I have a extension module in C which I want to distribute in binary
format, ideally an rpm. Additionally, I want to include some python
files (examples on how to use the extension module) and source for a
library the module dynamically links to (c,h, and make files).

How do I specify the example python file in setup.py so that it will
be included in the rpm?

If I specify it as scripts, I get the following error:

$ python setup.py bdist --format=rpm

 running build_scripts
 creating build/scripts-2.6
 error: file 'foo.py' does not exist
 error: Bad exit status from /var/tmp/rpm-tmp.yjws9x (%build)
If I specify it as data_files, I get the following error:

$ python setup.py bdist --format=rpm

 error: Installed (but unpackaged) file(s) found:
    /usr/foo.pyc
    /usr/foo.pyo
If I specify it as py_modules, I do not get errors but it is not
included in the resulting rpm.

Specifying it as a script works if I use

$ python setup.py bdist --format=gztar
Additionally, can I control the hierarchy of how the files are laid
out in the rpm?

Currently, I am specifying the c,h,make files as data_files and they
get placed in /usr, which is not desirable.

Regards,
akhi

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web