refactor(metadata): replace VersionInfo with packaging.Version (Datas… #288
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request refactors the dataset versioning system by substituting the existing
VersionInfoclass with the more robustpackaging.Version. This change enhances version parsing and validation by leveraging thepackaginglibrary. Additionally, utility helpers for parsing and validating version strings are introduced to streamline these operations.Changes
Refactoring
Replace
VersionInfowithpackaging.Version:VersionInfois replaced withpackaging.Versionwhich provides a more standardized and reliable approach to handle semantic versions.DatasetVersion, an alias for version objects from thepackaginglibrary.Modification of Functionality:
DatasetMetadatato handle version bumping using the newbump_patch_versionmethod.DatasetManagerand related classes to work with new version types, thereby removing the need for custom version comparison logic.Features
parse_versionindreadnode.util, a function to safely convert version strings toVersionobjects.valid_versionto work with both strings andVersionobjects.Code Removal
Deprecate
VersionInfoClass:VersionInfoclass and its associated methods that handled manual version string operations and comparisons.Remove
compare_versionsMethods:compare_versionsandcompare_versions_from_pathsfromDatasetManager, replaced by direct use of Python's comparison capabilities withpackaging.Version.Code Adjustments
packaging.Version.The refactor significantly improves the maintainability and reliability of version handling across all dataset-related functionalities, ensuring that version-related operations adhere to industry standards.
Generated Summary:
VersionInfoclass and replaced it withDatasetVersion, simplifying our versioning model.valid_versionthat integrates support for both string andVersiontypes.DatasetMetadata.DatasetManager.parse_versionfunction.This summary was generated with ❤️ by rigging