Having a look at the specification, and your tests, it is not fully clear what would be the correct way to include prereleases in the range expression, for example for a set as ["1.1.1-a.1", "1.1.1-a.11", "1.1.1-a.111", "1.1.1-a.21"], the expression "~1.1.1-*" will return None, but the "~1.1.1-" works. Also "~1.1.1-a" works.
Just to make sure, as "~1.1.1-" read a bit ugly (but I am fine with it)
Many thanks!