Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-26 Thread Wilbert Berendsen
Op Sun, 24 Apr 2016 10:41:53 +0200
David Kastrup  schreef:

> And I haven't seen _any_ compelling argument yet _why_ there is no
> useful common ground between Python2 and Python3 that could do the job
> without major rewrites of the current code base.

I have maintained the Frescobaldi (written python) codebase for a long
time supporting both python 2.7 and 3.x.

It is not dificult to support both but it is really needed that you
require 2.7 at least when using python 2.

The python-ly library which I'm also the author/maintainer of will
support both Python 2.7 and 3 for the foreseeable future.

I think that gradually making the python codebase in LilyPond work with
2.7 and 3.2+ is doable and that will give enough flexibility for
packagers and distributors.


-- 
Wilbert Berendsen, musician
‣ mail: i...@wilbertberendsen.nl
‣ web: www.wilbertberendsen.nl
‣ phone: +31646122877

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-25 Thread Julien Rioux

On 24/04/2016 12:12 PM, Phil Holmes wrote:

- Original Message - From: "David Kastrup" 


No disagreement here.  At the very least it would be verification that
the ones responsible for doing the GUB part of the transition are
comfortable with the basic necessities.



I think the only person likely to be able to upgrade GUB to python 2.7 2
would be Masamichi.

--
Phil Holmes


A while back I pushed a branch with python 2.6 based on Jan's upstream, 
but it got stalled [1]. While not the latest, 2.6 does have a lot of 2/3 
compatibility helpers included (from __future__ import ...). I outlined 
an update plan [2] which obviously "felt in the water" as the Germans 
say. Maybe there is something to base future efforts upon.


[1] https://github.com/gperciva/gub/pull/6
[2] https://lists.gnu.org/archive/html/lilypond-devel/2014-03/msg00033.html

--
Julien


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread David Wright
On Sun 24 Apr 2016 at 10:55:39 (+0200), m.tarensk...@zonnet.nl wrote:

[-- Attachment #1 --]
[-- Type: text/html, Encoding: base64, Size: 4.7K --]

[-- text/html is unsupported (use 'v' to view this part) --]

Please configure your client to post a text equivalent of your HTML code.

Cheers,
David.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread David Wright
On Sun 24 Apr 2016 at 10:00:38 (+0200), Urs Liska wrote:
> Am 24.04.2016 um 09:56 schrieb David Kastrup:
> > Noeck  writes:
> >>> So how do you define "the default"
> >> As written before: What ships with the default installation.
> > 
> > So python3 needs to be invoked using #!/usr/bin/python3 in the scripts
> > (what happens when Python 4 gets created), and we need to either support
> > Python2 and Python3 in parallel (including from GUB) _or_ make a hard
> > switch where we change _every_ script to use Python3 _and_ change GUB
> > from one version to the next.
> > 
> > _And_ Wols insists that he does _not_ want to use a common subset of
> > Python2 and Python3 even temporarily but do this right away using
> > Python3-only features.
> > 
> > Now having a separate prescribed #!/usr/bin/python3 shebang may seem to
> > make testing half-way reliable.  But in reality, the LilyPond code base
> > does not contain #!/usr/bin/python to any sizable degree (there is a
> > single script which might be an oversight) but instead #!@TARGET_PYTHON@
> > so again, there does not seem to be much of an alternative for an
> > all-or-nothing approach, and trying to mix this with making use of new
> > language features at the same time seems like a logistic nightmare.
> > 
> OK, but what happens when we face the situation that some distros have
> #!/usr/bin/python to Python 2 and other to Python 3?
> This is something we can't control at all, so at latest *then* we'd be
> in that situation, with the difference that *now* we have at least a
> chance to control the transition.

Has this not already happened? The rationale for PEP394 was
"This recommendation is needed as, even though the majority of
distributions still alias the python command to Python 2, some now
alias it to Python 3 ( [5] ). As some of the former distributions did
not provide a python2 command by default, there was previously no way
for Python 2 code (or any code that invokes the Python 2 interpreter
directly rather than via sys.executable ) to reliably run on all
Unix-like systems without modification, as the python command would
invoke the wrong interpreter version on some systems, and the python2
command would fail completely on others."

...which refers to https://www.archlinux.org/news/python-is-now-python-3/

