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
Replicating usage docs results in '<' not supported between instances of 'VersionInfo' and 'tuple' #102
Comments
Good catch @MrCreosote I'm personally not a big fan of comparison of Moreover 3 numbers are required major, minor and patch If we accept this kind of comparison we should also accept comparing
instead of
Fixing doc will be easier but I let others contributors give their opinion. |
Are you sure you are using latest version of python-semver? In [1]: import semver
In [2]: semver.__version__
Out[2]: '2.8.1'
In [3]: from semver import VersionInfo
In [4]: version_info = VersionInfo.parse("3.4.5-pre.2+build.4")
In [5]: version_info
Out[5]: VersionInfo(major=3, minor=4, patch=5, prerelease='pre.2', build='build.4')
In [6]: version_info > (1, 0)
Out[6]: False
In [7]: version_info > (1, 0, 0)
Out[7]: False
In [8]: version_info > VersionInfo(1, 0, 0)
Out[8]: True My version is also buggy.... but in a different (worst?) way We really need more tests! |
I just pip'ed it today, and the version numbers line up, although we're getting different behavior... weird. $ pip freeze | grep semver
semver==2.8.1
$ ipython
Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import semver
In [2]: semver.__version__
Out[2]: '2.8.1'
In [3]: from semver import VersionInfo
In [4]: version_info = VersionInfo.parse("3.4.5-pre.2+build.4")
In [5]: version_info > (1, 0)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-d89d50dc6fc1> in <module>()
----> 1 version_info > (1, 0)
TypeError: '>' not supported between instances of 'VersionInfo' and 'tuple' |
File md5 is the same as from the git default branch:
|
Which Python version? (Python 2.7.15) Which OS? (Windows 10) |
So it's a difference between Python 2 and Python 3 |
An other odd behavior (with Python 2.7) In [5]: version_info = VersionInfo.parse("3.4.5-pre.2+build.4")
In [6]: version_info > VersionInfo(1, 0, 0)
Out[6]: True
In [7]: version_info > '1.0.0'
Out[7]: False |
Looks like you figured out I'm on 3.6.5. OS is Ubuntu 14.04. |
Closes python-semver#102 Closes python-semver#103
Closes python-semver#102 Closes python-semver#103
Closes python-semver#102 Closes python-semver#103
Closes python-semver#102 Closes python-semver#103
Closes python-semver#102 Closes python-semver#103
Closes python-semver#102 Closes python-semver#103
I feel like I must be missing something, but when I follow the docs here, I get:
The text was updated successfully, but these errors were encountered: