Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /Daylily-Informatics_bloom /bloom_lims /_version.py
| """ | |
| Version management for BLOOM LIMS. | |
| Version resolution priority: | |
| 1. BLOOM_VERSION environment variable (override / CI) | |
| 2. importlib.metadata (installed package) | |
| 3. bloom_lims._scm_version (generated by setuptools-scm at build time) | |
| _scm_version.py is auto-generated — do not edit or commit it. | |
| """ | |
| from __future__ import annotations | |
| import os | |
| from functools import lru_cache | |
| def get_version() -> str: | |
| """Return the BLOOM LIMS version string.""" | |
| env_version = os.environ.get("BLOOM_VERSION") | |
| if env_version: | |
| return env_version | |
| metadata_error: Exception | None = None | |
| try: | |
| from importlib.metadata import version | |
| return version("bloom_lims") | |
| except Exception as exc: | |
| metadata_error = exc | |
| try: | |
| from bloom_lims._scm_version import __version__ as scm_version | |
| return scm_version | |
| except ImportError as exc: | |
| raise RuntimeError( | |
| "Bloom version metadata is unavailable. Install the package or build it " | |
| "with setuptools-scm metadata before running Bloom." | |
| ) from (metadata_error or exc) | |
| def clear_version_cache() -> None: | |
| """Clear the cached version (useful for testing).""" | |
| get_version.cache_clear() | |
| # Module-level version for easy import | |
| __version__ = get_version() | |
Xet Storage Details
- Size:
- 1.33 kB
- Xet hash:
- 8117553f129a2d9e89454fed928ffd81d0aa93a30614c509e082b1489e20b608
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.