mirror of
https://github.com/google/benchmark.git
synced 2024-11-28 15:34:33 +00:00
3623765dd3
* Add `setuptools_scm` for dynamic zero-config Python versioning This removes the need for manually bumping versions in the Python bindings. For the wheel uploads, the correct semver version is inferred in the case of tagged commits, which is exactly the case in GitHub CI. The docs were updated to reflect the changes in the release workflow. * Add separate version variable and module, use PEP484-compliant exports This is the best practice mentioned in the `setuptools_scm` docs, see https://setuptools-scm.readthedocs.io/en/latest/usage/#version-at-runtime.
8 lines
182 B
Python
8 lines
182 B
Python
from importlib.metadata import PackageNotFoundError, version
|
|
|
|
try:
|
|
__version__ = version("google-benchmark")
|
|
except PackageNotFoundError:
|
|
# package is not installed
|
|
pass
|