AcademySoftwareFoundation / AcademySoftwareFoundation/rez

[Feature] Support for correct pre-release version sorting

Aperta
#653 8 commenti 6 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement rez-pip
Lingua principale
Python
Stelle
1.1k
Fork
374
Merge medio
9g 12h
PR unite (30g)
5

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia esaminando il modulo delle versioni vendorizzato esistente e i percorsi attuali di Rez per l'ordinamento delle versioni e la configurazione. Confronta il comportamento attuale con gli esempi di PEP 440, quindi definisci l'ambito della configurazione e verifica che le versioni PEP 440 valide vengano ordinate correttamente, mentre le versioni non valide mantengano il fallback alfanumerico esistente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
tooling
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.