OK, so I’ve read the proposal. It looks great, overall. I’ve collected my thoughts here - sorry about the length, I thought one post covering everything would be better than a bunch of individual comments.
In the “Background” section, there’s a discussion of intended uses of the various packages. While that’s great, I think we should also discuss (to the extent that we can) the actual use. In particular, my experience is that many people use the embedded distribution as a standalone distribution, and struggle because its design doesn’t lend itself to that usage (specifically, the fact that it’s hard to use pip to manage packages). My belief is that this is either because the nuget distribution is significantly less discoverable, or because users aren’t comfortable relying on the nuget package manager.
My hope is that the proposed installation manager will address these sorts of misunderstanding, but I think we need to discuss them in any case, or the PEP looks like it’s been designed based on what we wish was the current situation, rather than on what that situation actually is.
Under the install subcommand, the PEP says:
Passing --upgrade
with no tags will attempt to replace all installs with newer compatible versions, though as this may be destructive we reserve the right to disable this command and require tags be listed explicitly.
What does that mean exactly? When and how would we disable the command? And who is “we” in this context? IMO, the PEP should pick one option. Changing the option would probably require a PEP anyway, and such a PEP is no harder to write if the initial spec made a definite choice. (If the intention here is to say that we could change the behaviour without requiring a follow-up PEP, then my initial reaction is to disagree, but if that’s what you want you should say so explicitly, and justify that statement).
You say that python install --target
is intended to cover embedding cases. Does that mean it will disable pip the way the embedded distribution does, or will it be a fully functional installation like the nuget one? IMO people will expect it to be fully functional, and having to hack the _python*.pth
file to enable pip would be surprising (as would the “flat” directory structure).
If you want an option to install an “embedded” distribution, I’d suggest being explicit and using --embed
, reserving --target
for a “standalone” but otherwise normal distribution.
I’m inclined to say that we should support using the distributions outside of PyManager. We can add provisos (such as we expect any reported problems to be reproducible using python install --target
), but IMO the ambiguity involved in “we don’t support this but you’re welcome to use it” will discourage use, leading to unnecessary duplication of effort, as well as lack of clarity for package maintainers. For example, if someone reports a problem with pip, when used in a Python installation that was downloaded from python.org by hatch, what do we do? Telling them to reproduce the issue with the official python.org build isn’t reasonable, as this is an official build. Telling them to talk to hatch isn’t much help - what could hatch do if the core devs won’t support them?
In “Interaction with venv”:
Based on experience with the py.exe
launcher, where it was found that users expected py
to launch an active virtual environment, we would argue that PyManager as proposed only behaves correctly because it uses python
as the main alias.
I’m not convinced the behaviour is correct. If a user types python help pathlib
when the system Python is active, they get the help for pathlib. Why wouldn’t they expect that command to work even when a virtualenv is activated? The technical reasons why this won’t happen are fine, and there’s no point repeating them, but technical reasons don’t alter what people expect, however much we might like them to. Maybe we’ll have to say “tough, it’s not going to be possible to change this”, but we shouldn’t ignore the fact that people won’t like it.
The “Environment Variables” section discusses entry point executables (like nox.exe
) installed by pip. I don’t completely follow that discussion. My understanding is that the “Scripts” directory (where those executables are installed) will be distinct from the location of python*.exe
. I don’t see this as an issue, as that’s the case currently. Equally, while it’s annoying that we still can’t solve the problem of that directory being on PATH
by default, I understand the technical reasons behind it. It is a regression for users who currently set “Add Python to PATH”, though, and should be explicitly noted as such. Personally, I use pipx and virtual environments, so I don’t care much myself, but I know users who would be frustrated if they installed nox and then found that the nox
command didn’t work for them.
(I didn’t read the “configuration” and “index schema” sections too closely - they look comprehensive and I trust they will be reviewed in more detail as we get down to more low-level matters).
I’m sad that script dependencies won’t be supported, but I agree it’s a significant chunk of extra functionality, and too much to include right now.
I’m concerned about the shebang processing. There are various launchers with different rules for shebang handling (in particular py
and the wrapper used to create entry point executables). While consistency isn’t necessary, gratuitous inconsistencies will cause confusion and make it harder to document behaviours. In particular, the form #!C:\Full\Path\To\python.exe
is a form that’s used in various places and not supporting it will likely cause problems, especially for people who have traditionally used the py
launcher and are switching to the new python.exe
.
Speaking of which, what will be the fate of the py
launcher if this proposal is accepted? There is a lot of documentation that tells people to use py
on Windows (the pip docs being one). If the launcher is no longer available in the official Python installer, those docs will need to be changed again Furthermore, people will have scripts and utilities that use py
as the Python command. Yes, with the existence of the store Python, you can’t just assume that py
is present, but there’s a general acceptance (in my experience) that the Store version of Python has some “quirks”, and this is easily accepted as one of them. We’re now promoting the Store Python experience as the official behaviour, and I think that’s going to be a big change for a lot of people.
You do mention this in “Backward Compatibility”:
Users who currently rely on the traditional installer will find themselves having to switch to a significantly different workflow. This will particularly impact those who have scripted downloads and installs. The deprecation period of two releases will allow time to transition, and the traditional installer will have additional output and warnings added to direct users to the newer options.
but frankly, I think that even with the deprecation period, you’re being very optimistic if you think this will be easy. People who support multiple Python versions in particular will have a lot of migration work to do. And changes to workflows and basic commands (like py
) are the hardest things to change in larger organisations. I’m surprised you’re not more concerned about this yourself - do your users include an unusually high proportion of people using the store Python? In my experience, it’s still currently a minority of users who use it.
“How to teach this” should probably include a discussion of how to teach this to users who are currently using the python.org installer and the py
launcher. The current section is focused only on teaching the new behaviour to someone unfamiliar with Python, which is unlikely to be the biggest affected group. The discussion should also cover how we counter misinformation resulting from people searching the web and finding discussions on the py
launcher and other information relating to the current installer.
Overall, if this proposal was working from a clean slate, with noexisting installation mechanism, I’d enthusiastically support it. However, we don’t have the luxury of a clean slate, and I’m concerned that the transition will not be as smooth as the PEP suggests. In particular, I’m closely involved with the packaging ecosystem, and we have historically received a lot of complaints about disruptive changes and lack of stability. Whether we like it or not, this change will be seen as yet another disruptive packaging change, and as such will dig deeply into our already-overspent churn budget. It would be immensely helpful if this PEP acknowledged that issue and did more to help mitigate it.