You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/10/22 20:54:43 UTC

[GitHub] [arrow] terencehonles commented on pull request #8506: ARROW-10369: [Dev] Fix archery release utility test cases

terencehonles commented on pull request #8506:
URL: https://github.com/apache/arrow/pull/8506#issuecomment-714756373


   > New releases of python-semver don't support comparing `VersionInfo` objects with strings.
   
   @kszucs the underlying cause is constructor changed. The compare method would automatically call [parse](https://github.com/python-semver/python-semver/blob/master/semver.py#L493) and that would try to construct a `Version` object, but since the signature changed it would break.
   
   I was thinking about opening a PR, but I would need some input from you if what I was thinking was actually the direction that should be taken. I had the following diff, but I wasn't sure if Version objects should be compared to non version objects because they would not have the release/release_date properties. That was already an issue, and while I hadn't tested this yet (I just pinned semver in the PR I was working on), I believe it will work.
   
   ```diff
   diff --git a/dev/archery/archery/release.py b/dev/archery/archery/release.py
   index 0d9efdb2e..73ae1ddc6 100644
   --- a/dev/archery/archery/release.py
   +++ b/dev/archery/archery/release.py
   @@ -37,18 +37,17 @@ def cached_property(fn):
    
    class Version(SemVer):
    
   -    __slots__ = SemVer.__slots__ + ('released', 'release_date')
   +    __slots__ = ('released', 'release_date')
    
   -    def __init__(self, version_string, released=False, release_date=None):
   -        semver = SemVer.parse(version_string)
   -        super().__init__(**semver.to_dict())
   +    def __init__(self, *args, released=False, release_date=None, **kwargs):
   +        super().__init__(*args, **kwargs)
            self.released = released
            self.release_date = release_date
    
        @classmethod
        def from_jira(cls, jira_version):
            return cls(
   -            version_string=jira_version.name,
   +            **SemVer.parse(jira_version.name).to_dict(),
                released=jira_version.released,
                release_date=getattr(jira_version, 'releaseDate', None)
            )
   ```
   
   Additionally semver should be pinned to `semver > 2.10.2`


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org