| 1 |
__all__ = [ |
| 2 |
"__version__", |
| 3 |
] |
| 4 |
|
| 5 |
try: |
| 6 |
# Read version from SCM metadata |
| 7 |
# This will only exist in a development environment |
| 8 |
from setuptools_scm import get_version |
| 9 |
|
| 10 |
# Excluded from coverage because a pure test environment (such as the one |
| 11 |
# used by tox in CI) won't have setuptools_scm |
| 12 |
__version__ = get_version("../..", relative_to=__file__) # pragma: no cover |
| 13 |
except (ModuleNotFoundError, LookupError): # pragma: no-cover-if-missing-setuptools_scm |
| 14 |
# If setuptools_scm isn't in the environment, the call to import will fail. |
| 15 |
# If it *is* in the environment, but the code isn't a git checkout (e.g., |
| 16 |
# it's been pip installed non-editable) the call to get_version() will fail. |
| 17 |
# If either of these occurs, read version from the installer metadata. |
| 18 |
from importlib.metadata import version |
| 19 |
|
| 20 |
__version__ = version("briefcase") |