views:

1131

answers:

5

In our group we primarily do search engine architecture and content integration work and most of that code base is in Python. All our build tools and Python module dependencies are in source control so they can be checked out and the environment loaded for use regardless of os/platform, kinda similar to the approach virtualenv uses.

For years we've maintained a code base compatible with Python 2.3 because one of the commercial products we use depends on Python 2.3. Over the years this has caused more and more issues as newer tools and libraries need newer versions of Python since 2.3 came out in ~2004.

We've recently decoupled our build environment from dependencies on the commercial product's environment and can use any version of Python (or Java) we want. Its been about a month or so since we standardized on Python 2.6 as the newest version of Python that is backwards compatible with previous versions.

Python 3.0 is not an option (for now) since we'd have to migrate too much of our code base to make our build and integration tools to work correctly again.

We like many of the new features of Python 2.6, especially the improved modules and things like class decorators, but many modules we depend on cause the Python 2.6 interpreter to spout various depreciation warnings. Another tool we're interested in for managing EC2 cloud cluster nodes, Supervisor doesn't even work correctly with Python 2.6.

Now I am wondering if we should standardize on Python 2.5 for now instead of using Python 2.6 in development of production environment tools. Most of the tools we want/need seem to work correctly with Python 2.5. We're trying to sort this out now before there are many dependencies on Python 2.6 features or modules.

Many Thanks!

-Michael

+5  A: 

I wouldn't abandon 2.6 just because of deprecation warnings; those will disappear over time. (You can use the -W ignore option to the Python interpreter to prevent them from being printed out, at least) But if modules you need to use actually don't work with Python 2.6, that would be a legitimate reason to stay with 2.5. Python 2.5 is in wide use now and probably will be for a long time to come (consider how long 2.3 has lasted!), so even if you go with 2.5, you won't be forced to upgrade for a while.

I use Python 2.5 for all my development work, but only because it's the version that happens to be available in Gentoo (Linux)'s package repository. When the Gentoo maintainers declare Python 2.6 "stable"*, I'll switch to that. Of course, this reasoning wouldn't necessarily apply to you.

* Python 2.6 actually is stable, the reason it's not declared as such in Gentoo is that Gentoo relies on other programs which themselves depend on Python and are not yet upgraded to work with 2.6. Again, this reasoning probably doesn't apply to you.

David Zaslavsky
As a side note: Fedora 11 will be shipping with 2.6 as the default Python interpreter, which I suspect will start driving a few more porting efforts.
esm
+2  A: 

To me the most important to stick with python 2.5+ is because it officially supports ctypes, which changed many plugin systems.

Although you can find ctypes to work with 2.3/2.4, they are not officially bundled.

So my suggestion would be 2.5.

Francis
+4  A: 

My company is standardized in 2.5. Like you we can't make the switch to 3.0 for a million reasons, but I very much wish we could move up to 2.6.

Doing coding day to day I'll be looking through the documentation and I'll find exactly the module or function that I want, but then it'll have the little annotation: New in Version 2.6

I would say go with the newest version, and if you have depreciation warnings pop up (there will probably be very few) then just go in a find a better way to do it. Overall your code will be better with 2.6.

Robbie
+2  A: 

We're sticking with 2.5.2 for now. Our tech stack centers on Django (but we have a dozen other bits and bobs.) So we stay close to what they do.

We had to go back to docutils to 0.4 so it would work with epydoc 3.0.1. So far, this hasn't been a big issue, but it may -- at some point -- cause us to rethink our use of epydoc.

The 2.6 upgrade is part of our development plan. We have budget, but not fixed schedule right now.

The 3.0 upgrade, similarly, is something I remind folks of. We have to budget for it. We won't do it this year unless Django leaps to 3.0. We might do it next year.

S.Lott
+1  A: 

I think the best solution is to give up the hope on total uniformity, although having a common environment is something to strive for. You will always will be confronted with version problems, for example when upgrading to the next best interpreter version.

So instead of dealing with it on a per issue base you could solve this problem by taking a good look on your release management.

Instead of releasing source, go for platform depending binaries (besides the source distribution).

So what you do is that you define a number of supported CPU's, for example: x86-32, x86-64, sparc

Then which operating systems: Linux, Windows, Solaris, FreeBSD

For each OS you support a number of their major versions.

Next step is that you provide binaries for all of them.

Yes indeed this will require quite some infrastructure investment and setting up of automatic building from your repositories (you do have them?).

The advantages is that your users only have 'one' thing to install and you can easily switch versions or even mixing versions. Actually you can even use different programming languages with this approach without affecting your release management too much.

Martin P. Hellwig
We're not looking for total uniformity so much as a stable platform with which to base our work on.Our production deployment environment targets Linux CentOS installations, but our developer/development environments can span Linux/Windows/Mac due to Python's flexibility. If a developer has a local install of Python 2.6 in their dev environment, they can check out the build tools environment, source a ./setup.sh script and it just magically works.We want our development environment flexible but not too overwhelming to new jr/mid level developers we bring on staff.Thanks! :)-Michael
Xavian