(cls, version)
| 18 | |
| 19 | @classmethod |
| 20 | def parse(cls, version): |
| 21 | edition = None |
| 22 | version = version.lstrip('v') |
| 23 | version, _, stage = version.partition('-') |
| 24 | if stage: |
| 25 | if not any(marker in stage for marker in STAGES): |
| 26 | edition = stage |
| 27 | stage = None |
| 28 | elif '-' in stage: |
| 29 | edition, stage = stage.split('-', 1) |
| 30 | major, minor, patch = version.split('.', 2) |
| 31 | return cls(major, minor, patch, stage, edition) |
| 32 | |
| 33 | @property |
| 34 | def major_minor(self): |
no outgoing calls
no test coverage detected