Skip to content
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

[Package Request]: Python.Python.3.Latest #85695

Closed
MarcoPeraza opened this issue Oct 20, 2022 · 12 comments
Closed

[Package Request]: Python.Python.3.Latest #85695

MarcoPeraza opened this issue Oct 20, 2022 · 12 comments
Labels
Help-Wanted This is a good candidate work item from the community. Package-Request This is a request for a package (new or updated version)

Comments

@MarcoPeraza
Copy link

MarcoPeraza commented Oct 20, 2022

Hi, why are there only packages for specific versions of Python3 and no package that just installs the latest version? I recognize that Python2 and Python3 are different enough to not be interchangeable. But when I install Python3, I normally want the latest version of Python3, just like I want the latest version of Powershell when I install Powershell.

@MarcoPeraza MarcoPeraza added Help-Wanted This is a good candidate work item from the community. Package-Request This is a request for a package (new or updated version) labels Oct 20, 2022
@ghost ghost added the Needs-Triage This work item needs to be triaged by a member of the core team. label Oct 20, 2022
@TheBossMagnus
Copy link
Contributor

all older python 3 are simply named "python 3". I think they should be renamed with also the .x (python 3.0/3.1/.....) like in the id.
The only "python 3" should be the latest (3.10 now).
Also, the 3.11 RC package doesn't exist.
But before doing any pr I'd like to listen to other opinions and possible breaking changes...

@Trenly
Copy link
Contributor

Trenly commented Oct 20, 2022

The PackageName should stay as Python 3 because that is what is written as the display name in Control Panel. Besides, even if it were changed, winget would still find all the subversions when searching for Python3. The best way to get winget install Python3 would be to change the moniker on the latest subpackage of Python3 to be python3, since winget treats an exact match with a moniker the same as an exact match for a package id. This does have the downfall of needing to be changed when new minor versions are released (e.g 3.10 -> 3.11) but it should work.

Regarding 3.11 not existing yet, I'm believe this is because it is not yet released to stable and is only a release candidate build.

@TheBossMagnus
Copy link
Contributor

Regarding 3.11 not existing yet, I'm believe this is because it is not yet released to stable and is only a release candidate build.
It's a good idea to make a package anyway(python 3.11 RC)?

@Trenly
Copy link
Contributor

Trenly commented Oct 20, 2022

winget install python3 now should install the latest version

@ppvnf
Copy link
Contributor

ppvnf commented Oct 20, 2022

I've a question: when python 3.11 is released, winget upgrade --all is gonna be able to update python 3.10 to 3.11?

@denelon denelon removed the Needs-Triage This work item needs to be triaged by a member of the core team. label Oct 21, 2022
@MarcoPeraza
Copy link
Author

MarcoPeraza commented Oct 22, 2022

I'm not sure a moniker solves the problem. Packages are not guaranteed to have unique monikers, but they are guaranteed to have unique IDs. Like with other languages, it seems like there should be a package ID that always corresponds to the latest version of Python 3 in winget.

@NJT145
Copy link
Contributor

NJT145 commented Dec 28, 2022

At this moment, there is a problem about --id=Python.Python.3. it seems that Python.Python.3 is not pointed to the latest version of Python3, and latest Python3 is with --id=Python.Python.3.11.
I tried to download Python3 with that cade and it doesn't work:
winget install -e -i --id=Python.Python.3 --source=winget --scope=machine
It says No package found matching input criteria..

@Trenly
Copy link
Contributor

Trenly commented Jan 4, 2023

At this moment, there is a problem about --id=Python.Python.3. it seems that Python.Python.3 is not pointed to the latest version of Python3, and latest Python3 is with --id=Python.Python.3.11. I tried to download Python3 with that cade and it doesn't work: winget install -e -i --id=Python.Python.3 --source=winget --scope=machine It says No package found matching input criteria..

This relies on a faulty assumption that a package with the id Python.Python.3 exists. The fact is that all of the Python 3 versions use the two part version. For example, running winget search --id Python.Python.3 results in the list of python packages available