>From https://wiki.archlinux.org/index.php/python of 7 April:
"Any program requiring Python 2 needs to point to /usr/bin/python2,
instead of /usr/bin/python, which points to Python 3. To do so, open
the program or script in a text editor and change the first line. The
line will show one of the following:
#!/usr/bin/env python or #!/usr/bin/python
In both cases, just change python to python2 and the program will then
use Python 2 instead of Python 3."

Jumping the gun a bit...

Cheers,
David.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread Phil Holmes
- Original Message - 
From: "David Kastrup" 


No disagreement here.  At the very least it would be verification that
the ones responsible for doing the GUB part of the transition are
comfortable with the basic necessities.



I think the only person likely to be able to upgrade GUB to python 2.7 2 
would be Masamichi.


--
Phil Holmes 



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread David Kastrup
Paul Morris  writes:

>> On Apr 24, 2016, at 11:15 AM, David Kastrup  wrote:
>> 
>> Paul Morris  writes:
>> 
>>> IIUC, wouldn’t the first step be, in any case, to get LilyPond’s
>>> python scripts working on python 2.7?
>> 
>> Which ones _aren't_ working with Python 2.7?  I run a number of them
>> routinely, and I just converted some file with midi2ly as well.
>
> Sorry, my words weren’t very precise.  I don’t know of any scripts
> that aren’t working with 2.7.
>
> I jus wanted to make the point that since the LilyPond binaries ship
> with an earlier python version and that GUB still uses 2.4 (as
> mentioned earlier in the thread) that getting those things
> successfully upgraded to python 2.7 would be the first step to take
> (regardless of how we handle the transition to python 3).

No disagreement here.  At the very least it would be verification that
the ones responsible for doing the GUB part of the transition are
comfortable with the basic necessities.

> (Of course, you’re right that the transition to guile 2 is a much
> higher priority, but it seems we could use any help we can get
> wherever we can get it.)

I don't see that those tasks are competing for the same developers.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread Paul Morris
> On Apr 24, 2016, at 11:15 AM, David Kastrup  wrote:
> 
> Paul Morris  writes:
> 
>> IIUC, wouldn’t the first step be, in any case, to get LilyPond’s
>> python scripts working on python 2.7?
> 
> Which ones _aren't_ working with Python 2.7?  I run a number of them
> routinely, and I just converted some file with midi2ly as well.

Sorry, my words weren’t very precise.  I don’t know of any scripts that aren’t 
working with 2.7.

I jus wanted to make the point that since the LilyPond binaries ship with an 
earlier python version and that GUB still uses 2.4 (as mentioned earlier in the 
thread) that getting those things successfully upgraded to python 2.7 would be 
the first step to take (regardless of how we handle the transition to python 3).

(Of course, you’re right that the transition to guile 2 is a much higher 
priority, but it seems we could use any help we can get wherever we can get it.)

Cheers,
-Paul
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread David Kastrup
Paul Morris  writes:

> IIUC, wouldn’t the first step be, in any case, to get LilyPond’s
> python scripts working on python 2.7?

Which ones _aren't_ working with Python 2.7?  I run a number of them
routinely, and I just converted some file with midi2ly as well.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread Paul Morris
IIUC, wouldn’t the first step be, in any case, to get LilyPond’s python scripts 
working on python 2.7?  Then at that point we could discuss and decide about 
whether it’s better to switch to python 3 or to support both 2.7 and 3.

Searching the LilyPond source code for files with extension “.py” turns up 
about 73 files, if anyone’s interested in a rough estimate of the scope.

-Paul
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread Davide Liessi
2016-04-24 13:46 GMT+02:00 m.tarensk...@zonnet.nl :
> [...] Many python
> syntax can be compatible with both Python2 and Python3 without much effort.
> There are in practice only a few things that are a bit harder. For example
> strings/unicode/binary datatypes. If it's only a limited amount of old code
> that requires some effort to make it compatible with both Py2 and Py3 than
> that might be worth considering. Writing new code using a common subset
> isn't that difficult. That's where the six library can help.

Indeed, Frescobaldi 2 (just to mention the one I know best) has been
supporting both Python 2 and 3 for some months (Frescobaldi 3 however
will require Python 3).

