Replies: 3 comments 6 replies
-
IMO we should revert the behavior on mac and windows. The original reason for introducing it was to adhere to the XDG specs on linux. AFAIK no mac or windows user was complaining about the install location on their OS, so introducing platformdirs for them was solving an issue that did not exist and overall made the experience on those operating systems worse. |
Beta Was this translation helpful? Give feedback.
-
As there does not seem to be anyone speaking out against reverting, I've turned this into an issue and will close this discussion for now. |
Beta Was this translation helpful? Give feedback.
-
@zooba FYI, based on the summary above and linked analyses, it's not viable for Python applications to store app data (or maybe just virtualenvs) in AppData. The issue seems to be related to issues deleting files in use. I haven't looked deeply into it, but I thought I'd bring it to your attention in case you have any better recommendations than to simply install in ~/.local or wished to register some of these issues with Windows itself. |
Beta Was this translation helpful? Give feedback.
-
How would this feature be useful?
In #1001 platformdirs was introduced, to by default store the pipx data in the canonical location per OS. Since then, a couple of issues were raised:
Windows
The data is now stored in
AppData
. This led to the following issues that did not have a good resolution (yet):#1168, #1203 (thanks @dechamps, @guahki for doing a ton of work here)
The jist of it is, that the
AppData
folder is subject to path redirection due to sandboxing. This, in combination with the microsoft store installation of Python, means that the--python
flag is no longer compatible with other installed microsoft store python versions.On top of this being basically not fixable, it's also according to @dechamps and @guahki investigation impossible to replicate in an automated test.
MacOS
The data is now stored in the
Application Support
folder by default. This led to the following issues that did not have a good resolution (yet):#1198, #1212
The whitespace in the folder messes up shebang functionality in
While our documentation states that applications installed via pipx should declare an entrypoint, that is not impacted by a space in the path, a lot of real applications don't do this and rely on scripts instead. All of these scripts don't work in the new default location. There is also no way for us to fix this, aside from us advising our users to set a different
PIPX_HOME
.Linux
All good here
Describe the solution you'd like
Not really a solution, but I'd like to have an open discussion on whether we should (partially?) revert using platformdirs by default. I'd especially be interested in the factual benefits we see in using the platformdirs locations by default, aside from following the recommendations of the OS.
I see 2 possible solutions:
1. Stick to using platformdirs by default
IMO in this case we should very clearly document the limitations of using the default settings and try to catch as many possible issues as possible, advising users that run into them to change
PIPX_HOME
.For most users, not being able to use
--python
would probably be fine, especially in combination with being able to just fetch missing python versions instead of using the microsoft store versions (#1242).Having all application scripts broken on mac seems like a bigger issue to most users.
On windows a big issue I see here is that our default behavior would rely on functionality we can't really test at all, which is the microsoft store python version weirdness in combination with the
AppDirs
sandboxing.2. Change the default behavior on Windows and MacOS
Have default values that lead to the most robust experience we're aware of, which is the old paths we were using. We can have a new env variable that enables the platformdirs paths for users that are happy with the limitations that come with it.
Beta Was this translation helpful? Give feedback.
All reactions