Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-17 Thread Brett Cannon
On Tue, Nov 14, 2017, 04:06 Stephan Houben,  wrote:

> Hi Brett,
>
> The current documentation *cannot* be fixed, since
> fixing it would entail adding an initial two-page essay
> on "how to start Python on various platforms/systems"
> (it is really NOT as simple as Windows=python, Linux=python3)
> and such a PR will certainly by rejected.
>

It doesn't have to be in the venv' docs. Such a page could be a HOWTO or in
the tutorial (if it isn't already there).


> In my opinion, the only alternatives are
>
> 1. either harmonize the invocation of python across platforms
>   (and *then* adapt the docs to follow).
>   Which was pretty much the whole topic of this thread so far.
>

The idea has been discussed of developing a 'py' command fo all OSs like on
Windows, but has never gone beyond just a discussion.


> 2. or just use "python" consistently across all docs
>   (since that is the *only* command which is at least consistent among
>python.org installers), and add weasel-wording to "consult
> documentation
>   of third-party installers"
>

While 'python' is 'python2' on operating systems that won't really work out
well. Best you could do is 'python3'.


> 3. or leave the docs broken for at least some people some of the time.
>

I'm eyeing the removal of pyvenv come February when we fork for 3.8
development so I'm personally not planning to try and clarify anything
(obviously others can make an attempt).

-brett



> Stephan
>
>
> 2017-11-14 2:31 GMT+01:00 Brett Cannon :
>
>>
>>
>> On Mon, Nov 13, 2017, 00:01 Stephan Houben,  wrote:
>>
>>> Hi all,
>>>
>>> Related to this text on https://docs.python.org/3/library/venv.html :
>>>
>>> 
>>>
>>>  Note
>>>   The pyvenv script has been deprecated as of Python 3.6 in favor of
>>>   using python3 -m venv to help prevent any potential confusion as to
>>>   which Python interpreter a virtual environment will be based on.
>>> 
>>>
>>> It's clearer than the text below to which I originally referred.
>>>
>>> However,  this text has also problems in that it is too unix-specific.
>>> In particular:
>>> * Most seriously, it refers to "python3" which doesn't work with the
>>> python.org Windows installer.
>>>
>>
>> It can, but it's opt-in. It's just one of those things that's easy to
>> forget.
>>
>> * Less seriously, it refers to "pyenv" as a "script" which is unix jargon
>>> and moreover technically
>>>incorrect on Windows. (Also, needlessly specific, it should just be
>>> "the pyenv command",
>>>   how it is implemented is irrelevant for this section).
>>>
>>
>> I disagree with this as Python refers to .Py files that you execute
>> directly as "scripts", so I don't think this requires clarification.
>>
>>
>> Anyway, a pull request with suggested wording to address your concerns
>> would be the best way to try and rectify the issue.
>>
>> -brett
>>
>>
>>
>>> Stephan
>>>
>>> 2017-11-13 0:32 GMT+01:00 Chris Angelico :
>>>
 On Mon, Nov 13, 2017 at 10:29 AM, Nick Coghlan 
 wrote:
 > On 13 November 2017 at 07:11, Chris Angelico 
 wrote:
 >> On Mon, Nov 13, 2017 at 6:24 AM, Stephan Houben <
 stephan...@gmail.com> wrote:
 >>> Hi Antoine,
 >>>
 >>> The venv module is included,
 >>> however the pyvenv script is in a separate package
 >>> python3.5-venv .
 >>>
 >>> By the way, I was totally confused by the following text form the
 doc.
 >>>
 >>> https://docs.python.org/3/library/venv.html
 >>>
 >>> 
 >>> Deprecated since version 3.6: pyvenv was the recommended tool for
 creating
 >>> virtual environments for Python 3.3 and 3.4, and is deprecated in
 Python
 >>> 3.6.
 >>>
 >>> Changed in version 3.5: The use of venv is now recommended for
 creating
 >>> virtual environments.
 >>>
 >>> 
 >>
 >> Not sure where you're reading that. I'm seeing:
 >>
 >> """
 >> Note
 >> The pyvenv script has been deprecated as of Python 3.6 in favor of
 >> using python3 -m venv to help prevent any potential confusion as to
 >> which Python interpreter a virtual environment will be based on.
 >> """
 >>
 >> I think that's pretty clear. "python3 -m venv env" is the standard
 and
 >> recommended way to spin up a virtual environment.
 >
 > It's further down in the page, under
 >
 https://docs.python.org/3/library/venv.html#creating-virtual-environments
 >
 > I think the deprecation notice for pyvenv should just be deleted,
 > since it renders like the *module* is deprecated.

 Ah, I see it now, thanks.

 Agreed; or maybe downgrade it to a parenthetical comment. Focus on
 "this is how to do the obvious thing", and only as an afterthought
 mention "it used to be done differently" in case someone greps for
 pyvenv.

 ChrisA
 ___
 Python-ideas mailing list
 Python-ideas@python.org
>>>

Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-14 Thread Stephan Houben
Hi Brett,

The current documentation *cannot* be fixed, since
fixing it would entail adding an initial two-page essay
on "how to start Python on various platforms/systems"
(it is really NOT as simple as Windows=python, Linux=python3)
and such a PR will certainly by rejected.

In my opinion, the only alternatives are

1. either harmonize the invocation of python across platforms
  (and *then* adapt the docs to follow).
  Which was pretty much the whole topic of this thread so far.

2. or just use "python" consistently across all docs
  (since that is the *only* command which is at least consistent among
   python.org installers), and add weasel-wording to "consult documentation
  of third-party installers"

3. or leave the docs broken for at least some people some of the time.

Stephan


2017-11-14 2:31 GMT+01:00 Brett Cannon :

>
>
> On Mon, Nov 13, 2017, 00:01 Stephan Houben,  wrote:
>
>> Hi all,
>>
>> Related to this text on https://docs.python.org/3/library/venv.html :
>>
>> 
>>
>>  Note
>>   The pyvenv script has been deprecated as of Python 3.6 in favor of
>>   using python3 -m venv to help prevent any potential confusion as to
>>   which Python interpreter a virtual environment will be based on.
>> 
>>
>> It's clearer than the text below to which I originally referred.
>>
>> However,  this text has also problems in that it is too unix-specific.
>> In particular:
>> * Most seriously, it refers to "python3" which doesn't work with the
>> python.org Windows installer.
>>
>
> It can, but it's opt-in. It's just one of those things that's easy to
> forget.
>
> * Less seriously, it refers to "pyenv" as a "script" which is unix jargon
>> and moreover technically
>>incorrect on Windows. (Also, needlessly specific, it should just be
>> "the pyenv command",
>>   how it is implemented is irrelevant for this section).
>>
>
> I disagree with this as Python refers to .Py files that you execute
> directly as "scripts", so I don't think this requires clarification.
>
>
> Anyway, a pull request with suggested wording to address your concerns
> would be the best way to try and rectify the issue.
>
> -brett
>
>
>
>> Stephan
>>
>> 2017-11-13 0:32 GMT+01:00 Chris Angelico :
>>
>>> On Mon, Nov 13, 2017 at 10:29 AM, Nick Coghlan 
>>> wrote:
>>> > On 13 November 2017 at 07:11, Chris Angelico  wrote:
>>> >> On Mon, Nov 13, 2017 at 6:24 AM, Stephan Houben 
>>> wrote:
>>> >>> Hi Antoine,
>>> >>>
>>> >>> The venv module is included,
>>> >>> however the pyvenv script is in a separate package
>>> >>> python3.5-venv .
>>> >>>
>>> >>> By the way, I was totally confused by the following text form the
>>> doc.
>>> >>>
>>> >>> https://docs.python.org/3/library/venv.html
>>> >>>
>>> >>> 
>>> >>> Deprecated since version 3.6: pyvenv was the recommended tool for
>>> creating
>>> >>> virtual environments for Python 3.3 and 3.4, and is deprecated in
>>> Python
>>> >>> 3.6.
>>> >>>
>>> >>> Changed in version 3.5: The use of venv is now recommended for
>>> creating
>>> >>> virtual environments.
>>> >>>
>>> >>> 
>>> >>
>>> >> Not sure where you're reading that. I'm seeing:
>>> >>
>>> >> """
>>> >> Note
>>> >> The pyvenv script has been deprecated as of Python 3.6 in favor of
>>> >> using python3 -m venv to help prevent any potential confusion as to
>>> >> which Python interpreter a virtual environment will be based on.
>>> >> """
>>> >>
>>> >> I think that's pretty clear. "python3 -m venv env" is the standard and
>>> >> recommended way to spin up a virtual environment.
>>> >
>>> > It's further down in the page, under
>>> > https://docs.python.org/3/library/venv.html#creating-
>>> virtual-environments
>>> >
>>> > I think the deprecation notice for pyvenv should just be deleted,
>>> > since it renders like the *module* is deprecated.
>>>
>>> Ah, I see it now, thanks.
>>>
>>> Agreed; or maybe downgrade it to a parenthetical comment. Focus on
>>> "this is how to do the obvious thing", and only as an afterthought
>>> mention "it used to be done differently" in case someone greps for
>>> pyvenv.
>>>
>>> ChrisA
>>> ___
>>> Python-ideas mailing list
>>> Python-ideas@python.org
>>> https://mail.python.org/mailman/listinfo/python-ideas
>>> Code of Conduct: http://python.org/psf/codeofconduct/
>>>
>>
>> ___
>> Python-ideas mailing list
>> Python-ideas@python.org
>> https://mail.python.org/mailman/listinfo/python-ideas
>> Code of Conduct: http://python.org/psf/codeofconduct/
>>
>
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-13 Thread Brett Cannon
On Mon, Nov 13, 2017, 00:01 Stephan Houben,  wrote:

> Hi all,
>
> Related to this text on https://docs.python.org/3/library/venv.html :
>
> 
>
>  Note
>   The pyvenv script has been deprecated as of Python 3.6 in favor of
>   using python3 -m venv to help prevent any potential confusion as to
>   which Python interpreter a virtual environment will be based on.
> 
>
> It's clearer than the text below to which I originally referred.
>
> However,  this text has also problems in that it is too unix-specific.
> In particular:
> * Most seriously, it refers to "python3" which doesn't work with the
> python.org Windows installer.
>

It can, but it's opt-in. It's just one of those things that's easy to
forget.

* Less seriously, it refers to "pyenv" as a "script" which is unix jargon
> and moreover technically
>incorrect on Windows. (Also, needlessly specific, it should just be
> "the pyenv command",
>   how it is implemented is irrelevant for this section).
>

I disagree with this as Python refers to .Py files that you execute
directly as "scripts", so I don't think this requires clarification.


Anyway, a pull request with suggested wording to address your concerns
would be the best way to try and rectify the issue.

-brett



> Stephan
>
> 2017-11-13 0:32 GMT+01:00 Chris Angelico :
>
>> On Mon, Nov 13, 2017 at 10:29 AM, Nick Coghlan 
>> wrote:
>> > On 13 November 2017 at 07:11, Chris Angelico  wrote:
>> >> On Mon, Nov 13, 2017 at 6:24 AM, Stephan Houben 
>> wrote:
>> >>> Hi Antoine,
>> >>>
>> >>> The venv module is included,
>> >>> however the pyvenv script is in a separate package
>> >>> python3.5-venv .
>> >>>
>> >>> By the way, I was totally confused by the following text form the doc.
>> >>>
>> >>> https://docs.python.org/3/library/venv.html
>> >>>
>> >>> 
>> >>> Deprecated since version 3.6: pyvenv was the recommended tool for
>> creating
>> >>> virtual environments for Python 3.3 and 3.4, and is deprecated in
>> Python
>> >>> 3.6.
>> >>>
>> >>> Changed in version 3.5: The use of venv is now recommended for
>> creating
>> >>> virtual environments.
>> >>>
>> >>> 
>> >>
>> >> Not sure where you're reading that. I'm seeing:
>> >>
>> >> """
>> >> Note
>> >> The pyvenv script has been deprecated as of Python 3.6 in favor of
>> >> using python3 -m venv to help prevent any potential confusion as to
>> >> which Python interpreter a virtual environment will be based on.
>> >> """
>> >>
>> >> I think that's pretty clear. "python3 -m venv env" is the standard and
>> >> recommended way to spin up a virtual environment.
>> >
>> > It's further down in the page, under
>> >
>> https://docs.python.org/3/library/venv.html#creating-virtual-environments
>> >
>> > I think the deprecation notice for pyvenv should just be deleted,
>> > since it renders like the *module* is deprecated.
>>
>> Ah, I see it now, thanks.
>>
>> Agreed; or maybe downgrade it to a parenthetical comment. Focus on
>> "this is how to do the obvious thing", and only as an afterthought
>> mention "it used to be done differently" in case someone greps for
>> pyvenv.
>>
>> ChrisA
>> ___
>> Python-ideas mailing list
>> Python-ideas@python.org
>> https://mail.python.org/mailman/listinfo/python-ideas
>> Code of Conduct: http://python.org/psf/codeofconduct/
>>
>
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-13 Thread Nick Coghlan
On 13 November 2017 at 20:43, Antoine Pitrou  wrote:
> On Mon, 13 Nov 2017 11:17:54 +0100
> Petr Viktorin  wrote:
>> >
>> > Wow.  I had forgotten Debian could be such a user-hostile
>> > distribution.  I'm not sure what the reason would be to use it as a
>> > basis for a training course in Python programming, then (other than the
>> > teacher having their own ideological preferences).
>>
>> For us, it's the *student's* preference. I believe it's better to let
>> students use the machine and environment they're used to, even if it
>> means extra trouble for the instructors.
>> So, we get a healthy mix of Windows, Mac, Debian, Fedora, and sometimes
>> some surprises.
>
> In that case the student must be ready to deal with the perils of their
> own preferences.

It's also currently missing from
https://packaging.python.org/guides/installing-using-linux-tools/, but
we can amend that now that we know what the required fix is.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-13 Thread Antoine Pitrou
On Mon, 13 Nov 2017 11:17:54 +0100
Petr Viktorin  wrote:
> > 
> > Wow.  I had forgotten Debian could be such a user-hostile
> > distribution.  I'm not sure what the reason would be to use it as a
> > basis for a training course in Python programming, then (other than the
> > teacher having their own ideological preferences).  
> 
> For us, it's the *student's* preference. I believe it's better to let 
> students use the machine and environment they're used to, even if it 
> means extra trouble for the instructors.
> So, we get a healthy mix of Windows, Mac, Debian, Fedora, and sometimes 
> some surprises.

In that case the student must be ready to deal with the perils of their
own preferences.

Regards

Antoine.


___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-13 Thread Petr Viktorin

On 11/13/2017 11:05 AM, Antoine Pitrou wrote:

On Mon, 13 Nov 2017 12:32:06 +1000
Nick Coghlan  wrote:

On 13 November 2017 at 04:38, Antoine Pitrou  wrote:

On Sun, 12 Nov 2017 12:20:45 +
Paul Moore  wrote:
  

Well, not exactly. Do you do python -m venv, or py -x.x -m venv or
pythonx -m venv ? Wait, it's not installed by default on debian.


Seriously? Debian don't provide venv in the standard Python install?
That's just broken.


Frankly, I don't know where the current discussion comes from, but on
two recent Debian and Ubuntu setups, I get:

$ dpkg -S /usr/lib/python3.5/venv/__init__.py
libpython3.5-stdlib:amd64: /usr/lib/python3.5/venv/__init__.py


The discussion comes from the fact that even though the code is
present it doesn't actually work:

[...]

Wow.  I had forgotten Debian could be such a user-hostile
distribution.  I'm not sure what the reason would be to use it as a
basis for a training course in Python programming, then (other than the
teacher having their own ideological preferences).


For us, it's the *student's* preference. I believe it's better to let 
students use the machine and environment they're used to, even if it 
means extra trouble for the instructors.
So, we get a healthy mix of Windows, Mac, Debian, Fedora, and sometimes 
some surprises.


___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-13 Thread Antoine Pitrou
On Mon, 13 Nov 2017 12:32:06 +1000
Nick Coghlan  wrote:
> On 13 November 2017 at 04:38, Antoine Pitrou  wrote:
> > On Sun, 12 Nov 2017 12:20:45 +
> > Paul Moore  wrote:  
> >>  
> >> > Well, not exactly. Do you do python -m venv, or py -x.x -m venv or
> >> > pythonx -m venv ? Wait, it's not installed by default on debian.  
> >>
> >> Seriously? Debian don't provide venv in the standard Python install?
> >> That's just broken.  
> >
> > Frankly, I don't know where the current discussion comes from, but on
> > two recent Debian and Ubuntu setups, I get:
> >
> > $ dpkg -S /usr/lib/python3.5/venv/__init__.py
> > libpython3.5-stdlib:amd64: /usr/lib/python3.5/venv/__init__.py  
> 
> The discussion comes from the fact that even though the code is
> present it doesn't actually work:
[...]

Wow.  I had forgotten Debian could be such a user-hostile
distribution.  I'm not sure what the reason would be to use it as a
basis for a training course in Python programming, then (other than the
teacher having their own ideological preferences).

Regards

Antoine.


___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-13 Thread Nick Coghlan
On 13 November 2017 at 17:46, Stephan Houben  wrote:
> 2017-11-13 3:32 GMT+01:00 Nick Coghlan :
>> So technically it's ensurepip that's broken by default, but that
>> translates to venv also being broken by default.
>>
>> I haven't worked out what the actual steps needed to fix it are
>
> On Debian, ensurepip  is in the python3.5-venv package.
>
> https://packages.debian.org/stretch/amd64/python3.5-venv/filelist

Thanks! I've tweaked the ncoghlan/debian-python Dockerfile to install
that in addition to the base Python package (as well as finally
enabling automatic rebuilds of that image whenever the base Debian
image updates).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-13 Thread Stephan Houben
Hi all,

Related to this text on https://docs.python.org/3/library/venv.html :


 Note
  The pyvenv script has been deprecated as of Python 3.6 in favor of
  using python3 -m venv to help prevent any potential confusion as to
  which Python interpreter a virtual environment will be based on.


It's clearer than the text below to which I originally referred.

However,  this text has also problems in that it is too unix-specific.
In particular:
* Most seriously, it refers to "python3" which doesn't work with the
python.org Windows installer.
* Less seriously, it refers to "pyenv" as a "script" which is unix jargon
and moreover technically
   incorrect on Windows. (Also, needlessly specific, it should just be "the
pyenv command",
  how it is implemented is irrelevant for this section).

Stephan

2017-11-13 0:32 GMT+01:00 Chris Angelico :

> On Mon, Nov 13, 2017 at 10:29 AM, Nick Coghlan  wrote:
> > On 13 November 2017 at 07:11, Chris Angelico  wrote:
> >> On Mon, Nov 13, 2017 at 6:24 AM, Stephan Houben 
> wrote:
> >>> Hi Antoine,
> >>>
> >>> The venv module is included,
> >>> however the pyvenv script is in a separate package
> >>> python3.5-venv .
> >>>
> >>> By the way, I was totally confused by the following text form the doc.
> >>>
> >>> https://docs.python.org/3/library/venv.html
> >>>
> >>> 
> >>> Deprecated since version 3.6: pyvenv was the recommended tool for
> creating
> >>> virtual environments for Python 3.3 and 3.4, and is deprecated in
> Python
> >>> 3.6.
> >>>
> >>> Changed in version 3.5: The use of venv is now recommended for creating
> >>> virtual environments.
> >>>
> >>> 
> >>
> >> Not sure where you're reading that. I'm seeing:
> >>
> >> """
> >> Note
> >> The pyvenv script has been deprecated as of Python 3.6 in favor of
> >> using python3 -m venv to help prevent any potential confusion as to
> >> which Python interpreter a virtual environment will be based on.
> >> """
> >>
> >> I think that's pretty clear. "python3 -m venv env" is the standard and
> >> recommended way to spin up a virtual environment.
> >
> > It's further down in the page, under
> > https://docs.python.org/3/library/venv.html#creating-
> virtual-environments
> >
> > I think the deprecation notice for pyvenv should just be deleted,
> > since it renders like the *module* is deprecated.
>
> Ah, I see it now, thanks.
>
> Agreed; or maybe downgrade it to a parenthetical comment. Focus on
> "this is how to do the obvious thing", and only as an afterthought
> mention "it used to be done differently" in case someone greps for
> pyvenv.
>
> ChrisA
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-12 Thread Stephan Houben
2017-11-13 3:32 GMT+01:00 Nick Coghlan :

>
> So technically it's ensurepip that's broken by default, but that
> translates to venv also being broken by default.
>
> I haven't worked out what the actual steps needed to fix it are
>


On Debian, ensurepip  is in the python3.5-venv package.

https://packages.debian.org/stretch/amd64/python3.5-venv/filelist

Unfortunately there isn't (AFAIK) a meta-package which just says
"stop fooling around and just give me everything from the python.org
distribution, d*mmit."

Stephan
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-12 Thread Nick Coghlan
On 13 November 2017 at 04:38, Antoine Pitrou  wrote:
> On Sun, 12 Nov 2017 12:20:45 +
> Paul Moore  wrote:
>>
>> > Well, not exactly. Do you do python -m venv, or py -x.x -m venv or
>> > pythonx -m venv ? Wait, it's not installed by default on debian.
>>
>> Seriously? Debian don't provide venv in the standard Python install?
>> That's just broken.
>
> Frankly, I don't know where the current discussion comes from, but on
> two recent Debian and Ubuntu setups, I get:
>
> $ dpkg -S /usr/lib/python3.5/venv/__init__.py
> libpython3.5-stdlib:amd64: /usr/lib/python3.5/venv/__init__.py

The discussion comes from the fact that even though the code is
present it doesn't actually work:

$ docker run --rm -it ncoghlan/debian-python bash
root@e9c0aa482aeb:/# python3 -m venv test_venv
Error: Command '['/test_venv/bin/python3', '-Im', 'ensurepip',
'--upgrade', '--default-pip']' returned non-zero exit status 1