Best wishes.
Davide

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread Davide Liessi
2016-04-23 13:59 GMT+02:00 Andrew Bernard :
> But lilypond ships its own internal version of python in …lilypond/usr/bin. 
> Is this not to shield lilypond from system versions?

In my experience, the Python interpreter bundled with LilyPond on Mac
is pretty unusable, also for running Python scripts bundled with
LilyPond.
In Frescobaldi we use the system-provided Python for them.

Best wishes.
Davide

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread Federico Bruni
On Sun, Apr 24, 2016 at 02:02:19PM +0200, Noeck wrote:
> > I will add a comment to the first of these two issues (and mark the second 
> > as duplicate):
> > https://sourceforge.net/p/testlilyissues/issues/1895/
> > https://sourceforge.net/p/testlilyissues/issues/1895/
> 
> Which two? They are the same. Probably just a copy-and-paste mistake.
> For completeness, it would still be good to have the two links here on
> the list.
> 

Sorry, I meant this:
https://sourceforge.net/p/testlilyissues/issues/1079/


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread Noeck
> I will add a comment to the first of these two issues (and mark the second as 
> duplicate):
> https://sourceforge.net/p/testlilyissues/issues/1895/
> https://sourceforge.net/p/testlilyissues/issues/1895/

Which two? They are the same. Probably just a copy-and-paste mistake.
For completeness, it would still be good to have the two links here on
the list.

Best,
Joram

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread m.tarensk...@zonnet.nl
How much python code are we talking about within the complete LilyPond project? The discussion until now seems to be a discussion about Python2/3 transitions in general. But maybe the situation isn't that bad. Many python syntax can be compatible with both Python2 and Python3 without much effort. There are in practice only a few things that are a bit harder. For example strings/unicode/binary datatypes. If it's only a limited amount of old code that requires some effort to make it compatible with both Py2 and Py3 than that might be worth considering. Writing new code using a common subset isn't that difficult. That's where the six library can help.MT Oorspronkelijk bericht Onderwerp: Re: Python 3, was Re: ANN: Frescobaldi 2.19.0Van: David Kastrup Aan: Werner LEMBERG Cc: lilypond-user@gnu.orgWerner LEMBERG  writes:>> So far we only have an offer for a hard and incompatible transition>> to Python3-only>> Actually, I dislike this.  Similar to you, I don't see a convincing> reason to not write python code that is compatible with both version 2> and version 3.Well, #!/usr/bin/guile can mean either Guile-1 and Guile-2 whereas#!/usr/bin/python is more or less guaranteed to mean Python-2 for quitea bit of time, even while there may be only Python-3 available at somepoint of time.So it does look like we are in for a hard change with regard todistributed LilyPond versions anyway.  However, the configure processvery well could substitute #!@TARGET_PYTHON@ (most installed scripts) aswell as #!@PYTHON@ (the build scripts) with either a Python-2 or aPython-3 hashbang, depending on availability/configuration of eitheroption.So we definitely have a use case for supporting both: then a choice canbe made by scripts or user at configure time.-- David Kastrup___lilypond-user mailing listlilypond-user@gnu.orghttps://lists.gnu.org/mailman/listinfo/lilypond-user___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread David Kastrup
Werner LEMBERG  writes:

>> So far we only have an offer for a hard and incompatible transition
>> to Python3-only
>
> Actually, I dislike this.  Similar to you, I don't see a convincing
> reason to not write python code that is compatible with both version 2
> and version 3.

Well, #!/usr/bin/guile can mean either Guile-1 and Guile-2 whereas
#!/usr/bin/python is more or less guaranteed to mean Python-2 for quite
a bit of time, even while there may be only Python-3 available at some
point of time.

So it does look like we are in for a hard change with regard to
distributed LilyPond versions anyway.  However, the configure process
very well could substitute #!@TARGET_PYTHON@ (most installed scripts) as
well as #!@PYTHON@ (the build scripts) with either a Python-2 or a
Python-3 hashbang, depending on availability/configuration of either
option.

So we definitely have a use case for supporting both: then a choice can
be made by scripts or user at configure time.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread Werner LEMBERG

> So far we only have an offer for a hard and incompatible transition
> to Python3-only

Actually, I dislike this.  Similar to you, I don't see a convincing
reason to not write python code that is compatible with both version 2
and version 3.


Werner

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread BB

