Python: sort by semantic version
Solution
["1.0.0", "2.1.2", "1.0.1"].sort(reverse=True, key=lambda v: [int(n) for n in v.replace("esr", "").split(".")])["1.0.0", "2.1.2", "1.0.1"].sort(reverse=True, key=lambda v: [int(n) for n in v.replace("esr", "").split(".")])#!/usr/bin/env -S pipx run
# pipx metadata
# /// script
# dependencies = ["requests"]
# ///
if __name__ == "__main__":
pass
Assuming you have pipx installed, you can now directly run the python file and have pipx manage everything.