(I just refreshed my Docker image to 9.2, so that's the current
default behaviour after "apt-get install -y python3")

So technically it's ensurepip that's broken by default, but that
translates to venv also being broken by default.

I haven't worked out what the actual steps needed to fix it are (but I
do know that installing "python3-pip" isn't enough the way it is on
Fedora - we reconcile ensurepip with our security management policies
by having a Recommends dep from python3 to python3-pip, and then
patching ensurepip to use rewheel to inject a copy of the system pip
into freshly created virtual environments. At least in theory, Debian
should be able to do something similar with dirtbike, but whether or
not they actually will would be a question for Matthias Klose as the
Debian Python maintainer).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-12 Thread Chris Angelico
On Mon, Nov 13, 2017 at 10:29 AM, Nick Coghlan  wrote:
> On 13 November 2017 at 07:11, Chris Angelico  wrote:
>> On Mon, Nov 13, 2017 at 6:24 AM, Stephan Houben  wrote:
>>> Hi Antoine,
>>>
>>> The venv module is included,
>>> however the pyvenv script is in a separate package
>>> python3.5-venv .
>>>
>>> By the way, I was totally confused by the following text form the doc.
>>>
>>> https://docs.python.org/3/library/venv.html
>>>
>>> 
>>> Deprecated since version 3.6: pyvenv was the recommended tool for creating
>>> virtual environments for Python 3.3 and 3.4, and is deprecated in Python
>>> 3.6.
>>>
>>> Changed in version 3.5: The use of venv is now recommended for creating
>>> virtual environments.
>>>
>>> 
>>
>> Not sure where you're reading that. I'm seeing:
>>
>> """
>> Note
>> The pyvenv script has been deprecated as of Python 3.6 in favor of
>> using python3 -m venv to help prevent any potential confusion as to
>> which Python interpreter a virtual environment will be based on.
>> """
>>
>> I think that's pretty clear. "python3 -m venv env" is the standard and
>> recommended way to spin up a virtual environment.
>
> It's further down in the page, under
> https://docs.python.org/3/library/venv.html#creating-virtual-environments
>
> I think the deprecation notice for pyvenv should just be deleted,
> since it renders like the *module* is deprecated.

