Bug 261073 - AutoInstaller unable to distinguish 2.0.0 and 2.0.0.dev0
Summary: AutoInstaller unable to distinguish 2.0.0 and 2.0.0.dev0
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-02 18:04 PDT by Sam Sneddon [:gsnedders]
Modified: 2023-10-03 13:19 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Sneddon [:gsnedders] 2023-09-02 18:04:27 PDT
If you try to AutoInstall hiredis 2.0.0, autoinstall.Package.archives will find two packages:

(Pdb) pp self.archives()
[hiredis-2.0.0, hiredis-2.0.0]
(Pdb) pp self.archives()[0].link
'https://files.pythonhosted.org/packages/0c/39/eae11344d69ba435ec13d6bcc1a9eea3d2278324506fcd0e52d1ed8958c8/hiredis-2.0.0.tar.gz'
(Pdb) pp self.archives()[1].link
'https://files.pythonhosted.org/packages/24/4d/404526ef79b397900aee60f83e0c7f3d8d4740758b29f086db3d2d1f2409/hiredis-2.0.0.dev0.tar.gz'

Given we're meant to be doing exact matching, the latter shouldn't match.

Surprisingly, we seem to install the self.archives()[-1], which given the ordering of pypi.org will give us the oldest release we found (so 2.0.0.dev0 in this case).

Undoubtedly some of our problem here comes from the fact that Version doesn't accurately implement https://peps.python.org/pep-0440/; to repeat my mantra from elsewhere, "it sure would be nice if we could just rely on packaging" and in this case just use packaging.version.Version.
Comment 1 Sam Sneddon [:gsnedders] 2023-09-04 08:58:27 PDT
We also seem to be installing mock==4.0.0b1 today.
Comment 2 Sam Sneddon [:gsnedders] 2023-09-04 08:59:19 PDT
Also in packages we currently install, Twisted==21.2.0rc1
Comment 3 Radar WebKit Bug Importer 2023-09-09 18:05:14 PDT
<rdar://problem/115233592>