By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,314 Members | 1,793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,314 IT Pros & Developers. It's quick & easy.

code packaging

P: n/a
I've been through this kind of thing a few times in the past and
received excellent advice here on clpy about how to deal with specific
technical aspects (e.g. how to use setuptools, InnoSetup, etc).

I'm now wondering where this type of thing is best addressed in more
general terms. What I usually see happening, in projects I've worked
on and in others, is that developers get the code working on their own
computers, using source control tools and (if we're lucky) tests
developed in parallel with the code, but without much attention to
final packaging until the very end when the code is about to be
shipped.

Is this appropriate? Inappropriate? Do your projects start using
serious packaging and distribution tools very early in development,
before the code is anywhere near usable? Should they?

I'm involved in something that I wish was that way, mainly because I
really don't have any way to put a complete installation on my own
computers; I have to develop my subsystem more or less independently
of the overall app, then toss stuff over the wall to the more central
application guys for integration, which gets slow sometimes because
we're distributed all over. This is a fairly complex server app that
depends on a lot of external packages and programs running across
multiple machines, so I could see the packaging problem being messy.
It would cause a significant interruption in development to try to
package things so that the non-central developers could install and
hack it without a lot of assistance. But I think it would be
worthwhile given how much easier it would become to test changes. We
do plan to bundle up and release the code sometime (maybe as a Debian
package) but for now that's deferred until the code is more complete
and stable.

I'm wondering how other projects go about this.
Jul 20 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hello Paul,
I'm now wondering where this type of thing is best addressed in more
general terms. What I usually see happening, in projects I've worked
on and in others, is that developers get the code working on their own
computers, using source control tools and (if we're lucky) tests
developed in parallel with the code, but without much attention to
final packaging until the very end when the code is about to be
shipped.
[snipped]

IMO you should invest the time a build automated packaging and some
smoke tests for the product.
After this is done, start using some "continuous automation" tools
(like http://cruisecontrol.sourceforge.net/, http://buildbot.net/trac
and others).

HTH,
--
Miki <mi*********@gmail.com>
http://pythonwise.blogspot.com

Jul 20 '07 #2

P: n/a
Paul Rubin <http://ph****@NOSPAM.invalidwrites:
Is this appropriate? Inappropriate? Do your projects start using
serious packaging and distribution tools very early in development,
before the code is anywhere near usable? Should they?
Yes. Test-driven development has taught me that putting off important
parts of the development process until the end is rarely a good
idea. So, I try to make a point of writing the first features inside a
complete unit test environment, and inside a complete
distribution/build environment. The tests are run continuously while
developing the code, and the distribution/build process is tested
manually.

I'm looking into the "build-bot" approach used to ensure that the
build process is also run automatically and continually during
development, just like the unit tests <URL:http://buildbot.net/>; but
so far I'm running the build manually.

--
\ "Read not to contradict and confute, nor to believe and take |
`\ for granted ... but to weigh and consider." -- Francis Bacon |
_o__) |
Ben Finney
Jul 20 '07 #3

P: n/a
Paul Rubin <http://ph****@NOSPAM.invalidwrites:
[...]
I'm now wondering where this type of thing is best addressed in more
general terms. What I usually see happening, in projects I've worked
on and in others, is that developers get the code working on their own
computers, using source control tools and (if we're lucky) tests
developed in parallel with the code, but without much attention to
final packaging until the very end when the code is about to be
shipped.

Is this appropriate? Inappropriate? Do your projects start using
serious packaging and distribution tools very early in development,
before the code is anywhere near usable? Should they?

I'm involved in something that I wish was that way, mainly because I
really don't have any way to put a complete installation on my own
computers; I have to develop my subsystem more or less independently
of the overall app, then toss stuff over the wall to the more central
application guys for integration, which gets slow sometimes because
we're distributed all over. This is a fairly complex server app that
depends on a lot of external packages and programs running across
multiple machines, so I could see the packaging problem being messy.
It would cause a significant interruption in development to try to
package things so that the non-central developers could install and
hack it without a lot of assistance. But I think it would be
worthwhile given how much easier it would become to test changes. We
do plan to bundle up and release the code sometime (maybe as a Debian
package) but for now that's deferred until the code is more complete
and stable.

I'm wondering how other projects go about this.
You can go further: in addition to developing a Debian package (or a
few of them) for your own project, build your OS image using
debootstrap (you'll probably want your own local repository(ies), for
reproducibility). Then you do your development in a virtual machine
or chroot environment. That way you develop in the same (or very
similar) environment to the one in which your code will eventually be
deployed (one difference being the use of an version control checkout
rather a .deb install for the code you're actually working on, unless
troubleshooting problems that are somehow tied up with that particular
aspect of deployment). I've seen this working in a real-world
project.

Of course, you can set up a server that does a complete build-and-test
every night, and a separate continuous integration server that just
does an "svn up" (rather than a full rebuild) every time somebody
checks in, so that test failures can be detected quickly and the
guilty party suitably humiliated :-)
John
Jul 21 '07 #4

P: n/a
On 7/22/07, Ryan Ginstrom <wrote:
Hi Alex:

Do you develop for Windows? Are you looking to automate a build
process?

The standard library's build module is distutils:
http://docs.python.org/lib/module-distutils.html

As I mentioned in my post, I use a variety of third-party modules
(epydoc, py2exe, Inno Setup, AutoIt), which I glue together with my
own brew of python scripts. Since I develop mostly for Windows (except
for Web stuff, which I use Linux for), my build process is tailored to
that platform.

Regards,
Ryan Ginstrom
Thanks for following up on this. I am mostly used with a world where
platform dependent builds are not very used (Java).

My current attempt to learn Python is by creating a Python equivalent of
the advanced Java testing framework TestNG (http://testng.org) -- but I
will give more details about this when I'll be starting to have
something more solid :-).

However, due to my background where builds are required and there are
some de facto build standards (Ant, Maven, etc.) I am starting to think
I will be needing something similar while working on the tool I've
mentioned. At this point I think that what I am interested in are how
distros are build in Python world (no platform specific distros, but
rather generic ones) and ways to automate the process of creating the
distros (and probably running the framework internal tests etc.)

My research lead me to distutils and/or setuptools, respectively SCon
and/or buildutils. So I am wondering if I am looking in the right
direction or do I need to do some more research :-).

tia,
../alex
--
..w( the_mindstorm )p.

Jul 22 '07 #5

P: n/a
jj*@pobox.com (John J. Lee) writes:
You can go further: in addition to developing a Debian package (or a
few of them) for your own project, build your OS image using
debootstrap (you'll probably want your own local repository(ies), for
reproducibility). Then you do your development in a virtual machine
or chroot environment. That way you develop in the same (or very
similar) environment to the one in which your code will eventually be
deployed (one difference being the use of an version control checkout
rather a .deb install for the code you're actually working on, unless
troubleshooting problems that are somehow tied up with that particular
aspect of deployment). I've seen this working in a real-world
project.
Thanks for these suggestions. Buildbot (per Ben Finney) looks
interesting as does the above, and Ryan's notes about experience with
Windows installers is also appreciated. Whether lot of build
automation would have been worth it at the beginning of the thing I'm
working on or not, we probably need to move towards it now that more
of the system is running.
Jul 24 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.