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


Groups > comp.lang.python > #10132

Re: compiling qt app extensions with distutils

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <t@jollybox.de>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python,': 0.01; 'library,': 0.05; '(especially': 0.07; 'bits': 0.07; 'modules.': 0.07; 'python': 0.08; 'scripts': 0.09; 'referencing': 0.09; 'setup.py': 0.09; 'subclass': 0.09; 'subject:distutils': 0.09; 'c++': 0.12; 'am,': 0.13; 'wrote:': 0.15; 'library': 0.15; 'cpp': 0.16; 'distutils': 0.16; 'docs,': 0.16; 'embed': 0.16; 'exposes': 0.16; 'included.': 0.16; 'makefile': 0.16; 'makefile.': 0.16; 'module?': 0.16; 'okay,': 0.16; 'opengl': 0.16; 'python.h': 0.16; 'received:192.168.1.40': 0.16; 'renders': 0.16; 'subject:app': 0.16; 'url:pastebin': 0.16; 'possibly': 0.16; '>>>': 0.16; 'stick': 0.19; 'seems': 0.20; 'figure': 0.21; 'extension': 0.22; 'header:In-Reply-To:1': 0.22; 'trying': 0.23; 'extending': 0.23; 'integrating': 0.23; 'least,': 0.23; 'module,': 0.23; 'libraries': 0.25; 'library.': 0.25; 'modules': 0.25; 'skip:b 20': 0.26; 'thanks.': 0.26; "i'm": 0.27; 'objects': 0.28; 'process,': 0.28; 'all,': 0.28; 'originally': 0.29; 'fairly': 0.30; 'match': 0.30; 'module': 0.30; '22,': 0.30; 'cases.': 0.30; 'easier.': 0.30; 'invoke': 0.30; 'looks': 0.30; 'class': 0.31; 'separate': 0.31; 'seem': 0.31; 'shared': 0.32; 'too': 0.32; 'does': 0.32; 'rather': 0.33; 'it.': 0.33; 'usually': 0.33; 'done': 0.33; 'actually': 0.33; 'to:addr:python-list': 0.34; 'instead': 0.34; 'header:User- Agent:1': 0.34; 'there': 0.34; "can't": 0.34; 'things': 0.34; 'app': 0.35; 'project': 0.35; 'do?': 0.35; 'option.': 0.35; 'pretty': 0.35; 'uses': 0.35; 'probably': 0.35; 'install': 0.36; 'file': 0.36; 'url:python': 0.37; 'some': 0.37; 'doing': 0.37; 'but': 0.37; 'could': 0.37; 'using': 0.37; 'received:192': 0.38; 'url:org': 0.38; 'subject:: ': 0.38; 'mailing': 0.38; 'case': 0.39; 'received:192.168.1': 0.39; 'should': 0.39; 'url:docs': 0.39; 'list,': 0.39; 'subject:with': 0.39; 'basic': 0.39; 'to:addr:python.org': 0.39; 'might': 0.39; 'extend': 0.40; 'sense': 0.40; "i'd": 0.40; 'where': 0.40; 'your': 0.60; 'easily': 0.61; 'link': 0.63; 'course.': 0.63; 'life': 0.64; 'ever': 0.65; 'making': 0.66; 'received:62': 0.67; 'intuitive': 0.67; 'scene': 0.67; 'goals': 0.68; 'business': 0.70; 'article': 0.76; 'difficulties': 0.84; 'from:addr:t': 0.84; 'geometry': 0.84; 'lastly,': 0.84; 'seams': 0.84; 'terminology': 0.84; 'viable': 0.84; 'exposing': 0.93; 'technically': 0.93
Date Fri, 22 Jul 2011 20:43:05 +0200
From Thomas Jollans <t@jollybox.de>
User-Agent Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110626 Iceowl/1.0b2 Icedove/3.1.11
MIME-Version 1.0
To python-list@python.org
Subject Re: compiling qt app extensions with distutils
References <562586f4-d1cd-4bce-af50-fefdbb2ef0f9@h7g2000prf.googlegroups.com> <mailman.1365.1311344946.1164.python-list@python.org> <acf9108a-3b97-40e5-92ee-3c59345d6ea6@d8g2000prf.googlegroups.com>
In-Reply-To <acf9108a-3b97-40e5-92ee-3c59345d6ea6@d8g2000prf.googlegroups.com>
X-Enigmail-Version 1.1.2
OpenPGP id=5C8691ED
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
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.1380.1311360188.1164.python-list@python.org> (permalink)
Lines 70
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1311360188 news.xs4all.nl 23975 [2001:888:2000:d::a6]:36776
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:10132

Show key headers only | View raw


On 22/07/11 18:22, strattonbrazil wrote:
> I have a simple Qt app that renders a scene in OpenGL does some very
> basic geometry routines.  I originally was planning extending my app
> just by including Python.h and the corresponding lib possibly using
> pythonqt, but every time I brought it up on the python mailing list,
> many would say I should be extending it instead usually referencing
> this article (http://twistedmatrix.com/users/glyph/rant/
> extendit.html).  The article makes pretty good sense in most cases.  I
> could see the value of extending it as a module if my app ever wanted
> to be used a library, but then I would have to do the whole business
> of making a complex setup.py file to match the current Makefile.  I
> can't find any other docs on doing this to a Qt app/library though
> (especially since Trolltech uses the terms "extend" and "embed"
> interchangeably).  The article does seem to glean over the
> difficulties of extending a complex app and the python docs, at least,
> seem to present "embedding" python as just a viable and worthwhile
> option.

Okay, your terminology was confused: you want to extend Python, not your
application.

First of all, you don't technically need distutils: an extension module
is simply a shared library that you can build like any other library,
and I'm sure your build system can easily handle that. Then, you can
probably use bits of distutils to figure out where to install things to.

It may also be possible to subclass the distutils Extension class and
let it invoke your existing build system.

You could also turn your application into a library independent of
Python with your existing build infrastructure, and create a separate
Python module, with distutils, that links in turn to that library. This
would make building your project a two-part process, of course.

Lastly, depending on what your goals are, you might want to consider not
integrating Python with your application at all, but exposing what
functionality you want to expose to Python via dbus. You could write a
skeleton module that exposes dbus proxy objects to Python scripts /
modules to make life easier.

> 
> Like I said, the article made sense in theory, but at the same time I
> have limited time to work on my project and don't want to spend too
> much time trying to figure out out to create a Qt extension--
> especially since it looks like few others have actually done it.  Is
> there a way to build a simple python module from my existing
> makefile?  Or should I just stick with embedding for now using the
> existing makefile?  Thanks.
> 
> On Jul 22, 7:29 am, Thomas Jollans <t...@jollybox.de> wrote:
>> On 22/07/11 15:43, strattonbrazil wrote:
>>
>>> I'd like to extend my C++ Qt applicaition using distutils.  Looking
>>> over the tutorial docs (http://docs.python.org/extending/
>>> building.html#building), it seems fairly intuitive for simple
>>> examples, but I'm already using a rather complex qmake/Makefile system
>>> to get all my cpp files and libraries included.  Is it possible to
>>> take advantage of the existing makefile (http://pastebin.com/
>>> Ln3NCkNL)?
>>
>> What do you want to do?
>>
>> Distutils is used to build extension modules. Do you want to turn your
>> application into a Python module?
>>
>> It seams more likely that you want to embed Python in your application,
>> in which case you're looking at altogether the wrong documentation and
>> you simply have to link with libpythonX.Y like any other library
> 

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


Thread

compiling qt app extensions with distutils strattonbrazil <strattonbrazil@gmail.com> - 2011-07-22 06:43 -0700
  Re: compiling qt app extensions with distutils Thomas Jollans <t@jollybox.de> - 2011-07-22 16:29 +0200
    Re: compiling qt app extensions with distutils strattonbrazil <strattonbrazil@gmail.com> - 2011-07-22 09:22 -0700
      Re: compiling qt app extensions with distutils Thomas Jollans <t@jollybox.de> - 2011-07-22 20:43 +0200
        Re: compiling qt app extensions with distutils strattonbrazil <strattonbrazil@gmail.com> - 2011-07-22 12:37 -0700
          Re: compiling qt app extensions with distutils Thomas Jollans <t@jollybox.de> - 2011-07-23 02:30 +0200

csiph-web