Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > creating .pyo with make

Reply
Thread Tools

creating .pyo with make

 
 
Yann Leboulanger
Guest
Posts: n/a
 
      01-23-2008
Hi,

I use autoconf / automake to manage my python project, and I'l like make
/ make install to create / install .pyo files instead of .py files.

Is there something I should add to my Makefile.am files to do that? Or
should I do all that myself with py_compile module?

Are there some examples somewhere with autotools?

Thanks for your help
--
Yann
 
Reply With Quote
 
 
 
 
Yann Leboulanger
Guest
Posts: n/a
 
      01-23-2008
Yann Leboulanger wrote:
> Hi,
>
> I use autoconf / automake to manage my python project, and I'l like make
> / make install to create / install .pyo files instead of .py files.
>
> Is there something I should add to my Makefile.am files to do that? Or
> should I do all that myself with py_compile module?
>
> Are there some examples somewhere with autotools?
>
> Thanks for your help


Hehe replying to myself. It seems I just have to replace
project_DATA = $(srcdir)/*.py
by
project_PYTHON = $(srcdir)/*.py

Then when I do make install, it installs .py, .pyc and .pyo.
Would it be possible to install only .pyo? Is it a good idea?

--
Yann
 
Reply With Quote
 
 
 
 
Diez B. Roggisch
Guest
Posts: n/a
 
      01-23-2008
Yann Leboulanger schrieb:
> Yann Leboulanger wrote:
>> Hi,
>>
>> I use autoconf / automake to manage my python project, and I'l like
>> make / make install to create / install .pyo files instead of .py files.
>>
>> Is there something I should add to my Makefile.am files to do that? Or
>> should I do all that myself with py_compile module?
>>
>> Are there some examples somewhere with autotools?
>>
>> Thanks for your help

>
> Hehe replying to myself. It seems I just have to replace
> project_DATA = $(srcdir)/*.py
> by
> project_PYTHON = $(srcdir)/*.py
>
> Then when I do make install, it installs .py, .pyc and .pyo.
> Would it be possible to install only .pyo? Is it a good idea?


There might be the occasional code that relies on doc-strings to work -
seldomly, but possible. Which are obmitted by .pyo, but not of pyc.

Apart from that, having only pyc-files (or pyo for that matter) sucks.
Just today I had to delve into a ZOPE-application, setting breakpoints
and getting things done. It would have been impossible or at least much
more inconvenient to debug if I hadn't had the sources available (and
put at a place where they actually get invoked from the interpreter, not
lying around unrelated)

Diez
 
Reply With Quote
 
Yann Leboulanger
Guest
Posts: n/a
 
      01-24-2008
Diez B. Roggisch wrote:
> Yann Leboulanger schrieb:
>> Yann Leboulanger wrote:
>>> Hi,
>>>
>>> I use autoconf / automake to manage my python project, and I'l like
>>> make / make install to create / install .pyo files instead of .py files.
>>>
>>> Is there something I should add to my Makefile.am files to do that?
>>> Or should I do all that myself with py_compile module?
>>>
>>> Are there some examples somewhere with autotools?
>>>
>>> Thanks for your help

>>
>> Hehe replying to myself. It seems I just have to replace
>> project_DATA = $(srcdir)/*.py
>> by
>> project_PYTHON = $(srcdir)/*.py
>>
>> Then when I do make install, it installs .py, .pyc and .pyo.
>> Would it be possible to install only .pyo? Is it a good idea?

>
> There might be the occasional code that relies on doc-strings to work -
> seldomly, but possible. Which are obmitted by .pyo, but not of pyc.
>
> Apart from that, having only pyc-files (or pyo for that matter) sucks.
> Just today I had to delve into a ZOPE-application, setting breakpoints
> and getting things done. It would have been impossible or at least much
> more inconvenient to debug if I hadn't had the sources available (and
> put at a place where they actually get invoked from the interpreter, not
> lying around unrelated)
>
> Diez


Source are available i ntarballs, but when I do make install I don't
care to install .py files. .pyo are enough to run the application.

--
Yann
 
Reply With Quote
 
Diez B. Roggisch
Guest
Posts: n/a
 
      01-24-2008
Yann Leboulanger schrieb:
> Diez B. Roggisch wrote:
>> Yann Leboulanger schrieb:
>>> Yann Leboulanger wrote:
>>>> Hi,
>>>>
>>>> I use autoconf / automake to manage my python project, and I'l like
>>>> make / make install to create / install .pyo files instead of .py
>>>> files.
>>>>
>>>> Is there something I should add to my Makefile.am files to do that?
>>>> Or should I do all that myself with py_compile module?
>>>>
>>>> Are there some examples somewhere with autotools?
>>>>
>>>> Thanks for your help
>>>
>>> Hehe replying to myself. It seems I just have to replace
>>> project_DATA = $(srcdir)/*.py
>>> by
>>> project_PYTHON = $(srcdir)/*.py
>>>
>>> Then when I do make install, it installs .py, .pyc and .pyo.
>>> Would it be possible to install only .pyo? Is it a good idea?

>>
>> There might be the occasional code that relies on doc-strings to work
>> - seldomly, but possible. Which are obmitted by .pyo, but not of pyc.
>>
>> Apart from that, having only pyc-files (or pyo for that matter) sucks.
>> Just today I had to delve into a ZOPE-application, setting breakpoints
>> and getting things done. It would have been impossible or at least
>> much more inconvenient to debug if I hadn't had the sources available
>> (and put at a place where they actually get invoked from the
>> interpreter, not lying around unrelated)
>>
>> Diez

>
> Source are available i ntarballs, but when I do make install I don't
> care to install .py files. .pyo are enough to run the application.


As I said - not installing them will make debugging for someone who
knows how to deal with it just more inconvenient. And if you plan to
release the code anyway - don't bother separating pyc/pyo from the py.

Diez

 
Reply With Quote
 
Yann Leboulanger
Guest
Posts: n/a
 
      01-25-2008
Diez B. Roggisch wrote:
> Yann Leboulanger schrieb:
>> Diez B. Roggisch wrote:
>>> Yann Leboulanger schrieb:
>>>> Yann Leboulanger wrote:
>>>>> Hi,
>>>>>
>>>>> I use autoconf / automake to manage my python project, and I'l like
>>>>> make / make install to create / install .pyo files instead of .py
>>>>> files.
>>>>>
>>>>> Is there something I should add to my Makefile.am files to do that?
>>>>> Or should I do all that myself with py_compile module?
>>>>>
>>>>> Are there some examples somewhere with autotools?
>>>>>
>>>>> Thanks for your help
>>>>
>>>> Hehe replying to myself. It seems I just have to replace
>>>> project_DATA = $(srcdir)/*.py
>>>> by
>>>> project_PYTHON = $(srcdir)/*.py
>>>>
>>>> Then when I do make install, it installs .py, .pyc and .pyo.
>>>> Would it be possible to install only .pyo? Is it a good idea?
>>>
>>> There might be the occasional code that relies on doc-strings to work
>>> - seldomly, but possible. Which are obmitted by .pyo, but not of pyc.
>>>
>>> Apart from that, having only pyc-files (or pyo for that matter)
>>> sucks. Just today I had to delve into a ZOPE-application, setting
>>> breakpoints and getting things done. It would have been impossible or
>>> at least much more inconvenient to debug if I hadn't had the sources
>>> available (and put at a place where they actually get invoked from
>>> the interpreter, not lying around unrelated)
>>>
>>> Diez

>>
>> Source are available i ntarballs, but when I do make install I don't
>> care to install .py files. .pyo are enough to run the application.

>
> As I said - not installing them will make debugging for someone who
> knows how to deal with it just more inconvenient. And if you plan to
> release the code anyway - don't bother separating pyc/pyo from the py.
>


That's a point of view I understand, but some prefer smaller
installation size. Now it installs .py, .pyc, and .pyo, so 3 times bigger.

--
Yann
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a function to make checkbutton with information from a list? Thomas Jansson Python 3 05-14-2007 09:13 PM
How does one make use of sub files to make DVD? Bun Mui DVD Video 0 05-21-2006 03:24 PM
"Error Creating Control" when creating a custom control (Design Time). Can't see tooltip message. Ravi Ambros Wallau ASP .Net Web Controls 0 06-01-2005 02:36 PM
"Error Creating Control" when creating a custom control (Design Time). Can't see tooltip message. Ravi Ambros Wallau ASP .Net 0 06-01-2005 02:36 PM
Anyone know how to make XP make a sound when typing? Like old dumb terminals? Fire Computer Support 6 02-17-2004 12:56 AM



Advertisments