Ah, I see it now, thanks.

Agreed; or maybe downgrade it to a parenthetical comment. Focus on
"this is how to do the obvious thing", and only as an afterthought
mention "it used to be done differently" in case someone greps for
pyvenv.

ChrisA
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-12 Thread Nick Coghlan
On 13 November 2017 at 09:29, Nick Coghlan  wrote:
> On 13 November 2017 at 07:11, Chris Angelico  wrote:
>> On Mon, Nov 13, 2017 at 6:24 AM, Stephan Houben  wrote:
>>> Hi Antoine,
>>>
>>> The venv module is included,
>>> however the pyvenv script is in a separate package
>>> python3.5-venv .
>>>
>>> By the way, I was totally confused by the following text form the doc.
>>>
>>> https://docs.python.org/3/library/venv.html
>>>
>>> 
>>> Deprecated since version 3.6: pyvenv was the recommended tool for creating
>>> virtual environments for Python 3.3 and 3.4, and is deprecated in Python
>>> 3.6.
>>>
>>> Changed in version 3.5: The use of venv is now recommended for creating
>>> virtual environments.
>>>
>>> 
>>
>> Not sure where you're reading that. I'm seeing:
>>
>> """
>> Note
>> The pyvenv script has been deprecated as of Python 3.6 in favor of
>> using python3 -m venv to help prevent any potential confusion as to
>> which Python interpreter a virtual environment will be based on.
>> """
>>
>> I think that's pretty clear. "python3 -m venv env" is the standard and
>> recommended way to spin up a virtual environment.
>
> It's further down in the page, under
> https://docs.python.org/3/library/venv.html#creating-virtual-environments
>
> I think the deprecation notice for pyvenv should just be deleted,
> since it renders like the *module* is deprecated.

