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


Groups > comp.lang.python > #18293

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

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-out2.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!feed.xsnews.nl!border-2.ams.xsnews.nl!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <akhi3030@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:module': 0.04; 'currently,': 0.07; 'desirable.': 0.07; 'specifying': 0.07; 'python': 0.08; 'dynamically': 0.09; 'module)': 0.09; 'scripts,': 0.09; 'setup.py': 0.09; 'subject:files': 0.09; 'subject:python': 0.10; 'error:': 0.10; 'library': 0.13; 'binary': 0.13; 'received:209.85.214.174': 0.13; 'ideally': 0.15; 'files).': 0.16; 'hierarchy': 0.16; 'subject: \n ': 0.16; 'subject:distribution': 0.16; '(but': 0.21; 'extension': 0.21; 'format,': 0.24; 'specify': 0.24; 'creating': 0.25; 'module': 0.26; 'script': 0.28; 'message- id:@mail.gmail.com': 0.28; 'exit': 0.29; 'example': 0.29; 'subject:some': 0.30; 'installed': 0.31; 'source': 0.31; 'does': 0.32; 'hi,': 0.32; 'received:209.85.214': 0.32; 'to:addr:python- list': 0.34; 'running': 0.35; 'file': 0.36; 'but': 0.37; 'received:google.com': 0.37; 'some': 0.38; 'received:209.85': 0.38; 'files': 0.39; 'received:209': 0.40; 'to:addr:python.org': 0.40; 'placed': 0.67; 'laid': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; bh=AZm5YwMKgc4X5R4QrNyhAQLywyfYsvGJSP/vYGmWNko=; b=OlAM6lI5vKUXvNAF9I2VUvD5b2Du4ISUS0Ck0XlmYOR+lMaqWbAoexNr9FwYL2ETjx sNqEKNSuMH6nXOV7QeGkRzbwQ9nBpuQHRRkSQWkLn55ksMwbbltQHVRZS/HI63P/39z0 HMUmv0fQ7jtwb7LbaQmvh2O3Xzx9q9MazdxKM=
MIME-Version 1.0
From akhilesh singhania <akhi3030@gmail.com>
Date Sun, 1 Jan 2012 12:42:02 +0000
Subject Creating a binary only python distribution of a C extension module and including some additional python and c files in it
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4290.1325421766.27778.python-list@python.org> (permalink)
Lines 39
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1325421766 news.xs4all.nl 6975 [2001:888:2000:d::a6]:52092
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:18293

Show key headers only | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web