AcademySoftwareFoundation / AcademySoftwareFoundation/rez
[Feature] Support for correct pre-release version sorting
- 主要言語
- Python
- スター
- 1.1k
- フォーク
- 374
- 平均マージ
- 9日 12時間
- マージ済み PR(30日)
- 5
説明
Both PEP 440 versions and SemVar 2.0 versions may contain pre-release (and other) version information besides just maj/min/patch.
- https://www.python.org/dev/peps/pep-0440/
- https://semver.org/
Both PEP 440 and SemVar 2.0 utilize different sorting behavior for pre-releases than the default alphanumeric sort used by rez. For example, this is the expected sort order under PEP 440:
- `1.0.0-a1`
- `1.0.0b1`
- `1.0.0.rc1`
- `1.0.0`
The default rez sort will sort them like this, with the base version *before* the pre-releases, and also doesn't support the pre-release separator being optional:
- `1.0.0`
- `1.0.0-a1`
- `1.0.0.rc1`
- `1.0.0b1`
To maintain backwards compatibility, a config option could be added to enable support for this sorting behavior -- maybe `use_pep440_versioning`? With the expectation that if the package version isn't a valid PEP 440 version, it simply falls back to the normal alphanumeric sorting behavior.
This also raises another question of whether the `version` module should be vendored or not and instead be moved into rez proper, since it's already a pretty significant fork from the original and if we want it to be config aware, it should probably be moved into rez.
It may make sense to separate this ticket (and the config option) into two different options -- one for PEP 440 and one for SemVar 2.0, since they are different enough that someone may want one behavior and not the other. For this ticket, I'm mainly concerned with PEP 440 style versioning. I included SemVar 2.0 just to show it's not an issue unique to python packaging.
コントリビューションガイド
調査の方向性
まず、既存のvendored version moduleと、Rezにおける現在のversion-sortingおよびconfigurationのパスを確認します。現在の動作をPEP 440の例と比較し、次にconfigurationの範囲を定義して、有効なPEP 440 versionsが正しくソートされる一方で、無効なversionsでは既存のalphanumeric fallbackが維持されることを検証します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- tooling
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 30/100