-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with Windows Store Python #3
Comments
I wonder if desktop-app can/should leverage a lot of the infrastructure in virtualenv, e.g. |
Ah, that's annoying. I'm only resolving it to ensure the case is right, since venv makes all the paths in sys lower case which gives different hashes than the correct case - but I can Will look into whether there's much we can leverage from virtualenv. I just want a string unique to the Python installation for use in the appids, I don't actually need to access the directory.. |
Should be fixed by f64a318. However, this will change all the appids, so appid stuff will be expected to break until uninstalling and reinstalling a shortcut. |
Installing from scratch:
The additional shortcut creation was required as the start menu on the second host I'm testing this on isn't populated by The resulting shortcut is broken, i.e. does not point to
but for this store-bought Python the Scripts folder is actually:
If I amend the shortcut target, I see #1, as before. |
Great. Will look into the difference between %APPDATA% and %PROGRAMDATA%. I was not aware that different Windows installations differed in how they populate the start menu. The scripts path being wrong I should be able to fix: It looks like the Scripts directory being wrong is due to to the Windows store doing kind of the equivalent of a Limitations
===========
`desktop-app` is compatible with packages installed system-wide and within virtual
environments. However, it is not compatible with packages installed either with `pip
install --user`, or with a modified `--prefix` such as how Debian-based distributions
install packages to `/usr/local/` when `pip` is run with `sudo`.
This is because `desktop-app` can't find the `entry_points` scripts in these cases in
order to point start menu shortcuts and .desktop files at them. It just looks in
`sysconfig.get_path('scripts')`, and turns out that looking in all other possible places
is non-trivial. Obviously it's possible since `pip uninstall` manages to remove these
files (evidence that it can find them!), but I haven't figured it out yet and it's not
really worth it when `sudo pip install` and `pip install --user` are usually bad ideas
anyway. However, it is possible, just means I have to hook into the same logic as pip in order to determine the path to local packages and local scripts, and determine which prefix a module was installed to (its import path does not suffice since editable installs are located elsewhere and linked to by a So I can do that! I had thought prior to now it was out of scope enough to not be worth it, but being compatible with windows store Python is a good reason. |
It occurs to me that this might be the source of the issues we're seeing, and if so there might not be much we can do about it within the current model of setting
|
From my cursory googling, it sounds like in normal circumstances, both are used. How sure are you that this is a difference in configuration on your system, as opposed to say, Windows failing to update its start menu database in a timely manner when a new shortcut is created (this SO comment hints at that possibility)? If there's a possibility of the latter, I wonder if 4322167 might have helped - with that change I see a visual flicker of the taskbar as Windows reloads things, and the shortcut is immediately in the start menu (whereas otherwise I have to wait some seconds for it to appear). Nonetheless I'll experiment with installing to %PROGRAMDATA% |
Also for packages installed to /usr/local as in Debian-based distros. Addresses the the incorrect shortcut target reported in #3
The broken shortcuts issue ought to be fixed by 0ea163e (verified by cursory testing).
One remaining use case is "the user ran |
I'm seeing the shortcuts not even being created. Python things its creating them, but they are not visible in the file browser. Python can see them however. Here you can see This must be because of this (already speculated about above with regard to appid setting):
|
Trying to reproduce #1 on another Windows 10 host, I came across another issue related to Windows Store distribution. Specifically, I'm using Python 3.8 from Windows Store:
In
shell.py > _ModuleConfig > _get_appid
the following fails on store-bought Python:with:
A minimal example is:
It looks like
virtualenv
had to contend with this, see:There's this relevant open issue for
pathlib.WindowsPath.resolve
as well, in which this message states:In what I observed here, I think it tries to resolve the executable to
C:\Program Files\WindowsApps
which requires elevation to access.The text was updated successfully, but these errors were encountered: