summaryrefslogtreecommitdiff
path: root/numpy/version.py
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@gmail.com>2022-11-23 23:40:23 +0100
committerRalf Gommers <ralf.gommers@gmail.com>2022-11-25 12:37:46 +0100
commit4002a7d421ff10780c28a3643683af7a9754f87f (patch)
treea06d4c10642d1c93d552f80f1e90f393c9953c18 /numpy/version.py
parent632f573f12c641990bfac24cf4df435804340a7f (diff)
downloadnumpy-4002a7d421ff10780c28a3643683af7a9754f87f.tar.gz
BLD: enable building NumPy with Meson
This enables building with NumPy on Linux and macOS. Windows support should be complete to, but is untested as of now and may need a few tweaks. This contains: - A set of `meson.build` files and related code generation script tweaks, header templates, etc. - One CI job on Linux - Basic docs on using Meson to build NumPy (not yet integrated in the html docs, it's too early for that - this is for early adopters right now). The build should be complete, with the major exception of SIMD support. The full test suite passes. See gh-22546 for the tracking issue with detailed notes on the plan for switching NumPy to Meson as its build system. Co-authored-by: Stefan van der Walt <stefanv@berkeley.edu>
Diffstat (limited to 'numpy/version.py')
-rw-r--r--numpy/version.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/numpy/version.py b/numpy/version.py
index d5657d0d0..d9d2fe1b7 100644
--- a/numpy/version.py
+++ b/numpy/version.py
@@ -4,12 +4,20 @@ from ._version import get_versions
__ALL__ = ['version', '__version__', 'full_version', 'git_revision', 'release']
+
+_built_with_meson = False
+try:
+ from ._version_meson import get_versions
+ _built_with_meson = True
+except ImportError:
+ from ._version import get_versions
+
vinfo: dict[str, str] = get_versions()
version = vinfo["version"]
__version__ = vinfo.get("closest-tag", vinfo["version"])
-full_version = vinfo['version']
git_revision = vinfo['full-revisionid']
release = 'dev0' not in version and '+' not in version
-short_version = vinfo['version'].split("+")[0]
+full_version = version
+short_version = version.split("+")[0]
del get_versions, vinfo