That is, the confusing one starting with "Deprecated since version
3.6: ...". The note Chris quoted is fine, and should be kept.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-12 Thread Nick Coghlan
On 13 November 2017 at 07:11, Chris Angelico  wrote:
> On Mon, Nov 13, 2017 at 6:24 AM, Stephan Houben  wrote:
>> Hi Antoine,
>>
>> The venv module is included,
>> however the pyvenv script is in a separate package
>> python3.5-venv .
>>
>> By the way, I was totally confused by the following text form the doc.
>>
>> https://docs.python.org/3/library/venv.html
>>
>> 
>> Deprecated since version 3.6: pyvenv was the recommended tool for creating
>> virtual environments for Python 3.3 and 3.4, and is deprecated in Python
>> 3.6.
>>
>> Changed in version 3.5: The use of venv is now recommended for creating
>> virtual environments.
>>
>> 
>
> Not sure where you're reading that. I'm seeing:
>
> """
> Note
> The pyvenv script has been deprecated as of Python 3.6 in favor of
> using python3 -m venv to help prevent any potential confusion as to
> which Python interpreter a virtual environment will be based on.
> """
>
> I think that's pretty clear. "python3 -m venv env" is the standard and
> recommended way to spin up a virtual environment.

It's further down in the page, under
https://docs.python.org/3/library/venv.html#creating-virtual-environments

