Build tool for Python

H

Hussein B

Hi.
Apache Ant is the de facto building tool for Java (whether JSE, JEE
and JME) application.
With Ant you can do what ever you want: compile, generate docs,
generate code, packing, deploy, connecting to remote servers and every
thing.
Do we have such a tool for Python projects?
Thank you.
 
D

Diez B. Roggisch

Hussein said:
Hi.
Apache Ant is the de facto building tool for Java (whether JSE, JEE
and JME) application.
With Ant you can do what ever you want: compile, generate docs,
generate code, packing, deploy, connecting to remote servers and every
thing.
Do we have such a tool for Python projects?

distutils and setuptools are used to create distributions of
python-packages, potentially compiling e.g. C or pyrex-sources, and you can
hook into them to create e.g. api-docs.

Diez
 
T

Tim Henderson

Hi.
Apache Ant is the de facto building tool for Java (whether JSE, JEE
and JME) application.
With Ant you can do what ever you want: compile, generate docs,
generate code, packing, deploy, connecting to remote servers and every
thing.
Do we have such a tool for Python projects?
Thank you.

You might want to take a look at Paver. http://www.blueskyonmars.com/projects/paver/

Tim
 
P

Paul Boddie

Apache Ant is the de facto building tool for Java (whether JSE, JEE
and JME) application.
With Ant you can do what ever you want: compile, generate docs,
generate code, packing, deploy, connecting to remote servers and every
thing.
Do we have such a tool for Python projects?

There are quite a few similar tools here:

http://wiki.python.org/moin/ConfigurationAndBuildTools

Having looked at a few such tools recently, I found myself considering
using plain old make for automating various non-compilation-related
activities, but then again, plain Python is actually very good for
automation if you get into the right mindset. Consequently, I've just
written a bunch of functions which run programs, test outputs and
potentially feed those outputs to other programs.

Where most of the available generic tools seem to frustrate is in
their support of the often necessary but complicated behaviour
required to minimise the amount of unnecessary work performed, through
frameworks which seem to obscure the nature of the work itself. I do
understand that it can be awkward to work out which object files need
recompiling due to changes in source files, for example, and that one
doesn't want to see the logic involved reproduced all over the place,
but I do wonder whether the machinery around such matters isn't
sometimes more complicated in these tools as soon as one strays
outside the common cases.

It seems to me that some common build-related primitives implemented
as functions combined with plain Python would be a good enough
combination for a lot of tasks in this domain.

Paul
 
T

Terry Reedy

Hussein said:
Hi.
Apache Ant is the de facto building tool for Java (whether JSE, JEE
and JME) application.
With Ant you can do what ever you want: compile, generate docs,
generate code, packing, deploy, connecting to remote servers and every
thing.
Do we have such a tool for Python projects?

Also see thread Continuous integration for Python projects and mention
of buildbot.
 
M

Matthew Woodcraft

Paul Boddie said:
I do understand that it can be awkward to work out which object files
need recompiling due to changes in source files, for example, and
that one doesn't want to see the logic involved reproduced all over
the place, but I do wonder whether the machinery around such matters
isn't sometimes more complicated in these tools as soon as one strays
outside the common cases.

I think it often is. Tools like 'make' give you little declarative
languages, and when things get a little bit complicated you end up
wasting time working out how to fool it into doing what you want, when
if only you could have direct access to its internals you could quite
happily tell it explicitly.

It seems to me that some common build-related primitives implemented
as functions combined with plain Python would be a good enough
combination for a lot of tasks in this domain.

I agree entirely; I've found this works well.

I think there are three basic building blocks:

- a way to invoke a compiler with suitable options (with some
convenience support for describing project-wide default options and
overriding them where appropriate);

- a way to decide whether a file needs rebuilding (by comparing
timestamps or stored hashes or whatever);

- some kind of topological sort engine to work out what order to build
things in.

-M-
 
S

Sion Arrowsmith

Hussein B said:
Apache Ant is the de facto building tool for Java (whether JSE, JEE
and JME) application.
With Ant you can do what ever you want: [ ... ]

.... bash your head against your desk for hours trying to make sense
of its classloader system, struggle for days on end trying to make
it understand building anything outside the Java world, write piles
of tedious and often boilerplate XML, wonder what happened to javac's
ability to resolve dependencies to make this necessary ...

Put it like this, my experience has lead me to regard Ant as a
retrograde step compared to make. I can't understand why anyone
would want to inflict such a thing on a Python project.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top