[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-28 Thread Eryk Sun
On 2/28/21, Oscar Benjamin wrote: > > Oh, okay. So does that mean that it's always on PATH unless the user > *explicitly unticks* the "install the launcher" box for both single > user and all user installs? If the launcher gets installed, it will be available in PATH. IIRC, the installer only

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-28 Thread Oscar Benjamin
On Mon, 1 Mar 2021 at 00:13, Eryk Sun wrote: > > On 2/28/21, Oscar Benjamin wrote: > > > > - It is possible to configure a default version (although I think you > > have to do it with an environment variable) > > The py launcher in Windows supports a "py.ini" file beside the > executable and in

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-28 Thread Eryk Sun
On 2/28/21, Oscar Benjamin wrote: > > - It is possible to configure a default version (although I think you > have to do it with an environment variable) The py launcher in Windows supports a "py.ini" file beside the executable and in %LocalAppData%. The equivalent of the PY_PYTHON, PY_PYTHON2,

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-28 Thread Wes Turner
Is there a tool that (1) detects import name collisions; and (2) attempts to read package metadata and package file checksums (maybe from the ZIP 'manifest')? In order to: - troubleshoot module shadowing issues - $PATH - sys.path - `python -m site` - incomplete and overlapping

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-28 Thread Oscar Benjamin
On Sun, 28 Feb 2021 at 07:04, Stephen J. Turnbull wrote: > > Jim J. Jewett writes: > > > > which file am I actually running? > > > which interpreter am I actually running? > > > how do I tell the computer to use a different interpreter? > > > > If you need to care about any of these, then

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-28 Thread Jim J. Jewett
> And unlike a venv, "python -m" doesn't let you ensure > that the code executed is the version installed in user site-packages I have had enough problems with this that when I do modify/replace something, I put in a marker that I can check for explicitly. Expecting this marker to run

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-27 Thread Stephen J. Turnbull
Paul Moore writes: > The one thing that *is* substantially worse for Python, is the > circumlocutions needed in the documentation to say how to run Python. > But that's 100% down to us not being willing to say "just type the > command python". And the reason for *that* is mostly historical,

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-27 Thread Stephen J. Turnbull
Jim J. Jewett writes: > > which file am I actually running? > > which interpreter am I actually running? > > how do I tell the computer to use a different interpreter? > > If you need to care about any of these, then the environment is > fighting you -- and the application probably stinks.

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-27 Thread Nick Coghlan
On Wed, 24 Feb 2021 at 10:49, Random832 wrote: > > I was reading a discussion thread > about > various issues with the Debian packaged version of Python, and the following > statement stood out for me as shocking: > > Christian

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-27 Thread Jim J. Jewett
[They are not CS students] > Why is that relevant? Because for many users, python is NOT a programming language; it is an application like any other. It happens to be very powerful and flexible, but the point isn't to program; it is to produce better reports. If the hurdle to get started

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-27 Thread Paul Moore
On Sat, 27 Feb 2021 at 13:03, Oscar Benjamin wrote: > More recently I've been exploring Julia. You could compare these pages: > > https://docs.python.org/3/tutorial/interpreter.html#invoking-the-interpreter > https://docs.julialang.org/en/v1/manual/getting-started/ > > When installing julia you

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-27 Thread Steven D'Aprano
On Sat, Feb 27, 2021 at 12:56:17PM +, Oscar Benjamin wrote: > On Sat, 27 Feb 2021 at 11:04, Paul Moore wrote: > > This is 100% true. (At least the part where you say that "it's a > > problem". I'm not sure if "it doesn't need to be like this" is true - > > can you point to a language where

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-27 Thread Oscar Benjamin
On Sat, 27 Feb 2021 at 11:04, Paul Moore wrote: > > On Sat, 27 Feb 2021 at 01:08, Oscar Benjamin > wrote: > > > > The other point though is that it doesn't need to be like this. If the > > issue was just installing Python and then setting up your PATH then > > that's manageable. The problem is

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-27 Thread Paul Moore
On Sat, 27 Feb 2021 at 01:08, Oscar Benjamin wrote: > > On Fri, 26 Feb 2021 at 23:06, Jim J. Jewett wrote: > > > > I think his point is that most of his students (economics or business, > > rather than comp sci) will never need to use Perl or C or Java. Python is > > friendly enough to be

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Stephen J. Turnbull
Executive summary: This thread is about a "seven blind men and an elephant" problem. Jim J. Jewett writes: > I think his point is that most of his students (economics or > business, rather than comp sci) will never need to use Perl or C or > Java. Python is friendly enough to be useful, but

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Stephen J. Turnbull
Steven D'Aprano writes: > On Fri, Feb 26, 2021 at 11:41:56AM +0900, Stephen J. Turnbull wrote: > > That's what I would mean by basic sys-admin skills. And *surprise!* > > my students don't have them, and don't need them ... until they start > > using Python. > > Is it *only* Python

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Steven D'Aprano
On Sat, Feb 27, 2021 at 01:04:08AM +, Oscar Benjamin wrote: > On Fri, 26 Feb 2021 at 23:06, Jim J. Jewett wrote: > > > > I think his point is that most of his students (economics or > > business, rather than comp sci) will never need to use Perl or C or > > Java. Python is friendly enough

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Oscar Benjamin
On Fri, 26 Feb 2021 at 23:06, Jim J. Jewett wrote: > > I think his point is that most of his students (economics or business, rather > than comp sci) will never need to use Perl or C or Java. Python is friendly > enough to be useful, but this is still a major pain point. Thanks Jim, that is

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Jim J. Jewett
I think his point is that most of his students (economics or business, rather than comp sci) will never need to use Perl or C or Java. Python is friendly enough to be useful, but this is still a major pain point. The problem is made worse because it often hits at the beginning instead of 7

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Paul Moore
On Fri, 26 Feb 2021 at 13:31, Oscar Benjamin wrote: > Where Python is awkward is at the point where you actually *want* to > teach students to use the command line. The problem is that Python is > not set up for command line use out of the box in a consistent way > across different platforms. My

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Oscar Benjamin
On Fri, 26 Feb 2021 at 09:07, Steven D'Aprano wrote: > > On Fri, Feb 26, 2021 at 11:41:56AM +0900, Stephen J. Turnbull wrote: > > Mike Miller writes: > > > > > "sys-admin" is a bit of an overstatement in my phrasing. The core > > > is that you need to understand how a PATH works and be able to

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Steven D'Aprano
On Fri, Feb 26, 2021 at 11:41:56AM +0900, Stephen J. Turnbull wrote: > Mike Miller writes: > > > "sys-admin" is a bit of an overstatement in my phrasing. The core > > is that you need to understand how a PATH works and be able to run > > pip and cd into folders and perhaps run rm/del, etc.

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-25 Thread Stephen J. Turnbull
Mike Miller writes: > "sys-admin" is a bit of an overstatement in my phrasing. The core > is that you need to understand how a PATH works and be able to run > pip and cd into folders and perhaps run rm/del, etc. Basic > command-line skills? That's what I would mean by basic sys-admin

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-25 Thread Wes Turner
One aspect of conda packaging that's worth adopting is the 'test' block of the meta.yaml which contains commands necessary to *test* the built package. You can add a pytest command to setup.py, but it's not as easy as:

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-25 Thread Mike Miller
On 2021-02-24 21:08, Peter Wang wrote: With binary extension modules, version conflicts lead to (at best) runtime segfault and (at worst) subtle *data* bugs that return incorrect results.  There are also deeper concerns around security and reproducibility. If your app has requirements, by

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-25 Thread Fred Drake
On Thu, Feb 25, 2021 at 5:35 AM Wes Turner wrote: > The challenge with version conflicts is often less that you need to go > update the constraints (which has little to do with sysadmin'ing, TBH) and > more that you have insufficient *integration tests* and you're relying upon > something else

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-25 Thread Wes Turner
The challenge with version conflicts is often less that you need to go update the constraints (which has little to do with sysadmin'ing, TBH) and more that you have insufficient *integration tests* and you're relying upon something else running the per-package tears. On Thu, Feb 25, 2021, 00:10

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-24 Thread Peter Wang
On Wed, Feb 24, 2021 at 8:50 PM Mike Miller wrote: > I never understood the fear around version conflicts. With binary extension modules, version conflicts lead to (at best) runtime segfault and (at worst) subtle *data* bugs that return incorrect results. There are also deeper concerns around

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-24 Thread Mike Miller
On 2021-02-24 02:52, Stéfane Fermigier wrote: I have currently 57 apps installed via pipx on my laptop, and the 57 environments take almost 1 GB already. I never understood the fear around version conflicts. Perhaps it has to do with the decline of sys-admin skills over the years? So, the

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-24 Thread Wes Turner
Would it be better to have an (os, os_release, arch) to [site_packages_dirs] map within CPython or are the patches too varied to be replaced by a centralized map and a runtime conditional? For development convenience, having writeable site-packages dirs before unwriteable site-packages is easy;

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-24 Thread Christian Heimes
On 24/02/2021 20.03, Christian Heimes wrote: > On 24/02/2021 19.17, Steve Dower wrote: >> On 2/24/2021 4:26 PM, Christian Heimes wrote: >>> On 24/02/2021 15.16, Random832 wrote: On Wed, Feb 24, 2021, at 06:27, Christian Heimes wrote: > Separate directories don't prevent clashes and system

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-24 Thread Christian Heimes
On 24/02/2021 19.17, Steve Dower wrote: > On 2/24/2021 4:26 PM, Christian Heimes wrote: >> On 24/02/2021 15.16, Random832 wrote: >>> On Wed, Feb 24, 2021, at 06:27, Christian Heimes wrote: Separate directories don't prevent clashes and system breakage. But they provide an easy way

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-24 Thread Paul Moore
On Wed, 24 Feb 2021 at 18:25, Steve Dower wrote: > I mean, this is _precisely_ what PEP 370 defines (including the "-s" > option and PYTHONNOUSERSITE env variable to provide that one-way isolation). > > Is the problem that pip doesn't use it by default? Note that these days, pip *does* use

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-24 Thread Steve Dower
On 2/24/2021 4:26 PM, Christian Heimes wrote: On 24/02/2021 15.16, Random832 wrote: On Wed, Feb 24, 2021, at 06:27, Christian Heimes wrote: Separate directories don't prevent clashes and system breakage. But they provide an easy way to *recover* from a broken system. I think it could be

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-24 Thread Stéfane Fermigier
On Wed, Feb 24, 2021 at 11:43 AM Henk-Jaap Wagenaar < wagenaarhenkj...@gmail.com> wrote: > >> > I've been using pyenv (on MacBooks to be fair, not Linux/Debian) and been > quite happy with that, and it basically does what Jonathan does manually: > clone the github repo and build python from

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-24 Thread Christian Heimes
On 24/02/2021 15.16, Random832 wrote: > On Wed, Feb 24, 2021, at 06:27, Christian Heimes wrote: >> Separate directories don't prevent clashes and system breakage. But they >> provide an easy way to *recover* from a broken system. > > I think it could be turned into a way to prevent them by A)

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-24 Thread Random832
On Wed, Feb 24, 2021, at 06:27, Christian Heimes wrote: > Separate directories don't prevent clashes and system breakage. But they > provide an easy way to *recover* from a broken system. I think it could be turned into a way to prevent them by A) having site-packages always take precedence over

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-24 Thread Christian Heimes
On 24/02/2021 11.52, Stéfane Fermigier wrote: > I love pipx and I'm glad it exists at this point because it make  > > The main issue is that each virtualenv takes space, lots of space. > > I have currently 57 apps installed via pipx on my laptop, and the 57 > environments take almost 1 GB

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-24 Thread Christian Heimes
On 24/02/2021 08.03, Michał Górny wrote: > On Tue, 2021-02-23 at 19:45 -0500, Random832 wrote: >> I was reading a discussion thread >> about >> various issues with the Debian packaged version of Python, and the following >>

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-24 Thread Henk-Jaap Wagenaar
On Wed, 24 Feb 2021 at 10:18, Antoine Pitrou wrote: > On Tue, 23 Feb 2021 20:29:52 -0500 > Jonathan Goble wrote: > > > > I can't speak for distributors or maintainers [1], but I can speak for > > myself as a user. I run Debian testing (currently bullseye as that is > > preparing for release) as

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-24 Thread Antoine Pitrou
On Tue, 23 Feb 2021 20:29:52 -0500 Jonathan Goble wrote: > > I can't speak for distributors or maintainers [1], but I can speak for > myself as a user. I run Debian testing (currently bullseye as that is > preparing for release) as my daily OS on my personal laptop, used for > personal matters

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-23 Thread Michał Górny
On Tue, 2021-02-23 at 19:45 -0500, Random832 wrote: > I was reading a discussion thread > about > various issues with the Debian packaged version of Python, and the following > statement stood out for me as shocking: > >

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-23 Thread Wes Turner
FWIW, Distro repacks are advantageous in comparison to "statically-bundled" releases that for example bundle in an outdated version of OpenSSL, because when you `apt-get upgrade -y` that should upgrade the OpenSSL that all the other distro packages depend upon. Here's something that doesn't get

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-23 Thread Wes Turner
On 2/23/21, Random832 wrote: > I was reading a discussion thread > about > various issues with the Debian packaged version of Python, and the following > statement stood out for me as shocking: > > Christian Heimes wrote: >> Core

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-23 Thread Emily Bowman
On Tue, Feb 23, 2021 at 4:51 PM Random832 wrote: > Why is it that this community is resigned to recommending a workaround > when distributions decide the site-packages directory belongs to their > package manager rather than pip, instead of bringing the same amount of > fiery condemnation of

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-23 Thread Jonathan Goble
On Tue, Feb 23, 2021 at 7:48 PM Random832 wrote: > > I was reading a discussion thread > about > various issues with the Debian packaged version of Python, and the following > statement stood out for me as shocking: > > Christian