If anybody likes to check the difference between 2-3 here are just two links
https://docs.python.org/3/whatsnew/3.0.html
http://www.cs.carleton.edu/faculty/jgoldfea/cs201/spring11/Python2vs3.pdf

There are many more docs on internet dealing with the version 
differences ...



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread David Kastrup
"m.tarensk...@zonnet.nl"  writes:

> Has anyone considered using the six library? Six has helped me a lot
> in my own Python projects to write code that is compatible with both
> python2 and python3.

Well, as long as we have no one considering doing a gradual
python2/python3 transition, there is not much of a point in considering
a library facilitating it, is there?

So far we only have an offer for a hard and incompatible transition to
Python3-only (and the point of my contributions to that discussion was
just to make it clear how much work that might actually mean), and it is
my completely uninformed guess that a library supposed to help with
maintaining two-way compatible code would not help much for that.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread m.tarensk...@zonnet.nl
Has anyone considered using the six library? Six has helped me a lot in my own Python projects to write code that is compatible with both python2 and python3. MT Oorspronkelijk bericht Onderwerp: Re: Python 3, was Re: ANN: Frescobaldi 2.19.0Van: David Kastrup Aan: Urs Liska Cc: lilypond-user@gnu.orgUrs Liska  writes:> Am 24.04.2016 um 09:56 schrieb David Kastrup:>> Noeck  writes:>>  So how do you define "the default">> As written before: What ships with the default installation.>> >> So python3 needs to be invoked using #!/usr/bin/python3 in the scripts>> (what happens when Python 4 gets created), and we need to either support>> Python2 and Python3 in parallel (including from GUB) _or_ make a hard>> switch where we change _every_ script to use Python3 _and_ change GUB>> from one version to the next.>> >> _And_ Wols insists that he does _not_ want to use a common subset of>> Python2 and Python3 even temporarily but do this right away using>> Python3-only features.>> >> Now having a separate prescribed #!/usr/bin/python3 shebang may seem to>> make testing half-way reliable.  But in reality, the LilyPond code base>> does not contain #!/usr/bin/python to any sizable degree (there is a>> single script which might be an oversight) but instead #!@TARGET_PYTHON@>> so again, there does not seem to be much of an alternative for an>> all-or-nothing approach, and trying to mix this with making use of new>> language features at the same time seems like a logistic nightmare.>> >> OK, but what happens when we face the situation that some distros have> #!/usr/bin/python to Python 2 and other to Python 3?> This is something we can't control at all, so at latest *then* we'd be> in that situation, with the difference that *now* we have at least a> chance to control the transition.>> I think this is about what Federico meant with this Guile 1.8/2> comparison - he didn't mean to say that we are in that situation *now*> but that we might run into it when the decisions of the distros are taken.Our scripts run with either Guile-1.8 or Guile-2.0 as far as I can tell.Which is sort-of a soft transition.  It's just core LilyPond which hasnot yet been ported over to the Guile-2 kernel and linkable libraries.But we have statements here to the effect that those interested in theporting are not interested in using a common subset for the Python3effort (which we won't likely be able to put off forever).  I ampointing out the consequences of such an approach.  It will cause awhole lot of work and fallout, and it's not at all clear to me that thebulk of those consequences will rest on the shoulders of those who wantto have it done in that manner.And I haven't seen _any_ compelling argument yet _why_ there is nouseful common ground between Python2 and Python3 that could do the jobwithout major rewrites of the current code base.-- David Kastrup___lilypond-user mailing listlilypond-user@gnu.orghttps://lists.gnu.org/mailman/listinfo/lilypond-user___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread David Kastrup
Urs Liska  writes:

> Am 24.04.2016 um 09:56 schrieb David Kastrup:
>> Noeck  writes:
>> 
 So how do you define "the default"
