File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 8181
8282assert _lib , "Ensure we eagerly import the Vortex native library"
8383
84+ from importlib import metadata as _metadata
85+
86+ # Resolve the installed distribution version so it is available as vortex.__version__.
87+ __version__ = "unknown"
88+ try :
89+ # Try to read the installed distribution version for the Python package name.
90+ __version__ = _metadata .version ("vortex-data" )
91+ except _metadata .PackageNotFoundError :
92+ # If the distribution is not installed, keep the unknown fallback.
93+ pass
94+
8495__all__ = [
8596 # --- Modules ---
8697 "arrays" ,
169180 "ArrayIterator" ,
170181 # Scan
171182 "RepeatedScan" ,
183+ # Version
184+ "__version__" ,
172185]
Original file line number Diff line number Diff line change 1+ # SPDX-License-Identifier: Apache-2.0
2+ # SPDX-FileCopyrightText: Copyright the Vortex contributors
3+
4+ import importlib .metadata
5+
6+ import pytest
7+
8+ import vortex
9+
10+
11+ def test_version_matches_metadata ():
12+ try :
13+ expected = importlib .metadata .version ("vortex-data" )
14+ except importlib .metadata .PackageNotFoundError :
15+ pytest .skip ("vortex-data distribution metadata unavailable" )
16+ # Ensure the exported version matches the distribution metadata.
17+ assert vortex .__version__ == expected
You can’t perform that action at this time.
0 commit comments