Skip to content

Commit

Permalink
Remove parsing of self patch-version from __init__
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Parmann authored and epa095 committed Oct 1, 2019
1 parent c1c50fe commit 5e878d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions gordo_components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
def _parse_version(version: str) -> Tuple[int, ...]:
"""
Takes a string which starts with standard major.minor.patch.
and returns the split of major minor and path as integers
and returns the split of major and minor version as integers
Parameters
----------
Expand All @@ -18,10 +18,10 @@ def _parse_version(version: str) -> Tuple[int, ...]:
Returns
-------
Tuple[int, int, int]
major, minor and patch versions
Tuple[int, int]
major and minor versions
"""
return tuple(int(i) for i in version.split(".")[:3])
return tuple(int(i) for i in version.split(".")[:2])


MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION = _parse_version(__version__)
MAJOR_VERSION, MINOR_VERSION = _parse_version(__version__)
8 changes: 4 additions & 4 deletions tests/gordo_components/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ def test_version():
@pytest.mark.parametrize(
"version,expected",
[
("1.1.1", (1, 1, 1)),
("1.1.1.dev-a1", (1, 1, 1)),
("0.55.25.02", (0, 55, 25)),
("0.0.0", (0, 0, 0)),
("1.1.1", (1, 1)),
("1.1.1.dev-a1", (1, 1)),
("0.55.25.02", (0, 55)),
("0.0.0", (0, 0)),
],
)
def test_version_parser(version: str, expected: Tuple[int, int, int]):
Expand Down

0 comments on commit 5e878d4

Please sign in to comment.