← 输入框|github.com|刷新
Skip to content

Fix #135, convert prerelease and build to string - #140

Merged
s-celles merged 8 commits into
python-semver:masterfrom
tomschr:bugfix/135-conv-args
Oct 2, 2019
Merged

s-celles merged 8 commits into
python-semver:masterfrom
tomschr:bugfix/135-conv-args

Conversation

@tomschr

@tomschr tomschr commented Sep 29, 2019

Copy link
Copy Markdown
Member

This PR fixes #135

Creating VersionInfo(3, 2, 1, 1) succeeds, but fails later when comparing it with another VersionInfo instance (for example, v1 < v2):

    def split_key(key):
>       return [convert(c) for c in key.split('.')]
E       AttributeError: 'int' object has no attribute 'split'

Creating VersionInfo(3, 2, 1, 1) succeeds, but fails later when comparing
it with another VersionInfo instance (for example, v1 < v2):

```
    def split_key(key):
>       return [convert(c) for c in key.split('.')]
E       AttributeError: 'int' object has no attribute 'split'
```

@Flamefire Flamefire left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

What about the other arguments? VersionInfo expects (int, int, int, str, str), so does VersionInfo(10) > VersionInfo('2') == True hold? Maybe add an assert that the first three are int or None?

Comment thread test_semver.py Resolved
To allow VersionInfo(10) > VersionInfo('2') == True
Co-authored-by: Alexander Grund
Co-authored-by: Alexander Grund
Comment thread test_semver.py Resolved
* Move assert line to test_should_be_able_to_use_strings_as_major_minor_patch
* Add additional assert, comparing VersionInfo created
  with strings and with integers

Co-authored-by: Alexander Grund
@s-celles

s-celles commented Oct 2, 2019

Copy link
Copy Markdown
Member

Any news about this PR? Is there a general consensus?

@tomschr

tomschr commented Oct 2, 2019

Copy link
Copy Markdown
Member Author

From my side it's ok, 😉 but would @Flamefire approve? 😉

@s-celles

s-celles commented Oct 2, 2019

Copy link
Copy Markdown
Member

Ok. So let's merge it.
Thanks guys for your work!

@s-celles
s-celles merged commit 8ee92b4 into python-semver:master Oct 2, 2019
@tomschr
tomschr deleted the bugfix/135-conv-args branch October 2, 2019 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert arguments in VersionInfo ctor

3 participants