>>>
>>> As written before: What ships with the default installation.
>> 
>> So python3 needs to be invoked using #!/usr/bin/python3 in the scripts
>> (what happens when Python 4 gets created), and we need to either support
>> Python2 and Python3 in parallel (including from GUB) _or_ make a hard
>> switch where we change _every_ script to use Python3 _and_ change GUB
>> from one version to the next.
>> 
>> _And_ Wols insists that he does _not_ want to use a common subset of
>> Python2 and Python3 even temporarily but do this right away using
>> Python3-only features.
>> 
>> Now having a separate prescribed #!/usr/bin/python3 shebang may seem to
>> make testing half-way reliable.  But in reality, the LilyPond code base
>> does not contain #!/usr/bin/python to any sizable degree (there is a
>> single script which might be an oversight) but instead #!@TARGET_PYTHON@
>> so again, there does not seem to be much of an alternative for an
>> all-or-nothing approach, and trying to mix this with making use of new
>> language features at the same time seems like a logistic nightmare.
>> 
>
> OK, but what happens when we face the situation that some distros have
> #!/usr/bin/python to Python 2 and other to Python 3?
> This is something we can't control at all, so at latest *then* we'd be
> in that situation, with the difference that *now* we have at least a
> chance to control the transition.
>
> I think this is about what Federico meant with this Guile 1.8/2
> comparison - he didn't mean to say that we are in that situation *now*
> but that we might run into it when the decisions of the distros are taken.

Our scripts run with either Guile-1.8 or Guile-2.0 as far as I can tell.
Which is sort-of a soft transition.  It's just core LilyPond which has
not yet been ported over to the Guile-2 kernel and linkable libraries.

But we have statements here to the effect that those interested in the
porting are not interested in using a common subset for the Python3
effort (which we won't likely be able to put off forever).  I am
pointing out the consequences of such an approach.  It will cause a
whole lot of work and fallout, and it's not at all clear to me that the
bulk of those consequences will rest on the shoulders of those who want
to have it done in that manner.

And I haven't seen _any_ compelling argument yet _why_ there is no
useful common ground between Python2 and Python3 that could do the job
without major rewrites of the current code base.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread Federico Bruni
On Sun, Apr 24, 2016 at 09:44:33AM +0200, Thomas Morley wrote:
> 
> As a side-note, midi2ly needs our shipped python-version. It stopps
> working even with my system-python, i.e. 2.7.9.
> Not sure, whether this requires a bugreport, because there is no bug
> with lily's python...
> 

I will add a comment to the first of these two issues (and mark the second as 
duplicate):
https://sourceforge.net/p/testlilyissues/issues/1895/
https://sourceforge.net/p/testlilyissues/issues/1895/


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread David Kastrup
Thomas Morley  writes:

> 2016-04-23 11:35 GMT+02:00 Andrew Bernard :
>> Pardon my ignorance but why do you want to support a common subset?
>> For what purpose? The whole point of Python 3 is that it breaks 2 in
>> order to become a superior and more consistent langauge. It’s been
>> out since 2008, an eternity in IT terms. Please help me understand.
>>
>> Andrew
>>
>>
>>
>>
>>
>> On 23/04/2016, 6:33 PM, "David Kastrup"  wrote:
>>
>>>Well, unless there are really compelling reasons otherwise, sticking
>>>with a common subset (namely making it work with Python 3 while keeping
>>>it working with Python 2) would seem like the sanest option.
>
>
> As a side-note, midi2ly needs our shipped python-version. It stopps
> working even with my system-python, i.e. 2.7.9.
> Not sure, whether this requires a bugreport, because there is no bug
> with lily's python...

In my opinion it does.  At least unless the problem consists in missing
libraries.  Then it may need mentioning in the dependencies (unless
already listed there), and it may be worth checking that system
packagings of LilyPond also have the requisite dependencies.

But if there is a bona-fide language version problem with midi2ly, of
course it's a bug.  Our prepackaged binaries are a service and
convenience for LilyPond users, but "the" LilyPond is just the source
code.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread Urs Liska
Am 24.04.2016 um 09:56 schrieb David Kastrup:
> Noeck  writes:
> 
>>> So how do you define "the default"
>>
>> As written before: What ships with the default installation.
> 
> So python3 needs to be invoked using #!/usr/bin/python3 in the scripts
> (what happens when Python 4 gets created), and we need to either support
> Python2 and Python3 in parallel (including from GUB) _or_ make a hard
> switch where we change _every_ script to use Python3 _and_ change GUB
> from one version to the next.
> 
> _And_ Wols insists that he does _not_ want to use a common subset of
> Python2 and Python3 even temporarily but do this right away using
> Python3-only features.
> 
> Now having a separate prescribed #!/usr/bin/python3 shebang may seem to
> make testing half-way reliable.  But in reality, the LilyPond code base
> does not contain #!/usr/bin/python to any sizable degree (there is a
> single script which might be an oversight) but instead #!@TARGET_PYTHON@
> so again, there does not seem to be much of an alternative for an
> all-or-nothing approach, and trying to mix this with making use of new
> language features at the same time seems like a logistic nightmare.
> 