I think the deprecation notice for pyvenv should just be deleted,
since it renders like the *module* is deprecated.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-12 Thread Chris Angelico
On Mon, Nov 13, 2017 at 6:24 AM, Stephan Houben  wrote:
> Hi Antoine,
>
> The venv module is included,
> however the pyvenv script is in a separate package
> python3.5-venv .
>
> By the way, I was totally confused by the following text form the doc.
>
> https://docs.python.org/3/library/venv.html
>
> 
> Deprecated since version 3.6: pyvenv was the recommended tool for creating
> virtual environments for Python 3.3 and 3.4, and is deprecated in Python
> 3.6.
>
> Changed in version 3.5: The use of venv is now recommended for creating
> virtual environments.
>
> 

Not sure where you're reading that. I'm seeing:

"""
Note
The pyvenv script has been deprecated as of Python 3.6 in favor of
using python3 -m venv to help prevent any potential confusion as to
which Python interpreter a virtual environment will be based on.
"""

I think that's pretty clear. "python3 -m venv env" is the standard and
recommended way to spin up a virtual environment.

ChrisA
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-12 Thread Antoine Pitrou

Hi Stephan,

Le 12/11/2017 à 20:24, Stephan Houben a écrit :
> Hi Antoine,
> 
> The venv module is included,
> however the pyvenv script is in a separate package
> python3.5-venv .

