-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bcdda98
commit 3f4cb25
Showing
4 changed files
with
110 additions
and
92 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
#!/usr/bin/env python3 | ||
""" Extract version number from __init__.py | ||
""" | ||
|
||
import os | ||
def get_version(): | ||
from dunamai import Version | ||
version = Version.from_git() | ||
|
||
if version.distance > 0: | ||
version.stage = "a" | ||
version.revision = version.distance | ||
version.distance = 0 | ||
return version.serialize() | ||
|
||
ski_init = os.path.join(os.path.dirname(__file__), '../__init__.py') | ||
|
||
data = open(ski_init).readlines() | ||
version_line = next(line for line in data if line.startswith('__version__')) | ||
|
||
version = version_line.strip().split(' = ')[1].replace('"', '').replace("'", '') | ||
|
||
print(version) | ||
if __name__ == "__main__": | ||
print(get_version()) |
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
Oops, something went wrong.