Change Version formatting properties and functions to return Version objects (#4834)

* Change version.up_to() to return Version() object
* Add unit tests for Version.up_to()
* Fix packages that expected up_to() to return a string
* Ensure that up_to() preserves separator characters
* Use version indexing instead of up_to
* Make all Version formatting properties return Version objects
* Update docs
* Tests need to test string representation
This commit is contained in:
Adam J. Stewart
2017-07-24 15:02:13 -05:00
committed by Todd Gamblin
parent df2fc25ddf
commit 250ee413e9
7 changed files with 138 additions and 27 deletions

View File

@@ -131,9 +131,9 @@ def url_for_version(self, version):
url = self.list_url
if version >= Version('4.0'):
url += version.up_to(2) + '/'
url += str(version.up_to(2)) + '/'
else:
url += version.up_to(1) + '/'
url += str(version.up_to(1)) + '/'
if version >= Version('4.8'):
url += str(version) + '/'