Thanks for the correction.  That's definitely a silly decision --
especially as the "pyvenv" script must be very small anyway, perhaps
even smaller than the package metadata that goes with it?

It's not even internally consistent within Debian, as the "pyvenv"
script is packaged separately but the "pydoc" script is bundled with the
"python package":

$ dpkg -S `which pyvenv`
python3-venv: /usr/bin/pyvenv
$ dpkg -S `which pydoc`
python: /usr/bin/pydoc

(note also how "pyvenv" and not "pyvenv3" is installed by
"python3-venv"...)

> So many questions:
> * What is the status of "pyenv" in 3.5? Apparently it is not deprecated
> there.
> * What is it replaced by? Apparently "venv", but it doesn't say so
> explicitly.
> * Is "venv" the same thing as "python -m venv" discussed earlier? Or is it a
>   different thing? With so many things names so similarly, it is hard to
> tell

I guess so... Personally, I don't think that deprecation was a good
idea.  As Nick says, there is point to be made for short
easy-to-remember commands such as "pyvenv" or "pip install".

> * What does it mean for "venv" to be recommend in 3.5 if "pyvenv" is not
> deprecated there?

Probably that "python -m venv" is the recommended replacement.

> I suppose at that point the newbie gave up and downloaded node.js ;-)

Perhaps not a good idea, but hey :-))