OK, but what happens when we face the situation that some distros have
#!/usr/bin/python to Python 2 and other to Python 3?
This is something we can't control at all, so at latest *then* we'd be
in that situation, with the difference that *now* we have at least a
chance to control the transition.

I think this is about what Federico meant with this Guile 1.8/2
comparison - he didn't mean to say that we are in that situation *now*
but that we might run into it when the decisions of the distros are taken.

Urs

-- 
Urs Liska
www.openlilylib.org

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread David Kastrup
Noeck  writes:

>> So how do you define "the default"
>
> As written before: What ships with the default installation.

So python3 needs to be invoked using #!/usr/bin/python3 in the scripts
(what happens when Python 4 gets created), and we need to either support
Python2 and Python3 in parallel (including from GUB) _or_ make a hard
switch where we change _every_ script to use Python3 _and_ change GUB
from one version to the next.

_And_ Wols insists that he does _not_ want to use a common subset of
Python2 and Python3 even temporarily but do this right away using
Python3-only features.

Now having a separate prescribed #!/usr/bin/python3 shebang may seem to
make testing half-way reliable.  But in reality, the LilyPond code base
does not contain #!/usr/bin/python to any sizable degree (there is a
single script which might be an oversight) but instead #!@TARGET_PYTHON@
so again, there does not seem to be much of an alternative for an
all-or-nothing approach, and trying to mix this with making use of new
language features at the same time seems like a logistic nightmare.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread Thomas Morley
2016-04-23 11:35 GMT+02:00 Andrew Bernard :
> Pardon my ignorance but why do you want to support a common subset? For what 
> purpose? The whole point of Python 3 is that it breaks 2 in order to become a 
> superior and more consistent langauge. It’s been out since 2008, an eternity 
> in IT terms. Please help me understand.
>
> Andrew
>
>
>
>
>
> On 23/04/2016, 6:33 PM, "David Kastrup"  wrote:
>
>>Well, unless there are really compelling reasons otherwise, sticking
>>with a common subset (namely making it work with Python 3 while keeping
>>it working with Python 2) would seem like the sanest option.


As a side-note, midi2ly needs our shipped python-version. It stopps
working even with my system-python, i.e. 2.7.9.
Not sure, whether this requires a bugreport, because there is no bug
with lily's python...

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread Noeck
> So how do you define "the default"

As written before: What ships with the default installation.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread David Kastrup
Noeck  writes:

>>> Python 3 is already the default in the latest Ubuntu release.
>> 
>> How do you figure that?  I have an up-to-date Ubuntu and calling "python
>> --version" gives 2.7.11+.
>
> By default, I mean what is installed by default/ships with the default
> installation [1]. /usr/bin/python will point to python2 for some longer
> time as PEP394 [2] requests. And Ubuntu plans to follow that
> recommendation [3].

So how do you define "the default" when /usr/bin/python is Python2?  And
when the package "python" lists as

dak@lola:/usr/local/tmp/lilypond$ dpkg -l python
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name  Version 
ArchitectureDescription
+++-=-===-===-===
ii  python2.7.11-1
i386interactive high-level object-oriented language 
(default version)

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread Noeck

>> Python 3 is already the default in the latest Ubuntu release.
> 
> How do you figure that?  I have an up-to-date Ubuntu and calling "python
> --version" gives 2.7.11+.

By default, I mean what is installed by default/ships with the default
installation [1]. /usr/bin/python will point to python2 for some longer
time as PEP394 [2] requests. And Ubuntu plans to follow that
recommendation [3].

[1]: https://wiki.ubuntu.com/XenialXerus/ReleaseNotes#Python_3
[2]: http://legacy.python.org/dev/peps/pep-0394/
[3]: https://wiki.ubuntu.com/Python/3

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-23 Thread David Kastrup
Noeck  writes:

> And I was not up-to-date in a previous mail: Python 3 is already the
> default in the latest Ubuntu release.

How do you figure that?  I have an up-to-date Ubuntu and calling "python
--version" gives 2.7.11+.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-23 Thread Martin Tarenskeen



