Re: /usr/bin/python2 shebangs

2016-11-09 Thread Paul Wise
On Thu, Nov 10, 2016 at 12:02 AM, Thomas Goirand wrote:

> The point is, some people also use venvs. In a world of Python 3 only,
> some upstream will continue to use /usr/bin/python (IMO, rightly). We
> should be able to provide a default implementation for these scripts.

I think this is a bug in virtualenv:

$ virtualenv -p /usr/bin/python3 test
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/pabs/test/bin/python3
Also creating executable in /home/pabs/test/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
$ virtualenv -p python3 test
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/pabs/test/bin/python3
Also creating executable in /home/pabs/test/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise



Re: /usr/bin/python2 shebangs

2016-11-09 Thread Thomas Goirand
On 11/07/2016 04:21 PM, Scott Kitterman wrote:
> On Monday, November 07, 2016 10:08:25 AM Barry Warsaw wrote:
>> On Nov 07, 2016, at 11:44 AM, Thomas Goirand wrote:
>>> So, I don't agree with you, and believe that gradually using
>>> #!/usr/bin/python2 is a good approach to the transition. IMO, that's
>>> what we should start doing as much as possible.
>>>
>>> If the dependencies for Python itself aren't calculated well with that
>>> shebang, then we should address that to make it right regardless of this
>>> choice.
>>
>> Clearly we won't do anything for Stretch, but we should consider this for
>> Buster.
> 
> I think Thomas' point is valid for upstream work, but it's just wasted effort 
> in Debian.
> 
> Scott K

The point is, some people also use venvs. In a world of Python 3 only,
some upstream will continue to use /usr/bin/python (IMO, rightly). We
should be able to provide a default implementation for these scripts.

Probably the use of update-alternatives, with carefully crafted
priorities, is the way to go (ie: provide /usr/bin/python as python2
with higher priority, but let Python 3 also provide /usr/bin/python if
Python 2 isn't installed).

Cheers,

Thomas Goirand (zigo)



Re: /usr/bin/python2 shebangs

2016-11-07 Thread Scott Kitterman
On Monday, November 07, 2016 10:08:25 AM Barry Warsaw wrote:
> On Nov 07, 2016, at 11:44 AM, Thomas Goirand wrote:
> >So, I don't agree with you, and believe that gradually using
> >#!/usr/bin/python2 is a good approach to the transition. IMO, that's
> >what we should start doing as much as possible.
> >
> >If the dependencies for Python itself aren't calculated well with that
> >shebang, then we should address that to make it right regardless of this
> >choice.
> 
> Clearly we won't do anything for Stretch, but we should consider this for
> Buster.

I think Thomas' point is valid for upstream work, but it's just wasted effort 
in Debian.

Scott K



Re: /usr/bin/python2 shebangs

2016-11-07 Thread Barry Warsaw
On Nov 07, 2016, at 11:44 AM, Thomas Goirand wrote:

>So, I don't agree with you, and believe that gradually using
>#!/usr/bin/python2 is a good approach to the transition. IMO, that's
>what we should start doing as much as possible.
>
>If the dependencies for Python itself aren't calculated well with that
>shebang, then we should address that to make it right regardless of this
>choice.

Clearly we won't do anything for Stretch, but we should consider this for
Buster.

Cheers,
-Barry



Re: /usr/bin/python2 shebangs

2016-11-07 Thread Thomas Goirand
On 11/01/2016 11:03 PM, Scott Kitterman wrote:
> On Tuesday, November 01, 2016 05:14:21 PM Barry Warsaw wrote:
>> On Nov 01, 2016, at 11:34 AM, Scott Kitterman wrote:
>>> I don't think /usr/bin/python should ever point to a python3 version.  It
>>> should be dropped when python2.7 is removed.  I think the existence of
>>> /usr/bin/python2 is a limited to a work around for a specific distros
>>> insanity.  There's no need to encourage it's use in Debian as that
>>> particular insanity hasn't and won't (as long as I'm a python*-defaults
>>> co-maintainer).
>>>
>>> P.S. But I think you already knew how I feel about it.  ;-)
>>
>> Oh yes, I knew. :)
>>
>> Okay, so you don't think we should ever shebang scripts to /usr/bin/python2.
>> Maybe lintian should warn specifically against that then?
>>
>> (I still think /usr/bin/python2 is the better long term path, but I don't
>> feel strongly enough about it to advocate a formal transition.)
>>
>> Cheers,
>> -Barry
> 
> Given that we provide /usr/bin/python2 in all supported releases, I don't 
> think it's use is actively harmful, but neither do I think should it be any 
> kind of goal.
> 
> Even after python2.7 is removed from Debian, there will still be users who 
> keep a local copy because they couldn't migrate things due to $REASONS.  Re-
> using /usr/bin/python for a python3 version won't accomplish anything more 
> than gratuitously break such setups.

It does serve the purpose of providing /usr/bin/python for upstream
source which works with Python 3 and use #!/usr/bin/python (if they
don't care if the python version is 2 or 3, that's what IMO they should
rightly do).

So, I don't agree with you, and believe that gradually using
#!/usr/bin/python2 is a good approach to the transition. IMO, that's
what we should start doing as much as possible.

If the dependencies for Python itself aren't calculated well with that
shebang, then we should address that to make it right regardless of this
choice.

Cheers,

Thomas Goirand (zigo)



Re: /usr/bin/python2 shebangs

2016-11-01 Thread Scott Kitterman