Regards

Antoine.
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-12 Thread Stephan Houben
Hi Antoine,

The venv module is included,
however the pyvenv script is in a separate package
python3.5-venv .

By the way, I was totally confused by the following text form the doc.

https://docs.python.org/3/library/venv.html


Deprecated since version 3.6: pyvenv was the recommended tool for creating
virtual environments for Python 3.3 and 3.4, and is deprecated in Python 3.6
.

Changed in version 3.5: The use of venv is now recommended for creating
virtual environments.


So many questions:
* What is the status of "pyenv" in 3.5? Apparently it is not deprecated
there.
* What is it replaced by? Apparently "venv", but it doesn't say so
explicitly.
* Is "venv" the same thing as "python -m venv" discussed earlier? Or is it a
  different thing? With so many things names so similarly, it is hard to
tell
* What does it mean for "venv" to be recommend in 3.5 if "pyvenv" is not
deprecated there?

Also, the link brings us to a long page of "What's New in Python 3.6" .
Just searching for "venv" only gives the apparently irrelevant:

"venv  accepts a
new parameter --prompt. This parameter provides an alternative prefix for
the virtual environment. (Proposed by Łukasz Balcerzak and ported to 3.6 by
Stéphane Wirtel in bpo-22829 .)
"

I suppose at that point the newbie gave up and downloaded node.js ;-)

