| Minimum Required Python Version | Gregory Szorc | 09/09/12 12:54 | 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 |
| Re: Minimum Required Python Version | Paul ADENOT | 09/09/12 13:06 | > Linux distros are all over the map. Many include 2.7 as part of theThe 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. |
| Re: Minimum Required Python Version | Justin Lebar | 09/09/12 14:03 | > 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 > In the worst case, you will need to compile Python from source. This is> _______________________________________________ > dev-platform mailing list > dev-pl...@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform |
| Re: Minimum Required Python Version | Ralph Giles | 09/09/12 20:17 | 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 |
| Re: Minimum Required Python Version | Dirkjan Ochtman | 09/09/12 22:31 | On Sun, Sep 9, 2012 at 10:06 PM, Paul ADENOT <pa...@paul.cx> wrote: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 |
| Re: Minimum Required Python Version | Paul ADENOT | 09/09/12 22:52 | Yes, that's what I said. Only Python 3 _on a default install_.
Paul. [1]: https://wiki.ubuntu.com/Python/FoundationsQPythonVersions |
| Re: Minimum Required Python Version | Gary Kwong | 10/09/12 10:41 | > 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 |
| Re: Minimum Required Python Version | Dave Mandelin | 10/09/12 11:35 | On Sunday, September 9, 2012 12:54:29 PM UTC-7, Gregory Szorc wrote: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 |
| Re: Minimum Required Python Version | RyanVM | 10/09/12 13:27 | 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. |
| Re: Minimum Required Python Version | Dave Mandelin | 10/09/12 13:33 | Thanks for the correction. I must be a rev behind (oops). All the more reason to switch to 2.7.
Dave |
| Re: Minimum Required Python Version | Gregory Szorc | 10/09/12 13:41 | On 9/10/12 10:41 AM, Gary Kwong wrote: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. |
| Re: Minimum Required Python Version | Gary Kwong | 10/09/12 13:50 | > MozillaBuild is currently shipping with 2.7.2. Lately, I've beenA few days ago, I filed bug 788911 for MozillaBuild to upgrade to 2.7.3. -Gary |
| Re: Minimum Required Python Version | Gary Kwong | 10/09/12 13:51 | > MozillaBuild is currently shipping with 2.7.2. Lately, I've been |
| Re: Minimum Required Python Version | Dave Mandelin | 10/09/12 11:35 | On Sunday, September 9, 2012 12:54:29 PM UTC-7, Gregory Szorc wrote: |
| Re: Minimum Required Python Version | Gary Kwong | 10/09/12 10:41 | |
| Re: Minimum Required Python Version | Clint Talbert | 13/09/12 17:31 | On 9/9/2012 2:03 PM, Justin Lebar wrote: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 |
| Re: Minimum Required Python Version | Gregory Szorc | 11/10/12 16:21 | 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. |
| Re: Minimum Required Python Version | Gregory Szorc | 19/10/12 11:30 | 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. |
| Re: Minimum Required Python Version | Gregory Szorc | 01/12/12 14:29 | 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 |
| Re: Minimum Required Python Version | Justin Wood (Callek) | 01/12/12 23:44 | Gregory Szorc wrote: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) |
| Re: Minimum Required Python Version | Clint Talbert | 03/12/12 08:24 | On 12/1/2012 2:29 PM, Gregory Szorc wrote: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 |