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


Groups > comp.lang.python > #44474

Re: Adding new source types to distutils?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <jeanpierreda@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.020
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'compiler': 0.07; 'distutils': 0.07; 'reason,': 0.07; 'executed': 0.09; 'setup.py': 0.09; 'discarded.': 0.16; 'program?': 0.16; 'scripts.': 0.16; 'subject:Adding': 0.16; 'subject:distutils': 0.16; 'extensions': 0.16; 'files.': 0.16; 'flexibility': 0.16; 'weird': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'passing': 0.19; 'replacing': 0.19; 'stefan': 0.19; 'case.': 0.24; 'days,': 0.24; 'either.': 0.24; 'replace': 0.24; 'versions': 0.24; 'source': 0.25; 'options': 0.25; 'compiled': 0.26; 'extension': 0.26; 'pass': 0.26; 'header :In-Reply-To:1': 0.27; 'function': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'gives': 0.31; 'code': 0.31; 'easier': 0.31; 'about.': 0.31; 'allows': 0.31; 'option': 0.32; 'something': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'similar': 0.36; 'example,': 0.37; 'so,': 0.37; 'list': 0.37; 'subject:new': 0.38; 'problems': 0.38; 'to:addr :python-list': 0.38; 'files': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'users': 0.40; 'even': 0.60; 'future': 0.60; 'above,': 0.60; 'simply': 0.61; 'first': 0.61; 'more': 0.64; 'due': 0.66; 'between': 0.67; 'fact,': 0.69; 'influence': 0.74; 'yourself': 0.78; 'avoids': 0.84; 'conflicts': 0.84; 'subject:source': 0.84; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=Hd5m7iQaPTlgDbbtAvAr0ubWZJbnQRrVUVbw8ggv0cI=; b=YSR4M2nVRtTBCzblVQ6BbIEHcw2qhcUGvWEnyB8u0P+qmjK8AgvypJal/jRHOOOjmP p3NnfhnJemnH5eH9rDTX56VdU1CwC8/iUwXYplQGPCKdEGXyOOLCeaerfCumGZM5soou 8YoHbgYqDoSiSUe7SKxlxMbP7Lr2BRuoJMIDrOpBwDgGgcCsqAZ9gdkhfFgCSanuY1b5 96FNkci8+8maVglcERwNnkaF6cVB2efUf0V+CJ7LrF9rfZJylFvjAQhBgSfBY/gQFT1s gofZ065fHzbN8B8qgYi7oIW+HCNWauIivpKtLdF7Oj5Aph7J4zA6jWQR6O5Fzaa2xkAr bwng==
X-Received by 10.220.248.200 with SMTP id mh8mr31936210vcb.51.1367174608190; Sun, 28 Apr 2013 11:43:28 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <kljphm$luj$1@ger.gmane.org>
References <CABicbJK7DUYie9i4_seSCbs-Zq-DZ_cLQHHKZ7qLySqZX0pVDQ@mail.gmail.com> <kljphm$luj$1@ger.gmane.org>
From Devin Jeanpierre <jeanpierreda@gmail.com>
Date Sun, 28 Apr 2013 14:42:47 -0400
Subject Re: Adding new source types to distutils?
To python-list@python.org
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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.1139.1367174610.3114.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1367174610 news.xs4all.nl 15990 [2001:888:2000:d::a6]:46085
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44474

Show key headers only | View raw


On Sun, Apr 28, 2013 at 2:24 PM, Stefan Behnel <stefan_ml@behnel.de> wrote:
> That approach is discouraged for Cython. The compiler comes with a
> cythonize() function these days, which users can simply call from their
> setup.py scripts. It spits out a list of Extensions that you can pass into
> setup(). So, for example, you can say
>
>     extensions = cythonize('mypackage/*.pyx')
>
> and it would do the right thing. You can also pass configuration options
> into cythonize() to influence the way Cython translates your code.
> Alternatively, you can pass in a list of Extensions and cythonize() will
> process that and replace .pyx files by the compiled .c files. That also
> makes it easier to build without having Cython installed, by simply
> replacing the .pyx files by .c yourself and passing the Extensions directly
> into setup(). And it allows for more complex Extension configurations that
> Cython doesn't have to care about.
>
> You might want to do something similar in your case. It gives users much
> more flexibility when using source code preprocessors and also avoids
> conflicts between packages like the one you describe above, or problems
> with future versions of distutils due to fragile build setups.

I'm looking at the cythonize source code now.

Isn't it weird to compile Cython source files if setup.py is executed
for any reason, even if not to build the program? That doesn't seem
like the Right Thing either. In fact, it was the first option I
discarded. :/

-- Devin

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


Thread

Re: Adding new source types to distutils? Devin Jeanpierre <jeanpierreda@gmail.com> - 2013-04-28 14:42 -0400

csiph-web