Skip to content

Commit

Permalink
Add dunder version to top-level __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrjones committed Jun 10, 2024
1 parent cc97112 commit 7256f8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ requires = [
]

[tool.setuptools_scm]
write_to = "virtualizarr/_version.py"
write_to_template = '''
# Do not change! Do not track in version control!
__version__ = "{version}"
'''
fallback_version = "9999"

[tool.setuptools.packages.find]
exclude = ["docs", "tests", "tests.*", "docs.*"]
Expand Down
9 changes: 9 additions & 0 deletions virtualizarr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
from .manifests import ChunkManifest, ManifestArray # type: ignore # noqa
from .xarray import VirtualiZarrDatasetAccessor # type: ignore # noqa
from .xarray import open_virtual_dataset # noqa: F401

from importlib.metadata import version as _version

try:
__version__ = _version("virtualizarr")
except Exception:
# Local copy or not installed with setuptools.
# Disable minimum version checks on downstream libraries.
__version__ = "9999"

0 comments on commit 7256f8f

Please sign in to comment.