-
Notifications
You must be signed in to change notification settings - Fork 12
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
Showing
7 changed files
with
884 additions
and
644 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
# placeholder version number | ||
__version__ = "0.0.0" | ||
|
||
# when we are on editable install from source, the _version file is present | ||
# and we can get a version from there | ||
# Adapted from: https://github.com/maresb/hatch-vcs-footgun-example | ||
# Define the variable '__version__': | ||
try: | ||
from . import _version | ||
# If we are in an editable install, the _versioneer file exist and we can use it to find the version | ||
from pyhdx._versioneer import get_versions | ||
|
||
__version__ = _version.get_versions()["version"] | ||
# This will fail with LookupError if the package is not installed in | ||
# editable mode or if Git is not installed. | ||
__version__ = get_versions()["version"] | ||
except ImportError: | ||
pass | ||
# If the project build with hatch, there should be a _version.py file | ||
try: | ||
from pyhdx._version import __version__ # noqa: F401 # type: ignore | ||
except ModuleNotFoundError: | ||
# The user is probably trying to run this without having installed | ||
# the package, so complain. | ||
raise RuntimeError("PyHDX is not correctly installed. Please install it with pip.") |
Oops, something went wrong.