Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #21968 > unrolled thread
| Started by | Paulo da Silva <p_s_d_a_s_i_l_v_a@netcabo.pt> |
|---|---|
| First post | 2012-03-21 04:09 +0000 |
| Last post | 2012-03-21 00:42 -0700 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.python
setup.py for an extension Paulo da Silva <p_s_d_a_s_i_l_v_a@netcabo.pt> - 2012-03-21 04:09 +0000
Re: setup.py for an extension Richard Thomas <chardster@gmail.com> - 2012-03-21 00:42 -0700
| From | Paulo da Silva <p_s_d_a_s_i_l_v_a@netcabo.pt> |
|---|---|
| Date | 2012-03-21 04:09 +0000 |
| Subject | setup.py for an extension |
| Message-ID | <jkbk99$e4c$1@speranza.aioe.org> |
Hi all. I have a python extension (bindings for a C lib - no swig) and I would like to write a setup.py to build a source distribution pack. The extension consists of 3 files: foo.h foo.c foo.py that are placed in a eclipse directory /home/<user>/ECLIPSE/workspace/ext/src foo.h+foo.c are to be compiled into _foo.so shared lib. _foo.so is itself a module only called from foo.py. The dir I wrote the setup.py is any arbitrary dir. I don't want to put packaging stuff into the eclipse source. I read the docs but have no idea on how to do this. Some tentatives I did completely failed. Any help? Thanks in advance.
[toc] | [next] | [standalone]
| From | Richard Thomas <chardster@gmail.com> |
|---|---|
| Date | 2012-03-21 00:42 -0700 |
| Message-ID | <13339221.934.1332315740021.JavaMail.geo-discussion-forums@ynim7> |
| In reply to | #21968 |
Assuming you have:
lib/__init__.py
lib/foo.py
lib/foo.c
Then:
from distutils.core import setup, Extension
setup(name="lib", packages=["lib"], ext_modules=[Extension("lib._foo", ["lib/foo.c"])])
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web