On Sat, 23 Apr 2016, Noeck wrote:


And I was not up-to-date in a previous mail: Python 3 is already the
default in the latest Ubuntu release.


Fedora:

https://fedoraproject.org/wiki/Changes/Python_3_as_Default

--

MT

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-23 Thread Noeck
And I was not up-to-date in a previous mail: Python 3 is already the
default in the latest Ubuntu release.

Joram

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-23 Thread Carlo Stemberger
2016-04-23 15:19 GMT+02:00 Federico Bruni :

> I guess that in 4 years Linux distros will "have to" (?) migrate to
> python3.
>

Currently new Debian packages written in Python 2 should be refused:

https://www.debian.org/doc/packaging-manuals/python-policy/ch-python3.html

Ciao,
Carlo
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-23 Thread David Kastrup
Federico Bruni  writes:

> On Sat, Apr 23, 2016 at 02:56:47PM +0200, David Kastrup wrote:
>> 
>> Upgrading to a newer version of GCC stopped our release process from
>> working for several months.  That's exactly the kind of "it should not
>> be a big deal" that you are talking about here.
>> 
>
> That's why the upgrades should be planned in advance before there's
> few time left.
>
> Python 2 will reach end of life in 2020 (no bugfix releases from that date).
> I guess that in 4 years Linux distros will "have to" (?) migrate to python3.
> We might find ourselves in a similar position as for guile1.8/guile2

Guile 1.8 is already the other way round: most distributions only still
support it because of LilyPond.  That's actually a quite more urgent
deal.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-23 Thread Federico Bruni
On Sat, Apr 23, 2016 at 02:56:47PM +0200, David Kastrup wrote:
> 
> Upgrading to a newer version of GCC stopped our release process from
> working for several months.  That's exactly the kind of "it should not
> be a big deal" that you are talking about here.
> 

That's why the upgrades should be planned in advance before there's few time 
left.

Python 2 will reach end of life in 2020 (no bugfix releases from that date).
I guess that in 4 years Linux distros will "have to" (?) migrate to python3.
We might find ourselves in a similar position as for guile1.8/guile2

I would not discourage Andrew.
The task is difficult but it's worth the effort. I hope that he'll try
to tackle it and get support by this community.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-23 Thread David Kastrup
Andrew Bernard  writes:

> Hi David,
>
> But lilypond ships its own internal version of python in
> …lilypond/usr/bin.

Assuming that you install from our precompiled binary packages.
Obviously, that's not what the developers do since they need to run
LilyPond right after compiling it.  Also obviously that is not what the
packagers of distributions do since they compile a native version of
LilyPond and most certainly do not ship versions of Python crosscompiled
by us.

> I am aware the entire ecosystem has to be ported. I am offering to do
> the work.

Check out working on and with GUB for compiling various binaries first
in order to figure out how much work that's actually going to be.
That's a rather big hurdle, and it does not help overly with GNU/Linux
systems (and MacPorts and whatever else) packaging their own
compilations.  But the GUB hurdle of course is our personal showstopper.

> But I don’t understand why the system vesion of python matters. Why do
> we bundle it then?

We only bundle it for our installers, but LilyPond is obviously also
compilable natively.

> Also, python 2 and 3 stand happily side by side on my openSUSE
> systems, ny Ubuntu systems, my Fedora systems, and my Debian
> systems.

But they don't magically don't turn #!/usr/bin/python (or whatever else)
into #!/usr/bin/python3 and the latter will stop working with Python 4
anyway.

> I am having trouble seeing what the issue is. If there comes a
> dependcy on python 3, surely anybody who is capable of downloading and
> installing lilypond can also download and install python 3?

The "surely anybody who is capable of downloading and installing
LilyPond can also ..." argument is nonsense.  We are not trying to prove
mathematically that it is possible to install LilyPond, we are talking
about the kind of practical hurdle imposed here.

If you want to talk about theories, one could compile LilyPond natively
under Windows.  That's what Git also does, requiring the attention of
something like two developers and trailing half a year behind.
LilyPond's Windows version just falls out of our release process,
simultaneously with the rest.

Everything requiring constant effort and attention, even if you think
it's not a big deal, is something that is keeping people from using
LilyPond, or keeping developers from working on more important things.

