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

The wrong Python version is tested when testing automatic updates #73

Open
6 tasks done
robmoss2k opened this issue Dec 10, 2024 · 1 comment
Open
6 tasks done
Labels
Bug Issues where something has happened which was not expected or intended

Comments

@robmoss2k
Copy link

Checklist

  • I confirm there are no unresolved issues reported on the Chocolatey Status page.
  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

When testing automatic updates, streams are sorted lexicographically descending. This means that Python 3.9 is tested instead of Python 3.14. The same is most likely true of many packages.

What is Expected?

Python 3.14.0-a2 should be the recipient of the test install.

How Did You Get This To Happen?

  1. I created a PR against chocolatey-packages.
  2. AppVeyor shows Python 3.9 as the recipient of the test install.

System Details

  • Operating System: Windows 11
  • Windows PowerShell version: 7.4.6
  • Chocolatey CLI Version: v2.4.1
  • Chocolatey Licensed Extension version: N/A
  • Chocolatey License type: Free
  • Terminal/Emulator: Terminal

Installed Packages

I'm not sure, this is the hosted environment used for testing.

Output Log

https://ci.appveyor.com/project/chocolateycommunity/chocolatey-packages/builds/51144306

Additional Context

The problem is here. I'm not enough of a PowerShell guru to know how to test this, but I believe the fix is:

if ($res.Streams -is [HashTable]) { $streams = $streams | Sort-Object { [System.Version]::Parse($_) } -Descending }
@robmoss2k robmoss2k added the Bug Issues where something has happened which was not expected or intended label Dec 10, 2024
@TheCakeIsNaOH
Copy link
Member

When testing automatic updates, streams are sorted lexicographically descending. This means that Python 3.9 is tested instead of Python 3.14. The same is most likely true of many packages.

The names of steams are not necessarily versions, for example some packages have streams based on the release type (e.g "alpha", "beta" and "stable" steams).
https://github.com/TheCakeIsNaOH/chocolatey-packages/blob/master/looking-glass-host/update.ps1
https://github.com/chocolatey-community/chocolatey-packages/blob/master/automatic/libreoffice-streams/update.ps1

So it would not be appropriate to blindly try to parse the steam names as versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues where something has happened which was not expected or intended
Projects
None yet
Development

No branches or pull requests

2 participants