On November 1, 2016 8:43:50 PM EDT, Donald Stufft  wrote:
>
>> On Nov 1, 2016, at 6:03 PM, Scott Kitterman 
>wrote:
>> 
>> Even after python2.7 is removed from Debian, there will still be
>users who 
>> keep a local copy because they couldn't migrate things due to
>$REASONS.  Re-
>> using /usr/bin/python for a python3 version won't accomplish anything
>more 
>> than gratuitously break such setups.
>
>
>/usr/bin/python3 being Python 4.x is a bit weird though, and it’s
>likely that Python 4.x is not going to be another break the world
>release.

It's true that it's less pretty to ditch /usr/bin/python, but I'll take the 
slightly uglier approach if it keeps local python installs from breaking.  YMMV.

Scott K



Re: /usr/bin/python2 shebangs

2016-11-01 Thread Donald Stufft

> On Nov 1, 2016, at 6:03 PM, Scott Kitterman  wrote:
> 
> Even after python2.7 is removed from Debian, there will still be users who 
> keep a local copy because they couldn't migrate things due to $REASONS.  Re-
> using /usr/bin/python for a python3 version won't accomplish anything more 
> than gratuitously break such setups.


/usr/bin/python3 being Python 4.x is a bit weird though, and it’s likely that 
Python 4.x is not going to be another break the world release.

—
Donald Stufft





Re: /usr/bin/python2 shebangs

2016-11-01 Thread Scott Kitterman
On Tuesday, November 01, 2016 05:14:21 PM Barry Warsaw wrote:
> On Nov 01, 2016, at 11:34 AM, Scott Kitterman wrote:
> >I don't think /usr/bin/python should ever point to a python3 version.  It
> >should be dropped when python2.7 is removed.  I think the existence of
> >/usr/bin/python2 is a limited to a work around for a specific distros
> >insanity.  There's no need to encourage it's use in Debian as that
> >particular insanity hasn't and won't (as long as I'm a python*-defaults
> >co-maintainer).
> >
> >P.S. But I think you already knew how I feel about it.  ;-)
> 
> Oh yes, I knew. :)
> 
> Okay, so you don't think we should ever shebang scripts to /usr/bin/python2.
> Maybe lintian should warn specifically against that then?
> 
> (I still think /usr/bin/python2 is the better long term path, but I don't
> feel strongly enough about it to advocate a formal transition.)
> 
> Cheers,
> -Barry

Given that we provide /usr/bin/python2 in all supported releases, I don't 
think it's use is actively harmful, but neither do I think should it be any 
kind of goal.

Even after python2.7 is removed from Debian, there will still be users who 
keep a local copy because they couldn't migrate things due to $REASONS.  Re-
using /usr/bin/python for a python3 version won't accomplish anything more 
than gratuitously break such setups.

While Debian has a technically proficient, capable user base that can work 
through all kinds of issues associated with local requirements, I don't think 
we should make it any harder than necessary.

Scott K



Re: /usr/bin/python2 shebangs

2016-11-01 Thread Barry Warsaw
On Nov 01, 2016, at 11:34 AM, Scott Kitterman wrote:

>I don't think /usr/bin/python should ever point to a python3 version.  It
>should be dropped when python2.7 is removed.  I think the existence of
>/usr/bin/python2 is a limited to a work around for a specific distros
>insanity.  There's no need to encourage it's use in Debian as that particular
>insanity hasn't and won't (as long as I'm a python*-defaults co-maintainer).
>
>P.S. But I think you already knew how I feel about it.  ;-)

Oh yes, I knew. :)

Okay, so you don't think we should ever shebang scripts to /usr/bin/python2.
Maybe lintian should warn specifically against that then?

(I still think /usr/bin/python2 is the better long term path, but I don't feel
strongly enough about it to advocate a formal transition.)

Cheers,
-Barry



Re: /usr/bin/python2 shebangs

2016-11-01 Thread Scott Kitterman


On November 1, 2016 10:28:01 AM EDT, Barry Warsaw  wrote:
>Over in #834193, a user is asking for a /usr/bin/pip2 to mirror
>/usr/bin/pip
>because some uses cases apparently prefer pip2 over pip.  That seems
>like a
>reasonable request on the face of it, and easy to support.
>
>However, I thought, well why not shebang pip2 to /usr/bin/python2
>because 1)
>it would parallel the script name; 2) I do think it would be in our
>best long
>term interest to start shebanging system scripts explicitly with
>python3 or
>python2 as appropriate.  Yes, I know that we don't intend to make
>/usr/bin/python be Python 3 any time soon, but maybe someday we'll
>change our
>minds and PEP 394 will embrace that strategy across Linux distros.
>
>In any case, it produces a mild lintian complaint:
>
>E: python-pip: python-script-but-no-python-dep usr/bin/pip2
>
>Of course the /usr/bin/python shebanged /usr/bin/pip doesn't produce
>that
>warning, and the package's Depends properly has ${python:Depends}.  I
>think
>lintian is wrong, but I'd like to hear any other opinions.

I don't think /usr/bin/python should ever point to a python3 version.  It 
should be dropped when python2.7 is removed.  I think the existence of 
/usr/bin/python2 is a limited to a work around for a specific distros insanity. 
 There's no need to encourage it's use in Debian as that particular insanity 
hasn't and won't (as long as I'm a python*-defaults co-maintainer).

Scott K

P.S. But I think you already knew how I feel about it.  ;-)