Upgrading to a newer version of GCC stopped our release process from
working for several months.  That's exactly the kind of "it should not
be a big deal" that you are talking about here.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-23 Thread Andrew Bernard
Hi David,

But lilypond ships its own internal version of python in …lilypond/usr/bin. Is 
this not to shield lilypond from system versions?

In my Ubuntu I have:

$ uname -a
Linux fivefold 4.2.0-35-generic #40-Ubuntu SMP Tue Mar 15 22:15:45 UTC 2016 
x86_64 x86_64 x86_64 GNU/Linux

$ /usr/bin/python --version
Python 2.7.10

and in the lilypond install:



$ ./python
Python 2.4.5 (#1, Apr  5 2015, 13:45:28) 
[GCC 4.9.2] on linux

Clearly a considerably, and not entirely compatible, earlier version - as I 
know, having written a whole lot of python scripts for lilypond in 2.7 before 
realising we are on 2.4.


I am aware the entire ecosystem has to be ported. I am offering to do the work. 
It does not bother me that you think it is ‘unsexy’.

But I don’t understand why the system vesion of python matters. Why do we 
bundle it then?

Also, python 2 and 3 stand happily side by side on my openSUSE systems, ny 
Ubuntu systems, my Fedora systems, and my Debian systems. I am having trouble 
seeing what the issue is. If there comes a dependcy on python 3, surely anybody 
who is capable of downloading and installing lilypond can also download and 
install python 3?

Andrew




On 23/04/2016, 8:57 PM, "David Kastrup"  wrote:

>dak@lola:/usr/local/tmp/lilypond$ uname -a
>Linux lola 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:34:49 UTC 2016 i686 
>i686 i686 GNU/Linux
>dak@lola:/usr/local/tmp/lilypond$ python --version
>Python 2.7.11+
>dak@lola:/usr/local/tmp/lilypond$


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-23 Thread David Kastrup
Andrew Bernard  writes:

>> On 23/04/2016, 6:33 PM, "David Kastrup"  wrote:
>>
>>>Well, unless there are really compelling reasons otherwise, sticking
>>>with a common subset (namely making it work with Python 3 while keeping
>>>it working with Python 2) would seem like the sanest option.
>
> Pardon my ignorance but why do you want to support a common subset?
> For what purpose? The whole point of Python 3 is that it breaks 2 in
> order to become a superior and more consistent langauge. It’s been out
> since 2008, an eternity in IT terms. Please help me understand.

dak@lola:/usr/local/tmp/lilypond$ uname -a
Linux lola 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:34:49 UTC 2016 i686 
i686 i686 GNU/Linux
dak@lola:/usr/local/tmp/lilypond$ python --version
Python 2.7.11+
dak@lola:/usr/local/tmp/lilypond$ 

Without a really compelling reason, using a version of Python not
corresponding to the default version of Python for even the most
up-to-date version of the most common GNU/Linux distribution (which
LilyDev is based on) means that we buy into early adopter problems.  In
particular since we are talking about the whole cross-building
environment for all operating systems we are supporting.

So there is a whole wagonload of additional work and maintenance and
trouble involved with becoming incompatible to Python 2.

As I said: staying compatible with Python 2 while making sure we become
compatible to Python 3 is unsexy work.  It will pave the ground for a
later time where we may follow Ubuntu in making Python 3 the default,
and go there also with GUB.  And after a grace period _after_ that,
using pure Python 3 or later constructs will no longer come at
considerable cost to other people involved with the project.

There is a whole lot of weight to be lifted in connection with becoming
incompatible with Python 2.  Part of the weight will be gone once Ubuntu
itself moves there.  But without an actual plan and the resources for
actually pulling the weight here, it does not seem that declaring the
fallout "somebody else's problem" is going to be the least problematic
option.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-23 Thread Andrew Bernard
Pardon my ignorance but why do you want to support a common subset? For what 
purpose? The whole point of Python 3 is that it breaks 2 in order to become a 
superior and more consistent langauge. It’s been out since 2008, an eternity in 
IT terms. Please help me understand.

Andrew





On 23/04/2016, 6:33 PM, "David Kastrup"  wrote:

>Well, unless there are really compelling reasons otherwise, sticking
>with a common subset (namely making it work with Python 3 while keeping
>it working with Python 2) would seem like the sanest option.


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user