473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

creating .pyo with make

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
Jan 23 '08 #1
5 1931
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
Jan 23 '08 #2
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
Jan 23 '08 #3
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
Jan 24 '08 #4
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

Jan 24 '08 #5
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
Jan 25 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Joshua Beall | last post by:
Hi All, I am working on a registration system, and one of the things I am going to need to be able to do it setup the database tables for each event that I have registration for. Normally I...
30
by: Sean R. Lynch | last post by:
I've been playing around with Zope's RestrictedPython, and I think I'm on the way to making the modifications necessary to create a capabilities-based restricted execution system. The idea is to...
1
by: ChinStrap | last post by:
I am sorry if this is obvious, but I am not seeing it. How would I go about creating a new type that is of the same type as a class sent into the function? new = foo.__init__() refers to the...
6
by: owen | last post by:
Generally speaking, what does it mean when I see a "button" with red text showing this message instead of the control I've dragged onto the web form in Design View.? (But the page works fine at...
8
by: Nanda | last post by:
hi, I am trying to generate parameters for the updatecommand at runtime. this.oleDbDeleteCommand1.CommandText=cmdtext; this.oleDbDeleteCommand1.Connection =this.oleDbConnection1;...
3
by: Ken Varn | last post by:
I am just starting the process of creating ASP.NET server controls. I have created controls for .NET applications, but have just started with ASP.NET. I am a little confused about some areas that...
12
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
16
by: tshad | last post by:
This is a little complicated to explain but I have some web services on a machine that work great. The problem is that I have run into a situation where I need to set up my program to access one...
7
by: Paul | last post by:
Hi I have created an excel file download feature within a .net application using Microsoft Office XP primary interop assembly for excel. I was just wondering if anyone knows if you can also embed...
9
by: Tarscher | last post by:
hi all, I have this seemingly simple problem. I have lost a lot of time on it though. When a user selects a value from a dropdownlist (static control) a dynamic control is generated. I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.