Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 8 commits into from Oct 2, 2019

Conversation

tomschr
Copy link
Member

@tomschr tomschr commented Sep 29, 2019

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'
```
Copy link
Contributor

@Flamefire Flamefire left a comment

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?

test_semver.py Outdated Show resolved Hide resolved
To allow VersionInfo(10) > VersionInfo('2') == True
Co-authored-by: Alexander Grund
Co-authored-by: Alexander Grund
test_semver.py Outdated Show resolved Hide 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
@scls19fr
Copy link
Member

scls19fr commented Oct 2, 2019

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

@tomschr
Copy link
Member Author

tomschr commented Oct 2, 2019

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

@scls19fr
Copy link
Member

scls19fr commented Oct 2, 2019

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

@scls19fr scls19fr 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