-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: π version number according to PEP440
- add: β docs build to tox.
- Loading branch information
1 parent
c6f7090
commit 709e6a0
Showing
7 changed files
with
62 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
VERSION = (1, 0, 0) | ||
|
||
|
||
def _get_version(version): | ||
if len(version) > 2: | ||
str_version = "%s.%s.%s" % version[:3] | ||
else: | ||
str_version = "%s.%s" % version[:2] | ||
|
||
return str_version | ||
|
||
|
||
__version__ = _get_version(VERSION) | ||
|
||
|
||
default_app_config = 'flag.apps.FlagConfig' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pytest | ||
|
||
from flag import _get_version | ||
|
||
|
||
class TestVersion: | ||
@pytest.mark.parametrize(('version', 'result'), ( | ||
((1, 2, 3), ('1.2.3')), # with patch | ||
((1, 2), ('1.2')), # without patch | ||
)) | ||
def test_get_version(self, version, result): | ||
assert _get_version((version)) == result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters