Fix sorting of Python versions.

Review Request #14852 — Created Feb. 24, 2026 and submitted

Information

virtualenv-multiver
master

Reviewers

To create a sort key, the Python version was being split on periods but
then left as strings. This change fixes it so we sort versions
numerically instead.

This also moves the sorting to happen after we normalize versions, so
that version ranges get handled properly.

Ran virtualenv-multiver test 3.8 3.12 3.9 3.10-3.11 and saw that it did
everything in order.

Summary ID
Fix sorting of Python versions.
To create a sort key, the Python version was being split on periods but then left as strings. This change fixes it so we sort versions numerically instead. This also moves the sorting to happen after we normalize versions, so that version ranges get handled properly. Testing Done: Created a virtualenv with 3.8, 3.9, and 3.10 and saw that it no longer did 3.10 first.
ppxvuqrxuoyrovzvnwvmnpxlxkyzttot
maubin
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to master (bfc8601)