Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Minimum Required Python Version

291 views
Skip to first unread message

Gregory Szorc

unread,
Sep 9, 2012, 3:54:36 PM9/9/12
to dev-pl...@lists.mozilla.org
The subject of which version of Python to require to build the tree came
up in bug 784841.

We currently require Python >= 2.5 but <3 to build the tree. The main
reason for the 2.5 requirement is the Linux build slaves still run
Python 2.5. Those of us who code Python for the tree have long wanted to
require at least 2.6 because 2.5 is missing many desired features. And,
since 2.6+ is ubiquitous these days, people (sometimes unknowingly)
target it (because it's what's installed locally) and then have to go
through trouble (or tree breakage) to backport compatibility to 2.5.
Personally, I feel that targeting 2.5 is extremely painful (especially
once you've used 2.6+) that I sometimes get discouraged from landing new
features to the build system or test suites because I don't want to deal
with 2.5 compatibility.

I'm pretty sure that no reasonably sized faction will have complaints
about bumping up the minimum version to 2.6. So, the question becomes
whether we should jump all the way to 2.7.

I believe we should.

Taking the long view, we will eventually need to switch to Python 3. Our
migration to Python 3 will likely involve porting all the code to
simultaneously run on both 2.x and 3.x. Python 2.7 has more backported
features from Python 3 than Python 2.6, so ensuring dual compatibility
while employing useful and convenient newer features [1] should be
easier with 2.7.

Shorter term, 2.7 is the superior Python release. There are literally
dozens of bug fixes and minor newer features. Individually, these don't
seem like much. Cumulatively, they represent a lot of saved time and pain.

Objections to requiring 2.7 will likely be about it not being installed
everywhere out of the box. Let's examine that.

MozillaBuild has shipped with Python 2.7 since November 2011. So,
Windows is taken care of.

OS X 10.7+ ship with Python 2.7. No action necessary. OS X 10.6 ships
with 2.6. However, 2.7 is easy to install through Homebrew, MacPorts, or
an official installer available through python.org. I believe the same
is true for 10.5. I don't consider this to be a hurdle on OS X,
especially since we already require similar steps for other required
packages there.

Linux distros are all over the map. Many include 2.7 as part of the
standard distribution. If they don't, they often include a "python27"
package. Or, at least it is a popular enough package that someone on the
internets provides an RPM, .deb, etc. We would just need to point people
at those in the build instructions on MDN.

In the worst case, you will need to compile Python from source. This is
literally |./configure && make && make install|. Not difficult if you
ask me.

Now, for those who need them (and that number goes down with time as 2.7
becomes more prevalent than 2.6), these will be extra steps. And, every
extra step makes getting started for first-time developers a little
harder. In the grand scheme of all the steps required to build the tree
today, I don't think it's such a big deal. Besides, work is currently
being done to enable one-line system bootstrap to help people initially
configure their systems [2]. Once landed, concerns about setting up
systems to build the tree should be rendered irrelevant for supported
platforms.

Some may say "why not go all the way and require Python 3?" Well,
"require" is a strong word. In my opinion we need to "support" it first.
This is because we almost certainly want to avoid a flag day conversion
because it would be a huge headache for releng and everyone else. This
means a period where we simultaneously support 2.x and 3.x. Once we have
dual support, then we can talk about requiring 3.x.

So, 2.6 or 2.7?

[1] http://docs.python.org/release/2.7.3/whatsnew/2.7.html
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=774112

Paul ADENOT

unread,
Sep 9, 2012, 4:06:47 PM9/9/12
to dev-pl...@lists.mozilla.org
> Linux distros are all over the map. Many include 2.7 as part of the
> standard distribution. If they don't, they often include a "python27"
> package. Or, at least it is a popular enough package that someone on the
> internets provides an RPM, .deb, etc. We would just need to point people
> at those in the build instructions on MDN.

The next Ubuntu release will include Python 3, and not Python 2.x (on a
default install).

However, as you note, Python 2.7 will be available as a separate
package. I just wanted to mention that, considering the number of people
that use Ubuntu, we should make clear that an _additional_ version of
Python should be installed, since it's probably easy to overlook.

Paul.

Justin Lebar

unread,
Sep 9, 2012, 5:03:05 PM9/9/12
to Gregory Szorc, dev-pl...@lists.mozilla.org
> So, 2.6 or 2.7?

I'm totally in favor of using the latest and greatest that's available.

As additional background: Python 2.7 is the last major release in the
Python 2 line [1]. So the next time we have this discussion about
upgrading our Python requirement, we won't be choosing between version
2.8 and version 3.x.

Supposing there is a strong negative reaction to requiring 2.7, I
wonder if it would be feasible to automatically install 2.7 into our
virtualenv and use only that Python throughout our build process.
Then we could upgrade that version whenever we wanted to; users who
didn't have a sufficiently new Python would simply download and
install it as part of their build.

Anyway, I hope that's not necessary, but I think even doing that would
be better than sticking with an old Python in perpetuity.

-Justin

[1] http://wiki.python.org/moin/Python2orPython3
> Linux distros are all over the map. Many include 2.7 as part of the standard
> distribution. If they don't, they often include a "python27" package. Or, at
> least it is a popular enough package that someone on the internets provides
> an RPM, .deb, etc. We would just need to point people at those in the build
> instructions on MDN.
>
> In the worst case, you will need to compile Python from source. This is
> literally |./configure && make && make install|. Not difficult if you ask
> me.
>
> Now, for those who need them (and that number goes down with time as 2.7
> becomes more prevalent than 2.6), these will be extra steps. And, every
> extra step makes getting started for first-time developers a little harder.
> In the grand scheme of all the steps required to build the tree today, I
> don't think it's such a big deal. Besides, work is currently being done to
> enable one-line system bootstrap to help people initially configure their
> systems [2]. Once landed, concerns about setting up systems to build the
> tree should be rendered irrelevant for supported platforms.
>
> Some may say "why not go all the way and require Python 3?" Well, "require"
> is a strong word. In my opinion we need to "support" it first. This is
> because we almost certainly want to avoid a flag day conversion because it
> would be a huge headache for releng and everyone else. This means a period
> where we simultaneously support 2.x and 3.x. Once we have dual support, then
> we can talk about requiring 3.x.
>
> So, 2.6 or 2.7?
>
> [1] http://docs.python.org/release/2.7.3/whatsnew/2.7.html
> [2] https://bugzilla.mozilla.org/show_bug.cgi?id=774112
> _______________________________________________
> dev-platform mailing list
> dev-pl...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform

Ralph Giles

unread,
Sep 9, 2012, 11:17:44 PM9/9/12
to Gregory Szorc, dev-pl...@lists.mozilla.org
On 12-09-09 12:54 PM, Gregory Szorc wrote:

> So, 2.6 or 2.7?

2.7. It's fairly widely deployed these days and has some nice features
over 2.6. Upgrading our build slaves won't be any more work for the one
or the other.

I believe MacOS 10.6 ships with 2.6, but not 2.7, if that's a drawback.

-r

Dirkjan Ochtman

unread,
Sep 10, 2012, 1:31:39 AM9/10/12
to Paul ADENOT, dev-pl...@lists.mozilla.org
On Sun, Sep 9, 2012 at 10:06 PM, Paul ADENOT <pa...@paul.cx> wrote:
> The next Ubuntu release will include Python 3, and not Python 2.x (on a
> default install).
>
> However, as you note, Python 2.7 will be available as a separate package. I
> just wanted to mention that, considering the number of people that use
> Ubuntu, we should make clear that an _additional_ version of Python should
> be installed, since it's probably easy to overlook.

I'm pretty sure that's wrong. It's only true for the install media,
which obviously have a much more limited set of packages installed by
default. The default Ubuntu 12.10 install should also come with
python-2.7.

Cheers,

Dirkjan

Paul ADENOT

unread,
Sep 10, 2012, 1:52:24 AM9/10/12
to dev-pl...@lists.mozilla.org
Yes, that's what I said. Only Python 3 _on a default install_.

Paul.

[1]: https://wiki.ubuntu.com/Python/FoundationsQPythonVersions


Gary Kwong

unread,
Sep 10, 2012, 1:41:17 PM9/10/12
to Gregory Szorc, dev-pl...@lists.mozilla.org
> So, 2.6 or 2.7?

Ideally 2.7. Releng also prefers python to be identical across build
machines, and new build machines are having some flavor of Python 2.7
installed (ref bug 602908).

See https://bugzilla.mozilla.org/show_bug.cgi?id=602908#c16

-Gary

Dave Mandelin

unread,
Sep 10, 2012, 2:35:02 PM9/10/12
to dev-pl...@lists.mozilla.org
On Sunday, September 9, 2012 12:54:29 PM UTC-7, Gregory Szorc wrote:
> So, 2.6 or 2.7?

Thanks for bringing this up! Count me as another vote for 2.7. I don't like using obsolete language versions outside of necessity, and I've never found it difficult to install Python.

I think MozillaBuild is currently on 2.6.5, so that will need to be updated.

Dave

Ryan VanderMeulen

unread,
Sep 10, 2012, 4:27:01 PM9/10/12
to
MozillaBuild is currently shipping with 2.7.2. Lately, I've been
planning to update a few things in there, though, and upgrading it to
2.7.3 is on my list.

Dave Mandelin

unread,
Sep 10, 2012, 4:33:54 PM9/10/12
to
Thanks for the correction. I must be a rev behind (oops). All the more reason to switch to 2.7.

Dave

Gregory Szorc

unread,
Sep 10, 2012, 4:41:35 PM9/10/12
to Gary Kwong, dev-pl...@lists.mozilla.org
On 9/10/12 10:41 AM, Gary Kwong wrote:
>> So, 2.6 or 2.7?

Rob Miller just pointed me to https://github.com/collective/buildout.python

In two shell commands I was able to install Python 2.4, 2.5, 2.6, 2.7,
3.2, and 3.3 side-by-side. It was practically effortless.

Gary Kwong

unread,
Sep 10, 2012, 4:50:45 PM9/10/12
to Ryan VanderMeulen
> MozillaBuild is currently shipping with 2.7.2. Lately, I've been
> planning to update a few things in there, though, and upgrading it to
> 2.7.3 is on my list.

A few days ago, I filed bug 788911 for MozillaBuild to upgrade to 2.7.3.

-Gary

Gary Kwong

unread,
Sep 10, 2012, 4:51:26 PM9/10/12
to Ryan VanderMeulen
> MozillaBuild is currently shipping with 2.7.2. Lately, I've been
> planning to update a few things in there, though, and upgrading it to
> 2.7.3 is on my list.

Dave Mandelin

unread,
Sep 10, 2012, 2:35:02 PM9/10/12
to mozilla.de...@googlegroups.com, dev-pl...@lists.mozilla.org
On Sunday, September 9, 2012 12:54:29 PM UTC-7, Gregory Szorc wrote:
> So, 2.6 or 2.7?

Gary Kwong

unread,
Sep 10, 2012, 1:41:17 PM9/10/12
to Gregory Szorc, dev-pl...@lists.mozilla.org

Clint Talbert

unread,
Sep 13, 2012, 8:31:11 PM9/13/12
to
On 9/9/2012 2:03 PM, Justin Lebar wrote:
>> So, 2.6 or 2.7?
>
> I'm totally in favor of using the latest and greatest that's available.
>
Me too. I'm in favor of putting all the automation (build & test) on 2.7.3:
https://bugzilla.mozilla.org/show_bug.cgi?id=724191

Clint

Gregory Szorc

unread,
Oct 11, 2012, 7:21:17 PM10/11/12
to dev-pl...@lists.mozilla.org
The general consensus seems to be "2.7 is good," so I filed
https://bugzilla.mozilla.org/show_bug.cgi?id=800614 to have configure
enforce Python 2.6 as the minimum required to *build* the tree. Note
that building is different from running tests (some test runners still
run on Python 2.5 and Talos is on Python 2.4).

We'll figure out the bump to 2.7 once we see how well 2.6 goes.

If anyone has new objections, please state them on the bug.

Gregory Szorc

unread,
Oct 19, 2012, 2:30:55 PM10/19/12
to dev-pl...@lists.mozilla.org
Inbound now requires Python 2.6:
https://hg.mozilla.org/integration/mozilla-inbound/rev/09dc2dc1fc9f

Expect this to hit central in the next day or two.

If you find a distro that doesn't ship Python 2.6, we have a tool in the
tree to perform system bootstrapping (python/mozboot). We should teach
it how to install Python (preferably 2.7). File bugs for this tool under
Core :: Build Config.

On 10/11/12 4:21 PM, Gregory Szorc wrote:
> The general consensus seems to be "2.7 is good," so I filed
> https://bugzilla.mozilla.org/show_bug.cgi?id=800614 to have configure
> enforce Python 2.6 as the minimum required to *build* the tree. Note
> that building is different from running tests (some test runners still
> run on Python 2.5 and Talos is on Python 2.4).
>
> We'll figure out the bump to 2.7 once we see how well 2.6 goes.
>
> If anyone has new objections, please state them on the bug.
>
> On 9/9/12 12:54 PM, Gregory Szorc wrote:

Gregory Szorc

unread,
Dec 1, 2012, 5:29:03 PM12/1/12
to dev-pl...@lists.mozilla.org
The bump to Python 2.6 seemed to go OK. So, I think it's time to finish
the transition and bump the minimum to Python 2.7.

Per the previous discussion on this list, I don't believe we have any
outstanding objections. So, I propose we move forward with this as soon
as we have confirmation that all builders are on Python 2.7.

https://bugzilla.mozilla.org/show_bug.cgi?id=804865 is tracking bumping
the /build/ requirement to Python 2.7. Some tests will still be running
on older Python. But, I believe everybody is on board with transitioning
everything to 2.7. So, we should pretend this transition effectively
means we can stop supporting 2.6 and below everywhere in the tree as
soon as 2.7 is deployed everywhere.

If there are any objections, please voice them now.

Gregory

On 10/19/2012 11:30 AM, Gregory Szorc wrote:
> Inbound now requires Python 2.6:
> https://hg.mozilla.org/integration/mozilla-inbound/rev/09dc2dc1fc9f
>
> Expect this to hit central in the next day or two.
>
> If you find a distro that doesn't ship Python 2.6, we have a tool in
> the tree to perform system bootstrapping (python/mozboot). We should
> teach it how to install Python (preferably 2.7). File bugs for this
> tool under Core :: Build Config.
>
> On 10/11/12 4:21 PM, Gregory Szorc wrote:
>> The general consensus seems to be "2.7 is good," so I filed
>> https://bugzilla.mozilla.org/show_bug.cgi?id=800614 to have configure
>> enforce Python 2.6 as the minimum required to *build* the tree. Note
>> that building is different from running tests (some test runners still
>> run on Python 2.5 and Talos is on Python 2.4).
>>
>> We'll figure out the bump to 2.7 once we see how well 2.6 goes.
>>
>> If anyone has new objections, please state them on the bug.
>>
>> On 9/9/12 12:54 PM, Gregory Szorc wrote:

Justin Wood (Callek)

unread,
Dec 2, 2012, 2:44:55 AM12/2/12
to Gregory Szorc
Gregory Szorc wrote:
>
> If there are any objections, please voice them now.

Can we re-post this as an entirely new thread, out of shear luck I
noticed it, though its buried in the middle of my threaded view for way
back in September. In a thread I have long since chosen to ignore since
I knew the final outcome of that particular post (which is how I, and I
know many others, read the newsgroups here).

--
~Justin Wood (Callek)

Clint Talbert

unread,
Dec 3, 2012, 11:24:39 AM12/3/12
to
On 12/1/2012 2:29 PM, Gregory Szorc wrote:
> The bump to Python 2.6 seemed to go OK. So, I think it's time to finish
> the transition and bump the minimum to Python 2.7.
>
> Per the previous discussion on this list, I don't believe we have any
> outstanding objections. So, I propose we move forward with this as soon
> as we have confirmation that all builders are on Python 2.7.
>
> https://bugzilla.mozilla.org/show_bug.cgi?id=804865 is tracking bumping
> the /build/ requirement to Python 2.7. Some tests will still be running
> on older Python. But, I believe everybody is on board with transitioning
> everything to 2.7. So, we should pretend this transition effectively
> means we can stop supporting 2.6 and below everywhere in the tree as
> soon as 2.7 is deployed everywhere.
>
> If there are any objections, please voice them now.

No objections at all. I just want to say that we should also review what
the pending work is to bump the tests to 2.7 as well. That will likely
have to happen after B2G automation milestones in Q1 2013 though, as we
have no bandwidth to address the necessary bugs before then.

Clint
0 new messages