8000 Try to generate a version from Meson · matplotlib/matplotlib@e65e538 · GitHub
[go: up one dir, main page]

Skip to content

Commit e65e538

Browse files
committed
Try to generate a version from Meson
1 parent 3cf6965 commit e65e538

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

lib/matplotlib/_version.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version = '@VCS_TAG@'

lib/matplotlib/meson.build

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,23 @@ typing_sources = [
138138
py3.install_sources(python_sources, typing_sources,
139139
subdir: 'matplotlib')
140140

141+
fs = import('fs')
142+
if fs.exists('_version.py')
143+
py3.install_sources('_version.py', subdir: 'matplotlib')
144+
else
145+
cfg = configuration_data()
146+
cfg.set_quoted('VCS_TAG', meson.project_version())
147+
# version_py_gen = find_program('version-py-gen.py')
148+
configure_file(
149+
input: '_version.py.in', output: '_version.py',
150+
configuration: cfg,
151+
# command: [version_py_gen, ...],
152+
install: true,
153+
install_tag: 'python-runtime',
154+
install_dir: py3.get_install_dir() / 'matplotlib')
155+
# meson.add_dist_script(version_py_gen, ...)
156+
endif
157+
141158
subdir('_api')
142159
subdir('axes')
143160
subdir('backends')

0 commit comments

Comments
 (0)
0