Stephan

On Sun, 12 Nov 2017 12:20:45 +

> Paul Moore  wrote:
> >
> > > Well, not exactly. Do you do python -m venv, or py -x.x -m venv or
> > > pythonx -m venv ? Wait, it's not installed by default on debian.
> >
> > Seriously? Debian don't provide venv in the standard Python install?
> > That's just broken.
>
> Frankly, I don't know where the current discussion comes from, but on
> two recent Debian and Ubuntu setups, I get:
>
> $ dpkg -S /usr/lib/python3.5/venv/__init__.py
> libpython3.5-stdlib:amd64: /usr/lib/python3.5/venv/__init__.py
>
>
> Which, for the uninitiated, means "the venv module is provided by the
> Debian/Ubuntu package named libpython3.5-stdlib".  That package is, in
> turn, a dependency of the "python3.5" package.
>
> Regards
>
> Antoine.
>
>
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-12 Thread Paul Moore
On 12 November 2017 at 18:38, Antoine Pitrou  wrote:
> On Sun, 12 Nov 2017 12:20:45 +
> Paul Moore  wrote:
>>
>> > Well, not exactly. Do you do python -m venv, or py -x.x -m venv or
>> > pythonx -m venv ? Wait, it's not installed by default on debian.
>>
>> Seriously? Debian don't provide venv in the standard Python install?
>> That's just broken.
>
> Frankly, I don't know where the current discussion comes from, but on
> two recent Debian and Ubuntu setups, I get:
>
> $ dpkg -S /usr/lib/python3.5/venv/__init__.py
> libpython3.5-stdlib:amd64: /usr/lib/python3.5/venv/__init__.py
>
>
> Which, for the uninitiated, means "the venv module is provided by the
> Debian/Ubuntu package named libpython3.5-stdlib".  That package is, in
> turn, a dependency of the "python3.5" package.

Thanks for the clarification. I was surprised by the assertion, but
didn't have a Debian system to check, so it's good to know it's false.

Paul
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/