PS C:\WINDOWS\system32> winget search --id Python.Python.3
Name        Id                 Version
---------------------------------------
Python 3    Python.Python.3.9  3.9.13
Python 3    Python.Python.3.8  3.8.10
Python 3    Python.Python.3.7  3.7.9
Python 3    Python.Python.3.6  3.6.8
Python 3    Python.Python.3.5  3.5.4
Python 3    Python.Python.3.4  3.4.4
Python 3    Python.Python.3.3  3.3.5
Python 3    Python.Python.3.2  3.2.5
Python 3    Python.Python.3.12 3.12.0a3
Python 3.11 Python.Python.3.11 3.11.1
Python 3    Python.Python.3.10 3.10.8
Python 3    Python.Python.3.1  3.1.4
Python 3    Python.Python.3.0  3.0.1

However, adding -e to search for the exact ID returns no results, because there is no package with the ID Python.Python.3

PS C:\WINDOWS\system32> winget search --id Python.Python.3 -e
No package found matching input criteria.

But, if you search for just python3

PS C:\WINDOWS\system32> winget search python3
Name        Id                  Version     Match
------------------------------------------------------------
Python 3.11 Python.Python.3.11  3.11.1      Moniker: python3
Miniconda3  Anaconda.Miniconda3 py39_4.10.3 Command: python3
Anaconda3   Anaconda.Anaconda3  2022.05     Command: python3
Python 3    Python.Python.3.9   3.9.13      Tag: python3
Python 3    Python.Python.3.8   3.8.10      Tag: python3
Python 3    Python.Python.3.7   3.7.9       Tag: python3
Python 3    Python.Python.3.6   3.6.8       Tag: python3
Python 3    Python.Python.3.5   3.5.4       Tag: python3
Python 3    Python.Python.3.4   3.4.4       Tag: python3
Python 3    Python.Python.3.3   3.3.5       Tag: python3
Python 3    Python.Python.3.2   3.2.5       Tag: python3
Python 3    Python.Python.3.12  3.12.0a3    Tag: python3
Python 3    Python.Python.3.10  3.10.8      Tag: python3
Python 3    Python.Python.3.1   3.1.4       Tag: python3
Python 3    Python.Python.3.0   3.0.1       Tag: python3

Since Python 3.11 has the Monker: python3, running winget install python3 --source winget --scope machine will download and install the latest version of Python 3.11

@MarcoPeraza
Copy link
Author

MarcoPeraza commented Feb 1, 2023

@Trenly, even to the extent that works, isn't it fragile since winget install xyz is just a fuzzy match? By contrast, --id or --e let you specify an exact package. I don't want to fuzzy match for python3 and hope I get the latest version, I want to exactly specify that I want the latest version of Python3. Maybe I misunderstand how monikers work?

@Trenly
Copy link
Contributor

Trenly commented Feb 1, 2023

@Trenly, even to the extent that works, isn't it fragile since winget install xyz is just a fuzzy match? By contrast, --id or --e let you specify an exact package. I don't want to fuzzy match for python3 and hope I get the latest version, I want to exactly specify that I want the latest version of Python3. Maybe I misunderstand how monikers work?

winget install is not a fuzzy match in the way you would think. Take for example AngusJohnson.ResourceHacker. If you run winget search resourcehacker then it will be found, but if you run winget install resourcehacker it will not be.

winget install uses a heuristic match to determine user intent. If there is a package where moniker is exactly equal to user input, that is considered an exact match for install. If there isn't an exact match by moniker, next would be an exact match on the package Name, ID, or product code. If there isn't an exact match, then there are additional queries that try to determine if there is a single package matching the query, although I'm not super familiar with them.

The way --id works is that it restricts matching on that specific query to the id field. For example, winget install 7zip --source winget will install 7zip.7zip because the moniker is an exact match. However, winget install --id 7zip --source winget will return no package found matching input criteria because there are multiple packages that have 7zip in their id.

So, by using the moniker field, it ensures that the exact match will be the latest version of python, and no fuzzy matching would be performed

@MarcoPeraza
Copy link
Author

Makes sense, thanks.

@Trenly
Copy link
Contributor

Trenly commented Apr 30, 2024

Close with reason: Moniker achieves desired behavior;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help-Wanted This is a good candidate work item from the community. Package-Request This is a request for a package (new or updated version)
Projects
None yet
Development

No branches or pull requests

6 participants