anaconda / anaconda-client

Anaconda Server Client
https://anaconda.org
BSD 3-Clause "New" or "Revised" License
146 stars 240 forks source link

Broken version comparison on Anaconda.org #561

Closed ileasile closed 5 days ago

ileasile commented 3 years ago

It's the reposting of this issue

I've created a question on SO several months ago, but haven't received any answers.

Current Behavior

Different "latest versions" are reported for this package: https://anaconda.org/jetbrains/kotlin-jupyter-kernel: image image image image

Shield from shields.io says that version is 0.9.0.6: alt

Shields.io makes a request to https://api.anaconda.org/package/jetbrains/kotlin-jupyter-kernel and gets

"latest_version":"0.9.0.6"

in the response. But in the same response:

"versions": [
    "0.6.3.10", 
    "0.7.1.10", 
    "0.7.2.10", 
    "0.7.3.10", 
    "0.7_SNAPSHOT", 
    "0.7.29_add_teamcity_integration", 
    "11", 
    "0.7.12_add_teamcity_integration", 
    "0.7.17_add_teamcity_integration", 
    "0.7.dev18", 
    "0.7.dev19", 
    "0.7.dev21", 
    "0.7.dev22", 
    "0.7.12", 
    "0.8.0", 
    "0.8.dev23", 
    "0.7.15.64.dev1", 
    "0.7.40.145", 
    "0.8.0.2", 
    "0.8.0.7", 
    "0.8.0.10", 
    "0.8.0.25", 
    "0.8.0.28", 
    "0.8.1.74", 
    "0.8.1.75", 
    "0.8.1.76", 
    "0.8.1.78", 
    "0.8.1.83", 
    "0.8.1.98", 
    "0.8.1.114", 
    "0.8.1.118", 
    "0.8.1.120", 
    "0.8.1.121", 
    "0.8.2.1", 
    "0.8.2.2", 
    "0.8.2.4", 
    "0.8.2.5", 
    "0.8.2.53", 
    "0.8.2.61", 
    "0.8.3.1", 
    "0.8.3.64", 
    "0.8.3.122", 
    "0.9.0.3", 
    "0.9.0.5", 
    "0.9.0.6", 
    "0.9.0.7", 
    "0.9.0.14"
  ]

So... It's very strange

Steps to Reproduce

Open the link above

Expected Behavior

All the latest versions shown are the same and should be 0.9.0.14 at the moment of this issue creation

jameslamb commented 2 months ago

(came here from https://github.com/conda-forge/lightgbm-feedstock/issues/59#issuecomment-2255676952)

I'm not sure where the code that populates that part of the UI (or the latest version returned by e.g. https://api.anaconda.org/package/jetbrains/kotlin-jupyter-kernel) lives, but will just note.... 0.9.0.6 is lexicographically greater than 0.9.0.14.

"0.9.0.6" > "0.9.0.14"
# True

So I suspect the code populating latest_value was maybe just sorting the versions as strings, instead of as package versions.

mattkram commented 5 days ago

Since it appears the initial issue has been resolved based on https://github.com/conda/infrastructure/issues/943 I will close this.