Exactly the type of reason to prefer JSON that I wasnât aware of. Like I said, definitely not a dealbreaker to use it over TOML.
Might be worthwhile to add a sentence or two explaining that choice to the configuration section or potentially a new section down in âRejected Ideasâ[1]
Especially because any later proposal to add support for TOML could then reference that more explicitly than having to search back through this thread for details of why JSON was chosen in the first place.
Iâm personally quite a fan of seeing those types of clear and concise details about trade-offs when picking something for a design, because I feel like whenever I stumble across them as Iâve been learning over the years, they have been good teaching examples about how to make and document good design choices for my own projects
small edit to add: I also want to add a thank you shout-out to all the people who have written so many good proposals over the years and contributed to discussions here. Iâve learned a ton from so many great people here and it still feels really surreal to occasionally be involved in discussions with people whose names I know so well from all of the work theyâve done
My general rule of thumb is to use JSON for computers and TOML for humans. JSON is not a human friendly format, but itâs great for interchanging data between software.
Iâm a bit squeamish about no longer being able to disable MAX_PATH. With virtual environments being installed into the userâs temporary directory, I find the limit gets crossed pretty easily. And last I checked, thereâs no special handling in pip to catch/explain the resultant OS error.
Can you clarify the story with automatic updates? It looks like PyManager autoupdates â is this disable-able? What about the Python installations? Would 3.12.0 ever implicitly update to 3.12.8 or 3.13.0?
Well, you just donât have a convenient button (which requires admin, which mean vast numbers of people canât actually click it), but you can still disable it (I assume you noticed that you linked to the instructions for how to disable it without using the installer, but perhaps not everyone else clicked through).
Iâm using the lack of button to apply pressure to the people in a position to change the default setting. I can nearly prove that 100% of users who have enabled this option did it because of Python (or more recently, Git).
The error just reports as âfile not foundâ (I think because the buffer gets truncated somewhere in the OS, though I havenât tested to see if itâs vulnerable to opening the wrong path), and the fix for many users is still âavoid this library that nests unnecessarily deeplyâ rather than anything else.
Yes, itâs an OS feature, and can be disabled per-app in the âApp settingsâ page.
Right now, no, but manually running py install --update will do it (and if you set up a scheduled task to do it automatically then it can be automatic).
Thatâs fine, but unfortunately, both are fairly annoying when it comes to backslashes, and backslashes are critical to Windows configuration.
At least JSON only has exactly one convention, even if it means you always need to double up backslashes and escape double quotes. Not following the convention is a parse issue that any JSON parser/editor will tell you about.
TOML gives you the choice to use almost JSON formatting but you canât use certain quotes, or to use more convenient formatting but you canât use single quotes (which are valid in paths), and in some cases the escaped characters include the escape and others theyâll treat it as an escape. (YAML offers even more optionsâŠ)
And weâre talking about overriding a small set of defaults, where typically the default value is going to be fine (or conveniently overridden from the command line, such as the default format for py list). Writing configuration isnât a core scenario here (compared to, say, pyproject.toml).
If pymanager canât do this automatically, this is IMO a dealbreaker for using this to replace the user-facing installer. Often users on home systems are admins and therefore the installer would just be able to make this change - no longer having this be part of the installer will cause additional and unnecessary issues, questions, bug reports, ⊠(unless microsoft comes to senses at some point and decides to switch this option by default in some update)
This is just going to affect CPython, but all python packages (no, not just package installers/managers). The current installer at least gives users a very clear option âpress this button to fix problemsâ that, in the worst case, packager authors can direct users to. Asking endusers to modify the registry themselves severely increases the barrier in a way that is going to prevent this fix from being used.
(I do want to point out that the choices are very similar to what python itself gives it users, just using ' instead of r". I also donât think giving users more choices to express themself however itâs convenient is a good argument against a format⊠I am also not sure what you mean with âalmost JSON formatting but you canât use certain quotesâ. AFAICT the syntax for single " strings is identical? But I donât care that much about this.)
The most it can do is have an extra option to one of the proposed commands that has to be run as administrator, which is as much or more documentation than whatâs currently there. There are no longer any buttons that we control in the install UI - itâs just a CLI tool in a standard OS package.
I already said we can add more formats in the future. The PEP is not a constraint on the design of the installer (unlike most PEPs recently, so I get why people would assume this), itâs just setting out the proposal at this stage in enough detail that itâs possible to decide without having to seek out further context.
Right, to be convenient the manager would need to have an elevator to get admin privileges and would need to suggest it at some point during an install process - which seems difficult to do UX wise and annoying to implement. But maybe an option that does this would be good anyway? It would be
Launch a terminal with admin privileges (right click start symbol), run pymanager enable-max-long-path.
vs
Open the registry editor, go to the path ..., donât edit anything else, edit the key ... (or maybe create it if itâs missing)
Itâs probably not a huge difference, but the former feels simpler and less scary.
It would be pretty trivial to write a small script to disable MAX_PATH (itâs just a simple registry change), so this can easily be âLaunch a terminal with admin privileges and run python no-max-path.pyâ. The no-max-path.py script could be in the docs somewhere, I guess, or someone motivated could publish it as something like a gist (or even as a package on PyPI, if you feel like over-engineering it )
Discoverability is worse, conceded, but at some point we have to accept that itâs not Pythonâs job to tell people how to administer their Windows systems.
Having said that, I wouldnât object if Steve felt that adding a pymanager no-max-path subcommand (which had to be run as admin) was worth it.
I suspect some kind of additional âmess with my systemâ command is going to be inevitable - it could also do the PATH modification (without admin) that people are going to demand.
My main hesitation is that I dislike making changes that we canât undo. The MAX_PATH change at least only affects processes that declare they support it, while the PATH change surprises other apps (though hopefully itâs better controlled now that we wonât put random DLLs in there).
Discoverability would be to change the âAdd this directory to your PATH for global commands: <directory>â message to âRun this command to modify your system: py install --configure-systemâ (Iâm trying to minimise subcommands, and also thereâs no reason it canât do those changes while also installing runtimes).
Itâs less about convenience and more about awareness. No one is going to look at a strange file not found error in a failed pip install and think I wonder if thereâs a magic registry setting which is documented at the bottom of the pymanager guide. That prompt was the first place I learned of MAX_PATH.
But overall I agree that thereâs not much pymanager can do. Iâd still suggest we put some try/except/helpful error message guarding into pip though. In terms of awareness, that should be almost as good.
Would it be going too far for pymanager to try writing and reading a 261-character-long path in %TEMP%, perhaps during the install step? That would mean that it could print the âmodify PATHâ message at the same time as forewarning the user that they will likely have problems with path length, unless LongPathsEnabled is set.
It can read the setting easily enough. Though Iâm only assuming that if the default is changed that itâd be changed by setting the setting (if it were changed some other way, reading the setting wouldnât work and testing is the only way).
If I could use that to download an MSIX file of the latest version (at the time I fetched the appinstaller file), it should be sufficient. Iâll have to play with it but it seems like that would be the case.
The idea here is to bundle MSIX with the Chocolatey package - this is a preferred option when the license of the software allows redistribution of its binaries as it means thereâs no need to download anything during package installation.
Yeah, thatâs the idea, and why the MSIX will be available to download from the python.org download page. Itâs just the lack of API for finding the current URL that you want.
My testing appinstaller file is at https://cpythonpackages.blob.core.windows.net/pkg/pymanager.appinstaller if you want to see how it looks. I expect the only thing thatâll change is the URL.
Just letting you know that Iâve fixed/improved most of what youâve shared here - if youâve still got it installed then you should get the new version automatically today, or itâs on GitHub. (Note: quick follow up update)
The second part yes, itâs done in the update. Iâm thinking to add warnings to the old launcher for py list/py install/py uninstall/py help (when no script file by that name exists) to try and help with shadowing.
I want to minimise the messages that turn on/off by some system state, since if the state is intentional, then the message just gets in the way. Using pymanager as a command is the intended way to keep the legacy py command intact, and so you wouldnât want more messages (more helpful errors, yes, but those have to go into the legacy py.exe).
Iâm not on a Windows machine so I canât verify this easily, but pip does try to detect that the path is too long and raise a more suitable error in this case:
If this isnât working, please file a bug report. I wouldnât be surprised if something has broken this in the last four years since this was added to pip.