Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use PEP-440 compatible version comparisons
Currently, we we're using the [`semantic-version`](https://pypi.org/project/semantic-version/) library, to construct it's custom `Version` objects, which have comparison support, however, this could easily lead to issues, as python packaging doesn't follow the semver naming spec exactly, instead, it follows the spec from [PEP-440](https://peps.python.org/pep-0440/). This means certain things, such as alpha releases, use version tags like `1.1.0a1`, instead of the semver alternative (`1.1.0-alpha.1`). Using these incompatible version strings with the `semantic_version.Version` class would lead to a `ValueError` getting raised during initialization. This would cause all deprecated objects to be unusable on these semver-incompatible mcproto versions, as the decorator where this check happens would end with this `ValueError`. This fixes the issue by moving to [`packaging.version.Version`](https://packaging.pypa.io/en/stable/version.html#packaging.version.Version), which was designed specifically for the PEP-440 version naming standard.
- Loading branch information