-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix version traceback in python 3.12 (#276)
* fix version traceback in python 3.12 * bump version
- Loading branch information
Showing
3 changed files
with
23 additions
and
7 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,3 +1,18 @@ | ||
import pkg_resources | ||
import sys | ||
|
||
__version__ = pkg_resources.get_distribution("gita").version | ||
|
||
def get_version() -> str: | ||
try: | ||
import pkg_resources | ||
except ImportError: | ||
try: | ||
from importlib.metadata import version | ||
except ImportError: | ||
print("cannot determine version", sys.version_info) | ||
else: | ||
return version("gita") | ||
else: | ||
return pkg_resources.get_distribution("gita").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