This repository has been archived by the owner on Jan 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: parse version from git tags and add
check-for-update
to cli (#179
) * BLD: parse version from git tags and comply with PEP440 * ENH: add `check-for-update` command to wkz cli
- Loading branch information
Showing
7 changed files
with
88 additions
and
13 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
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 |
---|---|---|
@@ -1 +1,21 @@ | ||
__version__ = "0.20.1" | ||
import os | ||
import subprocess | ||
from pathlib import Path | ||
|
||
|
||
def _get_version() -> str: | ||
cwd = Path.cwd() | ||
os.chdir(Path(__file__).parent.parent) | ||
try: | ||
cmd = ["python", "-W", "ignore", "setup.py", "-V"] | ||
out = subprocess.check_output(cmd, stderr=subprocess.DEVNULL) | ||
if not isinstance(out, str): | ||
out = out.decode("utf-8") | ||
version = out.strip() | ||
except Exception: | ||
version = "unknown" | ||
os.chdir(cwd) | ||
return version | ||
|
||
|
||
__version__ = _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
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