forked from ansible/django-ansible-base
-
Notifications
You must be signed in to change notification settings - Fork 0
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
9973419
commit 44f8700
Showing
4 changed files
with
19 additions
and
27 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,18 @@ | ||
try: | ||
from ._version import version | ||
except ImportError: | ||
version = 'Unknown' | ||
from ._version import __version__, __version_tuple__ # noqa: F401 | ||
except Exception: | ||
import datetime | ||
import subprocess | ||
from typing import Tuple, Union | ||
|
||
from typing import Tuple, Union | ||
calver_now = datetime.datetime.now().strftime("%Y.%m.%d") | ||
shaw = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('ascii').strip() | ||
|
||
VERSION_TUPLE = Tuple[Union[int, str], ...] | ||
VERSION_TUPLE = Tuple[Union[int, str], ...] | ||
|
||
__version__: str | ||
__version_tuple__: VERSION_TUPLE | ||
version_tuple: VERSION_TUPLE | ||
__version__: str | ||
__version_tuple__: VERSION_TUPLE | ||
version_tuple: VERSION_TUPLE | ||
|
||
__version__ = version | ||
__version_tuple__ = version_tuple = tuple(version.split('.')) | ||
__version__ = f'{calver_now}-{shaw}' | ||
__version_tuple__ = version_tuple = tuple(__version__.split('.')) |
This file was deleted.
Oops, something went wrong.
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