-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Description
sourcelib field of EventMetada does not support PEP-440 post, pre and development releases due to intended parse of version data to integer. @hooks-extension-framework
Context
During the development process of a new signal we face the need to create a fork of the v9.10.0 version of openedx-events package. To properly follow the versioning protocol, we decide to use post releases for the mentioned version so in that way we won't interfere with the upstream versioning in a case of syncing the changes.
Once the post release v9.10.0.post1 was released, we face an issue with our CI process: openedx-events eventmetada raised an error due to trying to parse an string value into integer.
https://packaging.python.org/en/latest/discussions/versioning/#valid-version-numbers
This was caused by the "post1" key set in the version definition of the package.
Solution
Remove the map function that tries to parse the version keys to integer. and let the field defined this way:
sourcelib = attr.ib(
type=tuple, default=None,
converter=attr.converters.default_if_none(
attr.Factory(lambda: tuple(openedx_events.__version__.split(".")))
),
validator=attr.validators.instance_of(tuple),
)
We already implement this solution in our fork and no test nor workflows were impacted.