allow separator between dev and num, ie, "dev.23"
According to the regular expression in Appendix B of the specification for Version Specifiers:
https://packaging.python.org/en/latest/specifications/version-specifiers/#appendix-parsing-version-strings-with-regular-expressionsversion-specifiers/
... a separator character ('-', '_', or '.') is allowed between the word "dev" and the optional number:
(?P<dev> # dev release
[-_\.]?
(?P<dev_l>dev)
[-_\.]?
(?P<dev_n>[0-9]+)?
)?
Also updated tests to include such versions in test cases
Fixes https://github.com/RazerM/parver/issues/33
A note on implementation - I left the attribute dev_sep unchanged, instead of changing it to dev_sep1 to be consistent with naming in other segments with two seps (ie, pre and post), as I decided to prioritize backward-compatibility rather than naming consistency.
...I added another commit on another branch, that renames all the "dev_sep" to "dev_sep1", if you prefer naming consistency:
https://github.com/pmolodo/parver/commit/ec26b55f123ec1f1fb057970c79f201a7eb8cf95
Well spotted in the regular expression. This is not mentioned in https://peps.python.org/pep-0440/#development-release-separators like it is for post and pre releases and we should probably update the PEP and packaging docs.
A note on implementation - I left the attribute
dev_sepunchanged, instead of changing it todev_sep1to be consistent with naming in other segments with two seps (ie,preandpost), as I decided to prioritize backward-compatibility rather than naming consistency.
Let's rename dev_sep to dev_sep1 but accept the old keyword argument with a deprecation warning if it is used. Likewise there should be a property for the old name which emits a deprecation warning.
Merged as #36, thanks @pmolodo. Note I went for a breaking change in the end. It will be released as 1.0